[libc-commits] [libc] [libc][math] Qualify getpayload functions to constexpr (PR #195532)
via libc-commits
libc-commits at lists.llvm.org
Sun May 3 07:36:53 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/math/getpayload.h libc/src/__support/math/getpayloadbf16.h libc/src/__support/math/getpayloadf.h libc/src/__support/math/getpayloadf128.h libc/src/__support/math/getpayloadf16.h libc/src/__support/math/getpayloadl.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/BasicOperations.h b/libc/src/__support/FPUtil/BasicOperations.h
index acd3e16da..e6f5f29e7 100644
--- a/libc/src/__support/FPUtil/BasicOperations.h
+++ b/libc/src/__support/FPUtil/BasicOperations.h
@@ -365,7 +365,8 @@ totalordermag(T x, T y) {
}
template <typename T>
-LIBC_INLINE constexpr cpp::enable_if_t<cpp::is_floating_point_v<T>, T> getpayload(T x) {
+LIBC_INLINE constexpr cpp::enable_if_t<cpp::is_floating_point_v<T>, T>
+getpayload(T x) {
using FPBits = FPBits<T>;
using StorageType = typename FPBits::StorageType;
FPBits x_bits(x);
``````````
</details>
https://github.com/llvm/llvm-project/pull/195532
More information about the libc-commits
mailing list