diff --git a/libc/config/linux/aarch64/entrypoints.txt b/libc/config/linux/aarch64/entrypoints.txt index 840d4cec14bbf..00c4b2ec0f828 100644 --- a/libc/config/linux/aarch64/entrypoints.txt +++ b/libc/config/linux/aarch64/entrypoints.txt @@ -735,6 +735,7 @@ if(LIBC_TYPES_HAS_FLOAT16) libc.src.math.rintf16 libc.src.math.roundevenf16 libc.src.math.roundf16 + libc.src.math.rsqrtf16 libc.src.math.scalblnf16 libc.src.math.scalbnf16 libc.src.math.setpayloadf16 diff --git a/libc/config/linux/riscv/entrypoints.txt b/libc/config/linux/riscv/entrypoints.txt index 653282c7d3935..89e3653186d13 100644 --- a/libc/config/linux/riscv/entrypoints.txt +++ b/libc/config/linux/riscv/entrypoints.txt @@ -749,6 +749,7 @@ if(LIBC_TYPES_HAS_FLOAT16) libc.src.math.rintf16 libc.src.math.roundevenf16 libc.src.math.roundf16 + libc.src.math.rsqrtf16 libc.src.math.scalblnf16 libc.src.math.scalbnf16 libc.src.math.setpayloadf16 diff --git a/libc/config/linux/x86_64/entrypoints.txt b/libc/config/linux/x86_64/entrypoints.txt index 1fef16f190af6..0bb8a683c5b01 100644 --- a/libc/config/linux/x86_64/entrypoints.txt +++ b/libc/config/linux/x86_64/entrypoints.txt @@ -784,6 +784,7 @@ if(LIBC_TYPES_HAS_FLOAT16) libc.src.math.rintf16 libc.src.math.roundevenf16 libc.src.math.roundf16 + libc.src.math.rsqrtf16 libc.src.math.scalblnf16 libc.src.math.scalbnf16 libc.src.math.setpayloadf16 diff --git a/libc/docs/headers/math/index.rst b/libc/docs/headers/math/index.rst index 6c0e2190808df..7d5b341ba674a 100644 --- a/libc/docs/headers/math/index.rst +++ b/libc/docs/headers/math/index.rst @@ -255,6 +255,7 @@ Basic Operations Higher Math Functions ===================== + +-----------+------------------+-----------------+------------------------+----------------------+------------------------+----------++------------+------------------------+----------------------------+ | | (float) | (double) | (long double) | (float16) | (float128) | (bfloat16) | C23 Definition Section | C23 Error Handling Section | +===========+==================+=================+========================+======================+========================+========================+========================+============================+ @@ -342,7 +343,7 @@ Higher Math Functions +-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+ | rootn | | | | | | | 7.12.7.8 | F.10.4.8 | +-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+ -| rsqrt | | | | | | | 7.12.7.9 | F.10.4.9 | +| rsqrt | | | | |check| | | | 7.12.7.9 | F.10.4.9 | +-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+ | sin | |check| | |check| | | |check| | | | 7.12.4.6 | F.10.1.6 | +-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+ @@ -363,6 +364,7 @@ Higher Math Functions | tgamma | | | | | | | 7.12.8.4 | F.10.5.4 | +-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+ + Legends: * |check| : correctly rounded for all 4 rounding modes. diff --git a/libc/include/math.yaml b/libc/include/math.yaml index 17f26fcfcb308..6c800a0e2aa28 100644 --- a/libc/include/math.yaml +++ b/libc/include/math.yaml @@ -2349,6 +2349,13 @@ functions: return_type: long double arguments: - type: long double + - name: rsqrtf16 + standards: + - stdc + return_type: _Float16 + arguments: + - type: _Float16 + guard: LIBC_TYPES_HAS_FLOAT16 - name: scalbln standards: - stdc diff --git a/libc/shared/math.h b/libc/shared/math.h index 69d785b3e0291..4f20095912bf1 100644 --- a/libc/shared/math.h +++ b/libc/shared/math.h @@ -53,4 +53,6 @@ #include "math/ldexpf128.h" #include "math/ldexpf16.h" +#include "math/rsqrtf16.h" + #endif // LLVM_LIBC_SHARED_MATH_H diff --git a/libc/shared/math/rsqrtf16.h b/libc/shared/math/rsqrtf16.h new file mode 100644 index 0000000000000..54c7499214636 --- /dev/null +++ b/libc/shared/math/rsqrtf16.h @@ -0,0 +1,29 @@ +//===-- Shared rsqrtf16 function -------------------------------*- C++ -*-===// +// +// 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 +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_LIBC_SHARED_MATH_RSQRTF16_H +#define LLVM_LIBC_SHARED_MATH_RSQRTF16_H + +#include "include/llvm-libc-macros/float16-macros.h" + +#ifdef LIBC_TYPES_HAS_FLOAT16 + +#include "shared/libc_common.h" +#include "src/__support/math/rsqrtf16.h" + +namespace LIBC_NAMESPACE_DECL { +namespace shared { + +using math::rsqrtf16; + +} // namespace shared +} // namespace LIBC_NAMESPACE_DECL + +#endif // LIBC_TYPES_HAS_FLOAT16 + +#endif // LLVM_LIBC_SHARED_MATH_RSQRTF16_H diff --git a/libc/src/__support/math/CMakeLists.txt b/libc/src/__support/math/CMakeLists.txt index 39dc0e57f4472..ed5f314b0a9b5 100644 --- a/libc/src/__support/math/CMakeLists.txt +++ b/libc/src/__support/math/CMakeLists.txt @@ -109,6 +109,22 @@ add_header_library( libc.src.__support.macros.properties.types ) + +add_header_library( + rsqrtf16 + HDRS + rsqrtf16.h + DEPENDS + libc.src.__support.FPUtil.cast + libc.src.__support.FPUtil.fenv_impl + libc.src.__support.FPUtil.fp_bits + libc.src.__support.FPUtil.multiply_add + libc.src.__support.FPUtil.polyeval + libc.src.__support.FPUtil.manipulation_functions + libc.src.__support.macros.optimization + libc.src.__support.macros.properties.types +) + add_header_library( asin_utils HDRS diff --git a/libc/src/__support/math/rsqrtf16.h b/libc/src/__support/math/rsqrtf16.h new file mode 100644 index 0000000000000..8a107b4881a66 --- /dev/null +++ b/libc/src/__support/math/rsqrtf16.h @@ -0,0 +1,83 @@ +//===-- Implementation header for rsqrtf16 ----------------------*- C++ -*-===// +// +// 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 +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_LIBC_SRC___SUPPORT_MATH_RSQRTF16_H +#define LLVM_LIBC_SRC___SUPPORT_MATH_RSQRTF16_H + +#include "include/llvm-libc-macros/float16-macros.h" + +#ifdef LIBC_TYPES_HAS_FLOAT16 + +#include "src/__support/FPUtil/FEnvImpl.h" +#include "src/__support/FPUtil/FPBits.h" +#include "src/__support/FPUtil/ManipulationFunctions.h" +#include "src/__support/FPUtil/cast.h" +#include "src/__support/FPUtil/multiply_add.h" +#include "src/__support/FPUtil/sqrt.h" +#include "src/__support/macros/optimization.h" + +namespace LIBC_NAMESPACE_DECL { +namespace math { + +LIBC_INLINE static constexpr float16 rsqrtf16(float16 x) { + using FPBits = fputil::FPBits; + FPBits xbits(x); + + const uint16_t x_u = xbits.uintval(); + const uint16_t x_abs = x_u & 0x7fff; + const uint16_t x_sign = x_u >> 15; + + // x is NaN + if (LIBC_UNLIKELY(xbits.is_nan())) { + if (xbits.is_signaling_nan()) { + fputil::raise_except_if_required(FE_INVALID); + return FPBits::quiet_nan().get_val(); + } + return x; + } + + // |x| = 0 + if (LIBC_UNLIKELY(x_abs == 0x0)) { + fputil::raise_except_if_required(FE_DIVBYZERO); + fputil::set_errno_if_required(ERANGE); + return FPBits::inf(Sign::POS).get_val(); + } + + // -inf <= x < 0 + if (LIBC_UNLIKELY(x_sign == 1)) { + fputil::raise_except_if_required(FE_INVALID); + fputil::set_errno_if_required(EDOM); + return FPBits::quiet_nan().get_val(); + } + + // x = +inf => rsqrt(x) = 0 + if (LIBC_UNLIKELY(xbits.is_inf())) + return FPBits::zero().get_val(); + + // TODO: add integer based implementation when LIBC_TARGET_CPU_HAS_FPU_FLOAT + // is not defined + float result = 1.0f / fputil::sqrt(fputil::cast(x)); + + // Targeted post-corrections to ensure correct rounding in half for specific + // mantissa patterns + const uint16_t half_mantissa = x_abs & 0x3ff; + if (LIBC_UNLIKELY(half_mantissa == 0x011F)) { + result = fputil::multiply_add(result, 0x1.0p-21f, result); + } else if (LIBC_UNLIKELY(half_mantissa == 0x0313)) { + result = fputil::multiply_add(result, -0x1.0p-21f, result); + } + + return fputil::cast(result); +} + +} // namespace math +} // namespace LIBC_NAMESPACE_DECL + +#endif // LIBC_TYPES_HAS_FLOAT16 + +#endif // LLVM_LIBC_SRC___SUPPORT_MATH_RSQRTF16_H diff --git a/libc/src/math/CMakeLists.txt b/libc/src/math/CMakeLists.txt index e418a8b0e24b9..a6f400c873b7e 100644 --- a/libc/src/math/CMakeLists.txt +++ b/libc/src/math/CMakeLists.txt @@ -516,6 +516,8 @@ add_math_entrypoint_object(roundevenf16) add_math_entrypoint_object(roundevenf128) add_math_entrypoint_object(roundevenbf16) +add_math_entrypoint_object(rsqrtf16) + add_math_entrypoint_object(scalbln) add_math_entrypoint_object(scalblnf) add_math_entrypoint_object(scalblnl) diff --git a/libc/src/math/generic/CMakeLists.txt b/libc/src/math/generic/CMakeLists.txt index 263c5dfd0832b..ca7baeccae01a 100644 --- a/libc/src/math/generic/CMakeLists.txt +++ b/libc/src/math/generic/CMakeLists.txt @@ -973,7 +973,7 @@ add_entrypoint_object( ) add_entrypoint_object( - roundevenbf16 + roundevenbf16 SRCS roundevenbf16.cpp HDRS @@ -988,6 +988,17 @@ add_entrypoint_object( ROUND_OPT ) +add_entrypoint_object( + rsqrtf16 + SRCS + rsqrtf16.cpp + HDRS + ../rsqrtf16.h + DEPENDS + libc.src.__support.math.rsqrtf16 + libc.src.errno.errno +) + add_entrypoint_object( lround SRCS diff --git a/libc/src/math/generic/rsqrtf16.cpp b/libc/src/math/generic/rsqrtf16.cpp new file mode 100644 index 0000000000000..fb166b131d673 --- /dev/null +++ b/libc/src/math/generic/rsqrtf16.cpp @@ -0,0 +1,15 @@ +//===-- Half-precision rsqrt function -------------------------------------===// +// +// 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/rsqrtf16.h" +#include "src/__support/math/rsqrtf16.h" + +namespace LIBC_NAMESPACE_DECL { + +LLVM_LIBC_FUNCTION(float16, rsqrtf16, (float16 x)) { return math::rsqrtf16(x); } +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/math/rsqrtf16.h b/libc/src/math/rsqrtf16.h new file mode 100644 index 0000000000000..c88ab5256ce88 --- /dev/null +++ b/libc/src/math/rsqrtf16.h @@ -0,0 +1,21 @@ +//===-- Implementation header for rsqrtf16 ----------------------*- C++ -*-===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_LIBC_SRC_MATH_RSQRTF16_H +#define LLVM_LIBC_SRC_MATH_RSQRTF16_H + +#include "src/__support/macros/config.h" +#include "src/__support/macros/properties/types.h" + +namespace LIBC_NAMESPACE_DECL { + +float16 rsqrtf16(float16 x); + +} // namespace LIBC_NAMESPACE_DECL + +#endif // LLVM_LIBC_SRC_MATH_RSQRTF16_H diff --git a/libc/test/shared/CMakeLists.txt b/libc/test/shared/CMakeLists.txt index 48241d3f55287..495d6f0a81a4c 100644 --- a/libc/test/shared/CMakeLists.txt +++ b/libc/test/shared/CMakeLists.txt @@ -48,4 +48,6 @@ add_fp_unittest( libc.src.__support.math.ldexpf libc.src.__support.math.ldexpf128 libc.src.__support.math.ldexpf16 + libc.src.__support.math.rsqrtf16 + ) diff --git a/libc/test/shared/shared_math_test.cpp b/libc/test/shared/shared_math_test.cpp index 2e5a2d51146d4..aa459f88c29f5 100644 --- a/libc/test/shared/shared_math_test.cpp +++ b/libc/test/shared/shared_math_test.cpp @@ -17,6 +17,8 @@ TEST(LlvmLibcSharedMathTest, AllFloat16) { EXPECT_FP_EQ(0x0p+0f16, LIBC_NAMESPACE::shared::acoshf16(1.0f16)); EXPECT_FP_EQ(0x0p+0f16, LIBC_NAMESPACE::shared::acospif16(1.0f16)); + EXPECT_FP_EQ(0x1p+0f16, LIBC_NAMESPACE::shared::rsqrtf16(1.0f16)); + EXPECT_FP_EQ(0x0p+0f16, LIBC_NAMESPACE::shared::asinf16(0.0f16)); EXPECT_FP_EQ(0x0p+0f16, LIBC_NAMESPACE::shared::asinhf16(0.0f16)); EXPECT_FP_EQ(0x0p+0f16, LIBC_NAMESPACE::shared::atanf16(0.0f16)); diff --git a/libc/test/src/math/CMakeLists.txt b/libc/test/src/math/CMakeLists.txt index 378eadcf9e70b..9d644703a61ae 100644 --- a/libc/test/src/math/CMakeLists.txt +++ b/libc/test/src/math/CMakeLists.txt @@ -1678,6 +1678,17 @@ add_fp_unittest( libc.src.math.sqrtl ) +add_fp_unittest( + rsqrtf16_test + NEED_MPFR + SUITE + libc-math-unittests + SRCS + rsqrtf16_test.cpp + DEPENDS + libc.src.math.rsqrtf16 +) + add_fp_unittest( sqrtf16_test NEED_MPFR diff --git a/libc/test/src/math/rsqrtf16_test.cpp b/libc/test/src/math/rsqrtf16_test.cpp new file mode 100644 index 0000000000000..d2f3fe8f49b92 --- /dev/null +++ b/libc/test/src/math/rsqrtf16_test.cpp @@ -0,0 +1,42 @@ +//===-- Exhaustive test for rsqrtf16 --------------------------------------===// +// +// 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/rsqrtf16.h" +#include "test/UnitTest/FPMatcher.h" +#include "test/UnitTest/Test.h" +#include "utils/MPFRWrapper/MPFRUtils.h" + +using LlvmLibcRsqrtf16Test = LIBC_NAMESPACE::testing::FPTest; + +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(LlvmLibcRsqrtf16Test, PositiveRange) { + for (uint16_t v = POS_START; v <= POS_STOP; ++v) { + float16 x = FPBits(v).get_val(); + + EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Rsqrt, x, + LIBC_NAMESPACE::rsqrtf16(x), 0.5); + } +} + +TEST_F(LlvmLibcRsqrtf16Test, NegativeRange) { + for (uint16_t v = NEG_START; v <= NEG_STOP; ++v) { + float16 x = FPBits(v).get_val(); + + EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Rsqrt, x, + LIBC_NAMESPACE::rsqrtf16(x), 0.5); + } +} diff --git a/libc/test/src/math/smoke/CMakeLists.txt b/libc/test/src/math/smoke/CMakeLists.txt index b8d5ecf4d77e5..eadd5f0970722 100644 --- a/libc/test/src/math/smoke/CMakeLists.txt +++ b/libc/test/src/math/smoke/CMakeLists.txt @@ -3502,6 +3502,17 @@ add_fp_unittest( libc.src.math.sqrtl ) +add_fp_unittest( + rsqrtf16_test + SUITE + libc-math-smoke-tests + SRCS + rsqrtf16_test.cpp + DEPENDS + libc.src.math.rsqrtf16 + libc.hdr.errno_macros +) + add_fp_unittest( sqrtf16_test SUITE diff --git a/libc/test/src/math/smoke/rsqrtf16_test.cpp b/libc/test/src/math/smoke/rsqrtf16_test.cpp new file mode 100644 index 0000000000000..be88336e2b195 --- /dev/null +++ b/libc/test/src/math/smoke/rsqrtf16_test.cpp @@ -0,0 +1,36 @@ +//===-- Unittests for rsqrtf16 --------------------------------------------===// +// +// 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 "hdr/errno_macros.h" +#include "src/math/rsqrtf16.h" +#include "test/UnitTest/FPMatcher.h" +#include "test/UnitTest/Test.h" + +using LlvmLibcRsqrtf16Test = LIBC_NAMESPACE::testing::FPTest; +TEST_F(LlvmLibcRsqrtf16Test, SpecialNumbers) { + EXPECT_FP_EQ(aNaN, LIBC_NAMESPACE::rsqrtf16(aNaN)); + EXPECT_MATH_ERRNO(0); + + EXPECT_FP_EQ_WITH_EXCEPTION(aNaN, LIBC_NAMESPACE::rsqrtf16(sNaN), FE_INVALID); + EXPECT_MATH_ERRNO(0); + + EXPECT_FP_EQ(inf, LIBC_NAMESPACE::rsqrtf16(0.0f)); + EXPECT_MATH_ERRNO(ERANGE); + + EXPECT_FP_EQ(1.0f, LIBC_NAMESPACE::rsqrtf16(1.0f)); + EXPECT_MATH_ERRNO(0); + + EXPECT_FP_EQ(0.0f, LIBC_NAMESPACE::rsqrtf16(inf)); + EXPECT_MATH_ERRNO(0); + + EXPECT_FP_EQ(aNaN, LIBC_NAMESPACE::rsqrtf16(neg_inf)); + EXPECT_MATH_ERRNO(EDOM); + + EXPECT_FP_EQ(aNaN, LIBC_NAMESPACE::rsqrtf16(-2.0f)); + EXPECT_MATH_ERRNO(EDOM); +} diff --git a/libc/utils/MPFRWrapper/MPCommon.cpp b/libc/utils/MPFRWrapper/MPCommon.cpp index c255220774110..6b78bee6e7cae 100644 --- a/libc/utils/MPFRWrapper/MPCommon.cpp +++ b/libc/utils/MPFRWrapper/MPCommon.cpp @@ -393,6 +393,12 @@ MPFRNumber MPFRNumber::rint(mpfr_rnd_t rnd) const { return result; } +MPFRNumber MPFRNumber::rsqrt() const { + MPFRNumber result(*this); + mpfr_rec_sqrt(result.value, value, mpfr_rounding); + return result; +} + MPFRNumber MPFRNumber::mod_2pi() const { MPFRNumber result(0.0, 1280); MPFRNumber _2pi(0.0, 1280); diff --git a/libc/utils/MPFRWrapper/MPCommon.h b/libc/utils/MPFRWrapper/MPCommon.h index 25bdc9bc00250..9f4107a7961d2 100644 --- a/libc/utils/MPFRWrapper/MPCommon.h +++ b/libc/utils/MPFRWrapper/MPCommon.h @@ -222,6 +222,7 @@ class MPFRNumber { bool round_to_long(long &result) const; bool round_to_long(mpfr_rnd_t rnd, long &result) const; MPFRNumber rint(mpfr_rnd_t rnd) const; + MPFRNumber rsqrt() const; MPFRNumber mod_2pi() const; MPFRNumber mod_pi_over_2() const; MPFRNumber mod_pi_over_4() const; diff --git a/libc/utils/MPFRWrapper/MPFRUtils.cpp b/libc/utils/MPFRWrapper/MPFRUtils.cpp index 144a4ec25d213..a7d307b47c3e8 100644 --- a/libc/utils/MPFRWrapper/MPFRUtils.cpp +++ b/libc/utils/MPFRWrapper/MPFRUtils.cpp @@ -91,6 +91,8 @@ unary_operation(Operation op, InputType input, unsigned int precision, return mpfrInput.round(); case Operation::RoundEven: return mpfrInput.roundeven(); + case Operation::Rsqrt: + return mpfrInput.rsqrt(); case Operation::Sin: return mpfrInput.sin(); case Operation::Sinpi: diff --git a/libc/utils/MPFRWrapper/MPFRUtils.h b/libc/utils/MPFRWrapper/MPFRUtils.h index 35d7942a2620e..a33fcd21789f9 100644 --- a/libc/utils/MPFRWrapper/MPFRUtils.h +++ b/libc/utils/MPFRWrapper/MPFRUtils.h @@ -56,6 +56,7 @@ enum class Operation : int { ModPIOver4, Round, RoundEven, + Rsqrt, Sin, Sinpi, Sinh, diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel index d05b788696105..921163a413067 100644 --- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel @@ -2296,6 +2296,21 @@ libc_support_library( ], ) +libc_support_library( + name = "__support_math_rsqrtf16", + hdrs = ["src/__support/math/rsqrtf16.h"], + deps = [ + ":__support_fputil_cast", + ":__support_fputil_fenv_impl", + ":__support_fputil_fp_bits", + ":__support_fputil_manipulation_functions", + ":__support_fputil_multiply_add", + ":__support_fputil_polyeval", + ":__support_macros_optimization", + ":__support_macros_properties_types", + ], +) + libc_support_library( name = "__support_math_asin_utils", hdrs = ["src/__support/math/asin_utils.h"], @@ -3244,6 +3259,14 @@ libc_math_function( ], ) +libc_math_function( + name = "rsqrtf16", + additional_deps = [ + ":__support_math_rsqrtf16", + ":errno", + ], +) + libc_math_function( name = "acoshf16", additional_deps = [