[libc-commits] [libc] [llvm] [libc][math] Refactor log2f16 to Header Only. (PR #176526)
via libc-commits
libc-commits at lists.llvm.org
Fri Jan 16 18:19:15 PST 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 h,cpp -- libc/shared/math/log2f16.h libc/src/__support/math/log2f16.h libc/shared/math.h libc/src/math/generic/log2f16.cpp libc/test/shared/shared_math_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/math/log2f16.h b/libc/src/__support/math/log2f16.h
index 73d4d2fb0..c22c4b7cc 100644
--- a/libc/src/__support/math/log2f16.h
+++ b/libc/src/__support/math/log2f16.h
@@ -69,7 +69,7 @@ static constexpr fputil::ExceptValues<float16, N_LOG2F16_EXCEPTS>
}};
#endif // !LIBC_MATH_HAS_SKIP_ACCURATE_PASS
-LIBC_INLINE static constexpr float16 log2f16 (float16 x) {
+LIBC_INLINE static constexpr float16 log2f16(float16 x) {
using namespace math::expxf16_internal;
using FPBits = fputil::FPBits<float16>;
FPBits x_bits(x);
``````````
</details>
https://github.com/llvm/llvm-project/pull/176526
More information about the libc-commits
mailing list