[libc-commits] [libc] [libc][math] Qualify fdim funtions to constexpr (PR #194137)
via libc-commits
libc-commits at lists.llvm.org
Sat Apr 25 13:55:01 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 cpp,h -- libc/src/__support/FPUtil/BasicOperations.h libc/src/__support/FPUtil/generic/add_sub.h libc/src/__support/math/fdim.h libc/src/__support/math/fdimbf16.h libc/src/__support/math/fdimf.h libc/src/__support/math/fdimf128.h libc/src/__support/math/fdimf16.h libc/src/__support/math/fdiml.h libc/test/shared/shared_math_constexpr_test.cpp --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/src/__support/FPUtil/generic/add_sub.h b/libc/src/__support/FPUtil/generic/add_sub.h
index aa1954c5b..e00557073 100644
--- a/libc/src/__support/FPUtil/generic/add_sub.h
+++ b/libc/src/__support/FPUtil/generic/add_sub.h
@@ -52,7 +52,8 @@ add_or_sub(InType x, InType y) {
if (LIBC_UNLIKELY(x_bits.is_inf_or_nan() || y_bits.is_inf_or_nan() ||
x_bits.is_zero() || y_bits.is_zero())) {
if (x_bits.is_nan() || y_bits.is_nan()) {
- if (!cpp::is_constant_evaluated() && (x_bits.is_signaling_nan() || y_bits.is_signaling_nan()))
+ if (!cpp::is_constant_evaluated() &&
+ (x_bits.is_signaling_nan() || y_bits.is_signaling_nan()))
raise_except_if_required(FE_INVALID);
if (x_bits.is_quiet_nan()) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/194137
More information about the libc-commits
mailing list