[libc-commits] [libc] [libc][math][c23] Add acospif16() function (PR #132754)
via libc-commits
libc-commits at lists.llvm.org
Tue Mar 25 07:49:54 PDT 2025
================
@@ -0,0 +1,42 @@
+//===-- Exhaustive test for acospif16 -------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/math/acospif16.h"
+#include "test/UnitTest/FPMatcher.h"
+#include "test/UnitTest/Test.h"
+#include "utils/MPFRWrapper/MPFRUtils.h"
+
+using LlvmLibcAcospif16Test = LIBC_NAMESPACE::testing::FPTest<float16>;
+
+namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
+
+// Range: [0, Inf]
+static constexpr uint16_t POS_START = 0x0000U;
+static constexpr uint16_t POS_STOP = 0x7c00U;
+
+// Range: [-Inf, 0]
+static constexpr uint16_t NEG_START = 0x8000U;
+static constexpr uint16_t NEG_STOP = 0xfc00U;
+
+TEST_F(LlvmLibcAcospif16Test, PositiveRange) {
+ for (uint16_t v = POS_START; v <= POS_STOP; ++v) {
+ float16 x = FPBits(v).get_val();
+
+ EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Acos, x,
----------------
lntue wrote:
comparing `acospif16` against `acos`? You'll need to update `MPFRUtils.(h|cpp)` and `MPCommon.(h|cpp)` to support the new enum+function `Acospi`
https://github.com/llvm/llvm-project/pull/132754
More information about the libc-commits
mailing list