[libc-commits] [libc] [libc] Implement CMPLX related macros (PR #156344)
via libc-commits
libc-commits at lists.llvm.org
Wed Sep 3 10:54:29 PDT 2025
================
@@ -19,6 +21,18 @@
// TODO: Add imaginary macros once GCC or Clang support _Imaginary builtin-type.
+#define CMPLX(x, y) __builtin_complex((double)(x), (double)(y))
+#define CMPLXF(x, y) __builtin_complex((float)(x), (float)(y))
+#define CMPLXL(x, y) __builtin_complex((long double)(x), (long double)(y))
+
+#ifdef LIBC_TYPES_HAS_FLOAT16
----------------
lntue wrote:
I just noticed that we do have checks for complex float16 type in `include/llvm-libc-types/cfloat16.h`. Can you refactor the checks to `include/llvm-libc-macros/cfloat16-macros.h` similar to `float16-macros.h` and use it here? Thanks,
https://github.com/llvm/llvm-project/pull/156344
More information about the libc-commits
mailing list