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

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Nov 3 22:16:13 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 cpp,h -- libc/shared/math/ldexpf80.h libc/shared/math/scalblnf80.h libc/shared/math/scalbnf80.h libc/src/__support/math/ldexpf80.h libc/src/__support/math/scalblnf80.h libc/src/__support/math/scalbnf80.h libc/src/math/generic/ldexpf80.cpp libc/src/math/generic/scalblnf80.cpp libc/src/math/generic/scalbnf80.cpp libc/src/math/ldexpf80.h libc/src/math/scalblnf80.h libc/src/math/scalbnf80.h libc/test/src/math/smoke/ldexpf80_test.cpp libc/test/src/math/smoke/scalblnf80_test.cpp libc/test/src/math/smoke/scalbnf80_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 3b427fd3c..b2ce9ceb4 100644
--- a/libc/shared/math.h
+++ b/libc/shared/math.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"
@@ -516,15 +516,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/math/generic/ldexpf80.cpp b/libc/src/math/generic/ldexpf80.cpp
index 56e631d71..9345949d5 100644
--- a/libc/src/math/generic/ldexpf80.cpp
+++ b/libc/src/math/generic/ldexpf80.cpp
@@ -15,8 +15,7 @@
 namespace LIBC_NAMESPACE_DECL {
 
 LLVM_LIBC_FUNCTION(float80, ldexpf80, (float80 x, int exp)) {
-  return cpp::bit_cast<float80>(
-      math::ldexpf80(cpp::bit_cast<Float80>(x), exp));
+  return cpp::bit_cast<float80>(math::ldexpf80(cpp::bit_cast<Float80>(x), exp));
 }
 
 } // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/math/generic/scalblnf80.cpp b/libc/src/math/generic/scalblnf80.cpp
index 2cee4c961..523b732f4 100644
--- a/libc/src/math/generic/scalblnf80.cpp
+++ b/libc/src/math/generic/scalblnf80.cpp
@@ -15,8 +15,7 @@
 namespace LIBC_NAMESPACE_DECL {
 
 LLVM_LIBC_FUNCTION(float80, scalblnf80, (float80 x, long n)) {
-  return cpp::bit_cast<float80>(
-      math::scalblnf80(cpp::bit_cast<Float80>(x), n));
+  return cpp::bit_cast<float80>(math::scalblnf80(cpp::bit_cast<Float80>(x), n));
 }
 
 } // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/math/generic/scalbnf80.cpp b/libc/src/math/generic/scalbnf80.cpp
index 53986ccac..0dfb8e1ab 100644
--- a/libc/src/math/generic/scalbnf80.cpp
+++ b/libc/src/math/generic/scalbnf80.cpp
@@ -15,8 +15,7 @@
 namespace LIBC_NAMESPACE_DECL {
 
 LLVM_LIBC_FUNCTION(float80, scalbnf80, (float80 x, int n)) {
-  return cpp::bit_cast<float80>(
-      math::scalbnf80(cpp::bit_cast<Float80>(x), n));
+  return cpp::bit_cast<float80>(math::scalbnf80(cpp::bit_cast<Float80>(x), n));
 }
 
 } // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/math/scalbnf80.h b/libc/src/math/scalbnf80.h
index 549d5849f..e838d37be 100644
--- a/libc/src/math/scalbnf80.h
+++ b/libc/src/math/scalbnf80.h
@@ -1,4 +1,5 @@
-//===-- Implementation header for scalbnf80 ----------------------*- C++ -*-===//
+//===-- Implementation header for scalbnf80 ----------------------*- 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/test/shared/shared_math_test.cpp b/libc/test/shared/shared_math_test.cpp
index f8f575955..22225e11c 100644
--- a/libc/test/shared/shared_math_test.cpp
+++ b/libc/test/shared/shared_math_test.cpp
@@ -729,7 +729,8 @@ TEST(LlvmLibcSharedMathTest, AllFloat80) {
   EXPECT_EQ(0L, LIBC_NAMESPACE::shared::llogbf80(Float80(1.0)));
   EXPECT_FP_EQ(Float80(0.0), LIBC_NAMESPACE::shared::logbf80(Float80(1.0)));
   EXPECT_FP_EQ(Float80(0.0), LIBC_NAMESPACE::shared::ldexpf80(Float80(0.0), 0));
-  EXPECT_FP_EQ(Float80(0.0), LIBC_NAMESPACE::shared::scalbnf80(Float80(0.0), 0));
+  EXPECT_FP_EQ(Float80(0.0),
+               LIBC_NAMESPACE::shared::scalbnf80(Float80(0.0), 0));
   EXPECT_FP_EQ(Float80(0.0),
                LIBC_NAMESPACE::shared::scalblnf80(Float80(0.0), 0L));
 }
diff --git a/libc/test/src/math/smoke/scalblnf80_test.cpp b/libc/test/src/math/smoke/scalblnf80_test.cpp
index eb45e7906..ebf8a41de 100644
--- a/libc/test/src/math/smoke/scalblnf80_test.cpp
+++ b/libc/test/src/math/smoke/scalblnf80_test.cpp
@@ -1,4 +1,5 @@
-//===-- Unittests for scalblnf80 -------------------------------------------===//
+//===-- Unittests for scalblnf80
+//-------------------------------------------===//
 //
 // 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/test/src/math/smoke/scalbnf80_test.cpp b/libc/test/src/math/smoke/scalbnf80_test.cpp
index 3e7b8aa95..fb322966f 100644
--- a/libc/test/src/math/smoke/scalbnf80_test.cpp
+++ b/libc/test/src/math/smoke/scalbnf80_test.cpp
@@ -1,4 +1,5 @@
-//===-- Unittests for scalbnf80 --------------------------------------------===//
+//===-- Unittests for scalbnf80
+//--------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.

``````````

</details>


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


More information about the llvm-branch-commits mailing list