[libc-commits] [libc] [llvm] [libc][math][c23] Add atan2f16 function (PR #183531)
via libc-commits
libc-commits at lists.llvm.org
Fri Feb 27 04:17:01 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/atan2f16.h libc/src/__support/math/atan2f16.h libc/src/math/atan2f16.h libc/src/math/generic/atan2f16.cpp libc/test/src/math/atan2f16_test.cpp libc/test/src/math/exhaustive/atan2f16_test.cpp libc/test/src/math/smoke/atan2f16_test.cpp libc/shared/math.h --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/test/src/math/exhaustive/atan2f16_test.cpp b/libc/test/src/math/exhaustive/atan2f16_test.cpp
index 8690d6379..ea3e4fed1 100644
--- a/libc/test/src/math/exhaustive/atan2f16_test.cpp
+++ b/libc/test/src/math/exhaustive/atan2f16_test.cpp
@@ -10,7 +10,8 @@
// Build with ninja, then run the test binary manually (NO_RUN_POSTBUILD).
//
// Run with log (from build dir, test is slow so useful for offline runs):
-// projects/libc/test/src/math/exhaustive/libc.test.src.math.exhaustive.atan2f16_test.__unit__ 2>&1 | tee atan2f16_exhaustive_$(date +%Y%m%d_%H%M%S).log
+// projects/libc/test/src/math/exhaustive/libc.test.src.math.exhaustive.atan2f16_test.__unit__
+// 2>&1 | tee atan2f16_exhaustive_$(date +%Y%m%d_%H%M%S).log
//
#include "exhaustive_test.h"
@@ -44,9 +45,9 @@ struct Atan2f16Checker : public virtual LIBC_NAMESPACE::testing::Test {
rounding);
failed += (!correct);
if (!correct) {
- EXPECT_MPFR_MATCH_ROUNDING(
- mpfr::Operation::Atan2, input, LIBC_NAMESPACE::atan2f16(y, x),
- 1.5, rounding);
+ EXPECT_MPFR_MATCH_ROUNDING(mpfr::Operation::Atan2, input,
+ LIBC_NAMESPACE::atan2f16(y, x), 1.5,
+ rounding);
}
} while (ybits++ < y_stop);
} while (xbits++ < x_stop);
@@ -57,7 +58,8 @@ struct Atan2f16Checker : public virtual LIBC_NAMESPACE::testing::Test {
using LlvmLibcAtan2f16ExhaustiveTest =
LlvmLibcExhaustiveMathTest<Atan2f16Checker, 1 << 8>;
-// All float16 bit patterns (excluding NaN payloads for speed; include if desired).
+// All float16 bit patterns (excluding NaN payloads for speed; include if
+// desired).
static constexpr uint16_t ALL_BITS_START = 0x0000U;
static constexpr uint16_t ALL_BITS_STOP = 0xFC00U; // finite + inf, no NaN
``````````
</details>
https://github.com/llvm/llvm-project/pull/183531
More information about the libc-commits
mailing list