[llvm-branch-commits] [libc] [llvm] [libc][math] Adds exponent decomposition functions for float80 (PR #238687)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Nov 3 22:16:29 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/frexpf80.h libc/shared/math/ilogbf80.h libc/shared/math/llogbf80.h libc/shared/math/logbf80.h libc/src/__support/math/frexpf80.h libc/src/__support/math/ilogbf80.h libc/src/__support/math/llogbf80.h libc/src/__support/math/logbf80.h libc/src/math/frexpf80.h libc/src/math/generic/frexpf80.cpp libc/src/math/generic/ilogbf80.cpp libc/src/math/generic/llogbf80.cpp libc/src/math/generic/logbf80.cpp libc/src/math/ilogbf80.h libc/src/math/llogbf80.h libc/src/math/logbf80.h libc/test/src/math/smoke/frexpf80_test.cpp libc/test/src/math/smoke/ilogbf80_test.cpp libc/test/src/math/smoke/llogbf80_test.cpp libc/test/src/math/smoke/logbf80_test.cpp libc/shared/math.h libc/test/shared/shared_math_constexpr_test.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 58ba1e01e..02982e69d 100644
--- a/libc/shared/math.h
+++ b/libc/shared/math.h
@@ -63,8 +63,8 @@
 #include "math/canonicalizebf16.h"
 #include "math/canonicalizef.h"
 #include "math/canonicalizef128.h"
-#include "math/canonicalizef80.h"
 #include "math/canonicalizef16.h"
+#include "math/canonicalizef80.h"
 #include "math/canonicalizel.h"
 #include "math/cbrt.h"
 #include "math/cbrtbf16.h"
@@ -322,8 +322,8 @@
 #include "math/issignalingbf16.h"
 #include "math/issignalingf.h"
 #include "math/issignalingf128.h"
-#include "math/issignalingf80.h"
 #include "math/issignalingf16.h"
+#include "math/issignalingf80.h"
 #include "math/issignalingl.h"
 #include "math/ldexp.h"
 #include "math/ldexpbf16.h"
@@ -513,15 +513,15 @@
 #include "math/totalorderbf16.h"
 #include "math/totalorderf.h"
 #include "math/totalorderf128.h"
-#include "math/totalorderf80.h"
 #include "math/totalorderf16.h"
+#include "math/totalorderf80.h"
 #include "math/totalorderl.h"
 #include "math/totalordermag.h"
 #include "math/totalordermagbf16.h"
 #include "math/totalordermagf.h"
 #include "math/totalordermagf128.h"
-#include "math/totalordermagf80.h"
 #include "math/totalordermagf16.h"
+#include "math/totalordermagf80.h"
 #include "math/totalordermagl.h"
 #include "math/trunc.h"
 #include "math/truncbf16.h"
diff --git a/libc/src/__support/math/logbf80.h b/libc/src/__support/math/logbf80.h
index 4a967f0c8..ca312d404 100644
--- a/libc/src/__support/math/logbf80.h
+++ b/libc/src/__support/math/logbf80.h
@@ -18,9 +18,7 @@ namespace LIBC_NAMESPACE_DECL {
 
 namespace math {
 
-LIBC_INLINE constexpr Float80 logbf80(Float80 x) {
-  return fputil::logb(x);
-}
+LIBC_INLINE constexpr Float80 logbf80(Float80 x) { return fputil::logb(x); }
 
 } // namespace math
 
diff --git a/libc/src/math/generic/frexpf80.cpp b/libc/src/math/generic/frexpf80.cpp
index 47793ba18..bf671e88a 100644
--- a/libc/src/math/generic/frexpf80.cpp
+++ b/libc/src/math/generic/frexpf80.cpp
@@ -15,8 +15,7 @@
 namespace LIBC_NAMESPACE_DECL {
 
 LLVM_LIBC_FUNCTION(float80, frexpf80, (float80 x, int *exp)) {
-  return cpp::bit_cast<float80>(
-      math::frexpf80(cpp::bit_cast<Float80>(x), exp));
+  return cpp::bit_cast<float80>(math::frexpf80(cpp::bit_cast<Float80>(x), exp));
 }
 
 } // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/math/generic/logbf80.cpp b/libc/src/math/generic/logbf80.cpp
index 44e401b7b..a505ff388 100644
--- a/libc/src/math/generic/logbf80.cpp
+++ b/libc/src/math/generic/logbf80.cpp
@@ -15,8 +15,7 @@
 namespace LIBC_NAMESPACE_DECL {
 
 LLVM_LIBC_FUNCTION(float80, logbf80, (float80 x)) {
-  return cpp::bit_cast<float80>(
-      math::logbf80(cpp::bit_cast<Float80>(x)));
+  return cpp::bit_cast<float80>(math::logbf80(cpp::bit_cast<Float80>(x)));
 }
 
 } // namespace LIBC_NAMESPACE_DECL

``````````

</details>


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


More information about the llvm-branch-commits mailing list