[libc-commits] [libc] [llvm] [libc][math] Refactor ilogbf128 to Header Only (PR #175396)
via libc-commits
libc-commits at lists.llvm.org
Sat Jan 10 22:13:06 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/ilogbf128.h libc/src/__support/math/ilogbf128.h libc/shared/math.h libc/src/math/generic/ilogbf128.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/shared/math.h b/libc/shared/math.h
index 6932de634..336b8e447 100644
--- a/libc/shared/math.h
+++ b/libc/shared/math.h
@@ -68,5 +68,4 @@
#include "math/rsqrtf16.h"
#include "math/sin.h"
-
#endif // LLVM_LIBC_SHARED_MATH_H
diff --git a/libc/shared/math/ilogbf128.h b/libc/shared/math/ilogbf128.h
index b58915fb4..a0bbbe1e6 100644
--- a/libc/shared/math/ilogbf128.h
+++ b/libc/shared/math/ilogbf128.h
@@ -18,7 +18,7 @@
namespace LIBC_NAMESPACE_DECL {
namespace shared {
-
+
using math::ilogbf128;
} // namespace shared
diff --git a/libc/src/__support/math/ilogbf128.h b/libc/src/__support/math/ilogbf128.h
index 684911493..8df6f16c7 100644
--- a/libc/src/__support/math/ilogbf128.h
+++ b/libc/src/__support/math/ilogbf128.h
@@ -1,4 +1,5 @@
-//===-- Implementation header for ilogbf128 ----------------------*- C++ -*-===//
+//===-- Implementation header for ilogbf128 ----------------------*- C++
+//-*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
diff --git a/libc/src/math/generic/ilogbf128.cpp b/libc/src/math/generic/ilogbf128.cpp
index 593e36b06..a099697f4 100644
--- a/libc/src/math/generic/ilogbf128.cpp
+++ b/libc/src/math/generic/ilogbf128.cpp
@@ -7,10 +7,10 @@
//===----------------------------------------------------------------------===//
#include "src/math/ilogbf128.h"
+#include "lib/shared/math/ilogbf128.h"
#include "src/__support/FPUtil/ManipulationFunctions.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
-#include "lib/shared/math/ilogbf128.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, ilogbf128, (float128 x)) {
diff --git a/libc/test/shared/shared_math_test.cpp b/libc/test/shared/shared_math_test.cpp
index 392dab331..8930de4dd 100644
--- a/libc/test/shared/shared_math_test.cpp
+++ b/libc/test/shared/shared_math_test.cpp
@@ -103,7 +103,7 @@ TEST(LlvmLibcSharedMathTest, AllFloat128) {
EXPECT_FP_EQ_ALL_ROUNDING(float128(0.75), LIBC_NAMESPACE::shared::frexpf128(
float128(24), &exponent));
EXPECT_EQ(exponent, 5);
-
+
EXPECT_EQ(3, LIBC_NAMESPACE::shared::ilogbf128(float128(8.0)));
EXPECT_EQ(4, LIBC_NAMESPACE::shared::ilogbf128(float128(16.0)));
ASSERT_FP_EQ(float128(8 << 5),
``````````
</details>
https://github.com/llvm/llvm-project/pull/175396
More information about the libc-commits
mailing list