[libc-commits] [libc] [llvm] [libc][math][c23] Add asinpibf16 math function (PR #189351)
via libc-commits
libc-commits at lists.llvm.org
Mon Mar 30 03:50:01 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/shared/math/asinpibf16.h libc/src/__support/math/asinpibf16.h libc/src/math/asinpibf16.h libc/src/math/generic/asinpibf16.cpp libc/test/src/math/asinpibf16_test.cpp libc/test/src/math/smoke/asinpibf16_test.cpp libc/shared/math.h 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 8e7817e86..b311c8c79 100644
--- a/libc/shared/math.h
+++ b/libc/shared/math.h
@@ -24,8 +24,8 @@
#include "math/asinhf.h"
#include "math/asinhf16.h"
#include "math/asinpi.h"
-#include "math/asinpif.h"
#include "math/asinpibf16.h"
+#include "math/asinpif.h"
#include "math/asinpif16.h"
#include "math/atan.h"
#include "math/atan2.h"
diff --git a/libc/src/math/generic/asinpibf16.cpp b/libc/src/math/generic/asinpibf16.cpp
index 8197bfee4..3147ac245 100644
--- a/libc/src/math/generic/asinpibf16.cpp
+++ b/libc/src/math/generic/asinpibf16.cpp
@@ -11,6 +11,8 @@
namespace LIBC_NAMESPACE_DECL {
-LLVM_LIBC_FUNCTION(bfloat16, asinpibf16, (bfloat16 x)) { return math::asinpibf16(x); }
+LLVM_LIBC_FUNCTION(bfloat16, asinpibf16, (bfloat16 x)) {
+ return math::asinpibf16(x);
+}
} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/test/shared/shared_math_test.cpp b/libc/test/shared/shared_math_test.cpp
index b9046d89c..35c7fed36 100644
--- a/libc/test/shared/shared_math_test.cpp
+++ b/libc/test/shared/shared_math_test.cpp
@@ -425,7 +425,8 @@ TEST(LlvmLibcSharedMathTest, AllFloat128) {
TEST(LlvmLibcSharedMathTest, AllBFloat16) {
using FPBits = LIBC_NAMESPACE::fputil::FPBits<bfloat16>;
EXPECT_FP_EQ(bfloat16(0.0), LIBC_NAMESPACE::shared::atanbf16(bfloat16(0.0)));
- EXPECT_FP_EQ(bfloat16(0.0), LIBC_NAMESPACE::shared::asinpibf16(bfloat16(0.0)));
+ EXPECT_FP_EQ(bfloat16(0.0),
+ LIBC_NAMESPACE::shared::asinpibf16(bfloat16(0.0)));
EXPECT_FP_EQ(bfloat16(5.0), LIBC_NAMESPACE::shared::bf16add(2.0, 3.0));
EXPECT_FP_EQ(bfloat16(2.0f), LIBC_NAMESPACE::shared::bf16divf(4.0f, 2.0f));
EXPECT_FP_EQ(bfloat16(2.0), LIBC_NAMESPACE::shared::bf16divl(6.0L, 3.0L));
``````````
</details>
https://github.com/llvm/llvm-project/pull/189351
More information about the libc-commits
mailing list