[libc-commits] [libc] [libc][math] Extend iscanonical macro to _Float16 and float128 (PR #204981)

via libc-commits libc-commits at lists.llvm.org
Sun Jun 21 08:24:34 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions c,h -- libc/include/llvm-libc-macros/math-function-macros.h libc/test/include/iscanonical_test.c --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libc/include/llvm-libc-macros/math-function-macros.h b/libc/include/llvm-libc-macros/math-function-macros.h
index 5de923dcb..3a2574161 100644
--- a/libc/include/llvm-libc-macros/math-function-macros.h
+++ b/libc/include/llvm-libc-macros/math-function-macros.h
@@ -31,14 +31,16 @@
 #define __LIBC_MATH_ISCANONICAL_F16
 #endif
 #if defined(LIBC_TYPES_HAS_FLOAT128) && (LDBL_MANT_DIG != 113)
-#define __LIBC_MATH_ISCANONICAL_F128 float128 : iscanonicalf128,
+#define __LIBC_MATH_ISCANONICAL_F128                                           \
+  float128:                                                                    \
+  iscanonicalf128,
 #else
 #define __LIBC_MATH_ISCANONICAL_F128
 #endif
 #define iscanonical(x)                                                         \
   _Generic((x),                                                                \
-      __LIBC_MATH_ISCANONICAL_F16 __LIBC_MATH_ISCANONICAL_F128                 \
-      float: iscanonicalf,                                                     \
+      __LIBC_MATH_ISCANONICAL_F16                                              \
+          __LIBC_MATH_ISCANONICAL_F128 float: iscanonicalf,                    \
       double: iscanonical,                                                     \
       long double: iscanonicall)(x)
 #endif

``````````

</details>


https://github.com/llvm/llvm-project/pull/204981


More information about the libc-commits mailing list