[libc-commits] [libc] [libc][math][c++23] Add sqrtbf16 math function (PR #156654)
Krishna Pandey via libc-commits
libc-commits at lists.llvm.org
Wed Sep 3 05:27:57 PDT 2025
https://github.com/krishna2803 created https://github.com/llvm/llvm-project/pull/156654
This PR adds sqrtbf16 higher math function for BFloat16 type along with the tests.
>From a3a5d6bef1c1c2df23dd9c6661634ec269c37398 Mon Sep 17 00:00:00 2001
From: Krishna Pandey <kpandey81930 at gmail.com>
Date: Wed, 3 Sep 2025 17:34:11 +0530
Subject: [PATCH 1/4] feat: implement sqrtbf16 higher math function
Signed-off-by: Krishna Pandey <kpandey81930 at gmail.com>
---
libc/src/math/CMakeLists.txt | 1 +
libc/src/math/generic/CMakeLists.txt | 16 +++++++++++++++-
libc/src/math/generic/sqrtbf16.cpp | 21 +++++++++++++++++++++
libc/src/math/sqrtbf16.h | 21 +++++++++++++++++++++
4 files changed, 58 insertions(+), 1 deletion(-)
create mode 100644 libc/src/math/generic/sqrtbf16.cpp
create mode 100644 libc/src/math/sqrtbf16.h
diff --git a/libc/src/math/CMakeLists.txt b/libc/src/math/CMakeLists.txt
index 95e5ae781490f..a31e1a2288356 100644
--- a/libc/src/math/CMakeLists.txt
+++ b/libc/src/math/CMakeLists.txt
@@ -552,6 +552,7 @@ add_math_entrypoint_object(sqrtf)
add_math_entrypoint_object(sqrtl)
add_math_entrypoint_object(sqrtf16)
add_math_entrypoint_object(sqrtf128)
+add_math_entrypoint_object(sqrtbf16)
add_math_entrypoint_object(tan)
add_math_entrypoint_object(tanf)
diff --git a/libc/src/math/generic/CMakeLists.txt b/libc/src/math/generic/CMakeLists.txt
index ba71e5f9e1260..236c5fc01a5da 100644
--- a/libc/src/math/generic/CMakeLists.txt
+++ b/libc/src/math/generic/CMakeLists.txt
@@ -3211,7 +3211,21 @@ add_entrypoint_object(
libc.src.__support.macros.optimization
libc.src.__support.macros.properties.types
libc.src.__support.FPUtil.sqrt
- )
+)
+
+add_entrypoint_object(
+ sqrtbf16
+ SRCS
+ sqrtbf16.cpp
+ HDRS
+ ../sqrtbf16.h
+ DEPENDS
+ libc.src.__support.common
+ libc.src.__support.FPUtil.bfloat16
+ libc.src.__support.FPUtil.sqrt
+ libc.src.__support.macros.config
+ libc.src.__support.macros.properties.types
+)
add_entrypoint_object(
remquof
diff --git a/libc/src/math/generic/sqrtbf16.cpp b/libc/src/math/generic/sqrtbf16.cpp
new file mode 100644
index 0000000000000..061e5522a4d8f
--- /dev/null
+++ b/libc/src/math/generic/sqrtbf16.cpp
@@ -0,0 +1,21 @@
+//===-- Implementation of sqrtbf16 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/sqrtbf16.h"
+#include "src/__support/FPUtil/bfloat16.h"
+#include "src/__support/FPUtil/sqrt.h"
+#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+LLVM_LIBC_FUNCTION(bfloat16, sqrtbf16, (bfloat16 x)) {
+ return fputil::sqrt<bfloat16>(x);
+}
+
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/math/sqrtbf16.h b/libc/src/math/sqrtbf16.h
new file mode 100644
index 0000000000000..4300e9cab6ad3
--- /dev/null
+++ b/libc/src/math/sqrtbf16.h
@@ -0,0 +1,21 @@
+//===-- Implementation header for sqrtbf16 ----------------------*- 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_SQRTBF16_H
+#define LLVM_LIBC_SRC_MATH_SQRTBF16_H
+
+#include "src/__support/macros/config.h"
+#include "src/__support/macros/properties/types.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+bfloat16 sqrtbf16(bfloat16 x);
+
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SRC_MATH_SQRTBF16_H
>From edb359dbb1c265f751a725bc7b8e1f4db8e24afe Mon Sep 17 00:00:00 2001
From: Krishna Pandey <kpandey81930 at gmail.com>
Date: Wed, 3 Sep 2025 17:36:50 +0530
Subject: [PATCH 2/4] chore: add smoke and general tests for sqrtbf16 higher
math function
Signed-off-by: Krishna Pandey <kpandey81930 at gmail.com>
---
libc/test/src/math/CMakeLists.txt | 12 +++++++++
libc/test/src/math/smoke/CMakeLists.txt | 13 ++++++++++
libc/test/src/math/smoke/sqrtbf16_test.cpp | 14 +++++++++++
libc/test/src/math/sqrtbf16_test.cpp | 29 ++++++++++++++++++++++
libc/utils/MPFRWrapper/MPFRUtils.cpp | 7 ++++++
5 files changed, 75 insertions(+)
create mode 100644 libc/test/src/math/smoke/sqrtbf16_test.cpp
create mode 100644 libc/test/src/math/sqrtbf16_test.cpp
diff --git a/libc/test/src/math/CMakeLists.txt b/libc/test/src/math/CMakeLists.txt
index 8e24c5d5c2afd..11323ee161c2a 100644
--- a/libc/test/src/math/CMakeLists.txt
+++ b/libc/test/src/math/CMakeLists.txt
@@ -1705,6 +1705,18 @@ add_fp_unittest(
libc.src.math.sqrtf128
)
+add_fp_unittest(
+ sqrtbf16_test
+ NEED_MPFR
+ SUITE
+ libc-math-unittests
+ SRCS
+ sqrtbf16_test.cpp
+ DEPENDS
+ libc.src.math.sqrtbf16
+ libc.src.__support.FPUtil.bfloat16
+)
+
add_fp_unittest(
generic_sqrtf_test
NEED_MPFR
diff --git a/libc/test/src/math/smoke/CMakeLists.txt b/libc/test/src/math/smoke/CMakeLists.txt
index a5f856f05bb8c..3be617b732caa 100644
--- a/libc/test/src/math/smoke/CMakeLists.txt
+++ b/libc/test/src/math/smoke/CMakeLists.txt
@@ -3455,6 +3455,19 @@ add_fp_unittest(
libc.src.math.sqrtf128
)
+add_fp_unittest(
+ sqrtbf16_test
+ SUITE
+ libc-math-smoke-tests
+ SRCS
+ sqrtbf16_test.cpp
+ HDRS
+ SqrtTest.h
+ DEPENDS
+ libc.src.math.sqrtbf16
+ libc.src.__support.FPUtil.bfloat16
+)
+
add_fp_unittest(
generic_sqrtf_test
SUITE
diff --git a/libc/test/src/math/smoke/sqrtbf16_test.cpp b/libc/test/src/math/smoke/sqrtbf16_test.cpp
new file mode 100644
index 0000000000000..25629347fee3e
--- /dev/null
+++ b/libc/test/src/math/smoke/sqrtbf16_test.cpp
@@ -0,0 +1,14 @@
+//===-- Unittests for sqrtbf16 --------------------------------------------===//
+//
+// 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 "SqrtTest.h"
+
+#include "src/__support/FPUtil/bfloat16.h"
+#include "src/math/sqrtbf16.h"
+
+LIST_SQRT_TESTS(bfloat16, LIBC_NAMESPACE::sqrtbf16);
diff --git a/libc/test/src/math/sqrtbf16_test.cpp b/libc/test/src/math/sqrtbf16_test.cpp
new file mode 100644
index 0000000000000..186ddd5487133
--- /dev/null
+++ b/libc/test/src/math/sqrtbf16_test.cpp
@@ -0,0 +1,29 @@
+//===-- Exhaustive test for sqrtbf16 --------------------------------------===//
+//
+// 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/__support/FPUtil/bfloat16.h"
+#include "src/math/sqrtbf16.h"
+#include "test/UnitTest/FPMatcher.h"
+#include "test/UnitTest/Test.h"
+#include "utils/MPFRWrapper/MPFRUtils.h"
+
+using LlvmLibcSqrtf16Test = LIBC_NAMESPACE::testing::FPTest<bfloat16>;
+
+namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
+
+// range: [0, inf]
+static constexpr uint16_t POS_START = 0x0000U;
+static constexpr uint16_t POS_STOP = 0x7f80U;
+
+TEST_F(LlvmLibcSqrtf16Test, PositiveRange) {
+ for (uint16_t v = POS_START; v <= POS_STOP; ++v) {
+ bfloat16 x = FPBits(v).get_val();
+ EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Sqrt, x,
+ LIBC_NAMESPACE::sqrtbf16(x), 0.5);
+ }
+}
diff --git a/libc/utils/MPFRWrapper/MPFRUtils.cpp b/libc/utils/MPFRWrapper/MPFRUtils.cpp
index 2155f324aa8a5..42e505e2fccb7 100644
--- a/libc/utils/MPFRWrapper/MPFRUtils.cpp
+++ b/libc/utils/MPFRWrapper/MPFRUtils.cpp
@@ -272,6 +272,10 @@ template void explain_unary_operation_single_output_error(Operation op,
double, RoundingMode);
#endif // LIBC_TYPES_FLOAT128_IS_NOT_LONG_DOUBLE
+template void explain_unary_operation_single_output_error(Operation op,
+ bfloat16, bfloat16,
+ double, RoundingMode);
+
template <typename T>
void explain_unary_operation_two_outputs_error(
Operation op, T input, const BinaryOutput<T> &libc_result,
@@ -559,6 +563,9 @@ template bool compare_unary_operation_single_output(Operation, float128,
long double, double,
RoundingMode);
#endif // LIBC_TYPES_FLOAT128_IS_NOT_LONG_DOUBLE
+template bool compare_unary_operation_single_output(Operation, bfloat16,
+ bfloat16, double,
+ RoundingMode);
template <typename T>
bool compare_unary_operation_two_outputs(Operation op, T input,
>From f7ff333d82f8ee079cd4b23265759bc9178cee0c Mon Sep 17 00:00:00 2001
From: Krishna Pandey <kpandey81930 at gmail.com>
Date: Wed, 3 Sep 2025 17:39:37 +0530
Subject: [PATCH 3/4] chore: update entrypoints
Signed-off-by: Krishna Pandey <kpandey81930 at gmail.com>
---
libc/config/baremetal/aarch64/entrypoints.txt | 1 +
libc/config/baremetal/arm/entrypoints.txt | 1 +
libc/config/baremetal/riscv/entrypoints.txt | 1 +
libc/config/darwin/aarch64/entrypoints.txt | 1 +
libc/config/darwin/x86_64/entrypoints.txt | 1 +
libc/config/gpu/amdgpu/entrypoints.txt | 1 +
libc/config/gpu/nvptx/entrypoints.txt | 1 +
libc/config/linux/aarch64/entrypoints.txt | 1 +
libc/config/linux/arm/entrypoints.txt | 1 +
libc/config/linux/riscv/entrypoints.txt | 1 +
libc/config/linux/x86_64/entrypoints.txt | 1 +
libc/config/windows/entrypoints.txt | 1 +
12 files changed, 12 insertions(+)
diff --git a/libc/config/baremetal/aarch64/entrypoints.txt b/libc/config/baremetal/aarch64/entrypoints.txt
index c2e4c337f199a..df9f61ca6c108 100644
--- a/libc/config/baremetal/aarch64/entrypoints.txt
+++ b/libc/config/baremetal/aarch64/entrypoints.txt
@@ -811,6 +811,7 @@ list(APPEND TARGET_LIBM_ENTRYPOINTS
libc.src.math.roundevenbf16
libc.src.math.setpayloadbf16
libc.src.math.setpayloadsigbf16
+ libc.src.math.sqrtbf16
libc.src.math.truncbf16
libc.src.math.ufromfpbf16
libc.src.math.ufromfpxbf16
diff --git a/libc/config/baremetal/arm/entrypoints.txt b/libc/config/baremetal/arm/entrypoints.txt
index c4f3a87659b23..779f37be1859c 100644
--- a/libc/config/baremetal/arm/entrypoints.txt
+++ b/libc/config/baremetal/arm/entrypoints.txt
@@ -814,6 +814,7 @@ list(APPEND TARGET_LIBM_ENTRYPOINTS
libc.src.math.roundevenbf16
libc.src.math.setpayloadbf16
libc.src.math.setpayloadsigbf16
+ libc.src.math.sqrtbf16
libc.src.math.truncbf16
libc.src.math.ufromfpbf16
libc.src.math.ufromfpxbf16
diff --git a/libc/config/baremetal/riscv/entrypoints.txt b/libc/config/baremetal/riscv/entrypoints.txt
index 380ca57ea8aa9..d0ced09111f9f 100644
--- a/libc/config/baremetal/riscv/entrypoints.txt
+++ b/libc/config/baremetal/riscv/entrypoints.txt
@@ -814,6 +814,7 @@ list(APPEND TARGET_LIBM_ENTRYPOINTS
libc.src.math.roundevenbf16
libc.src.math.setpayloadbf16
libc.src.math.setpayloadsigbf16
+ libc.src.math.sqrtbf16
libc.src.math.truncbf16
libc.src.math.ufromfpbf16
libc.src.math.ufromfpxbf16
diff --git a/libc/config/darwin/aarch64/entrypoints.txt b/libc/config/darwin/aarch64/entrypoints.txt
index 1f4318fc88389..a9ae541f8ed44 100644
--- a/libc/config/darwin/aarch64/entrypoints.txt
+++ b/libc/config/darwin/aarch64/entrypoints.txt
@@ -644,6 +644,7 @@ list(APPEND TARGET_LIBM_ENTRYPOINTS
libc.src.math.roundevenbf16
libc.src.math.setpayloadbf16
libc.src.math.setpayloadsigbf16
+ libc.src.math.sqrtbf16
libc.src.math.truncbf16
libc.src.math.ufromfpbf16
libc.src.math.ufromfpxbf16
diff --git a/libc/config/darwin/x86_64/entrypoints.txt b/libc/config/darwin/x86_64/entrypoints.txt
index 0cba22016c960..120d98a4a6160 100644
--- a/libc/config/darwin/x86_64/entrypoints.txt
+++ b/libc/config/darwin/x86_64/entrypoints.txt
@@ -287,6 +287,7 @@ list(APPEND TARGET_LIBM_ENTRYPOINTS
libc.src.math.roundevenbf16
libc.src.math.setpayloadbf16
libc.src.math.setpayloadsigbf16
+ libc.src.math.sqrtbf16
libc.src.math.truncbf16
libc.src.math.ufromfpbf16
libc.src.math.ufromfpxbf16
diff --git a/libc/config/gpu/amdgpu/entrypoints.txt b/libc/config/gpu/amdgpu/entrypoints.txt
index e08b028865bfc..66d0b618fb7cb 100644
--- a/libc/config/gpu/amdgpu/entrypoints.txt
+++ b/libc/config/gpu/amdgpu/entrypoints.txt
@@ -670,6 +670,7 @@ list(APPEND TARGET_LIBM_ENTRYPOINTS
libc.src.math.roundevenbf16
libc.src.math.setpayloadbf16
libc.src.math.setpayloadsigbf16
+ libc.src.math.sqrtbf16
libc.src.math.truncbf16
libc.src.math.ufromfpbf16
libc.src.math.ufromfpxbf16
diff --git a/libc/config/gpu/nvptx/entrypoints.txt b/libc/config/gpu/nvptx/entrypoints.txt
index 88c8fc91ebb77..395c7985feee7 100644
--- a/libc/config/gpu/nvptx/entrypoints.txt
+++ b/libc/config/gpu/nvptx/entrypoints.txt
@@ -672,6 +672,7 @@ list(APPEND TARGET_LIBM_ENTRYPOINTS
libc.src.math.roundevenbf16
libc.src.math.setpayloadbf16
libc.src.math.setpayloadsigbf16
+ libc.src.math.sqrtbf16
libc.src.math.truncbf16
libc.src.math.ufromfpbf16
libc.src.math.ufromfpxbf16
diff --git a/libc/config/linux/aarch64/entrypoints.txt b/libc/config/linux/aarch64/entrypoints.txt
index 20924e9047c69..079466c3b8d81 100644
--- a/libc/config/linux/aarch64/entrypoints.txt
+++ b/libc/config/linux/aarch64/entrypoints.txt
@@ -899,6 +899,7 @@ list(APPEND TARGET_LIBM_ENTRYPOINTS
libc.src.math.roundevenbf16
libc.src.math.setpayloadbf16
libc.src.math.setpayloadsigbf16
+ libc.src.math.sqrtbf16
libc.src.math.truncbf16
libc.src.math.ufromfpbf16
libc.src.math.ufromfpxbf16
diff --git a/libc/config/linux/arm/entrypoints.txt b/libc/config/linux/arm/entrypoints.txt
index f2e8ddfe8e91a..116f554a6374b 100644
--- a/libc/config/linux/arm/entrypoints.txt
+++ b/libc/config/linux/arm/entrypoints.txt
@@ -514,6 +514,7 @@ list(APPEND TARGET_LIBM_ENTRYPOINTS
libc.src.math.roundevenbf16
libc.src.math.setpayloadbf16
libc.src.math.setpayloadsigbf16
+ libc.src.math.sqrtbf16
libc.src.math.truncbf16
libc.src.math.ufromfpbf16
libc.src.math.ufromfpxbf16
diff --git a/libc/config/linux/riscv/entrypoints.txt b/libc/config/linux/riscv/entrypoints.txt
index 0ad36a667232a..e5665a7cd139b 100644
--- a/libc/config/linux/riscv/entrypoints.txt
+++ b/libc/config/linux/riscv/entrypoints.txt
@@ -917,6 +917,7 @@ list(APPEND TARGET_LIBM_ENTRYPOINTS
libc.src.math.roundevenbf16
libc.src.math.setpayloadbf16
libc.src.math.setpayloadsigbf16
+ libc.src.math.sqrtbf16
libc.src.math.truncbf16
libc.src.math.ufromfpbf16
libc.src.math.ufromfpxbf16
diff --git a/libc/config/linux/x86_64/entrypoints.txt b/libc/config/linux/x86_64/entrypoints.txt
index c060e900472eb..73ad93d3fdf18 100644
--- a/libc/config/linux/x86_64/entrypoints.txt
+++ b/libc/config/linux/x86_64/entrypoints.txt
@@ -950,6 +950,7 @@ list(APPEND TARGET_LIBM_ENTRYPOINTS
libc.src.math.roundevenbf16
libc.src.math.setpayloadbf16
libc.src.math.setpayloadsigbf16
+ libc.src.math.sqrtbf16
libc.src.math.truncbf16
libc.src.math.ufromfpbf16
libc.src.math.ufromfpxbf16
diff --git a/libc/config/windows/entrypoints.txt b/libc/config/windows/entrypoints.txt
index 9e45b800b10a3..c742d88f8c90d 100644
--- a/libc/config/windows/entrypoints.txt
+++ b/libc/config/windows/entrypoints.txt
@@ -360,6 +360,7 @@ list(APPEND TARGET_LIBM_ENTRYPOINTS
libc.src.math.roundevenbf16
libc.src.math.setpayloadbf16
libc.src.math.setpayloadsigbf16
+ libc.src.math.sqrtbf16
libc.src.math.truncbf16
libc.src.math.ufromfpbf16
libc.src.math.ufromfpxbf16
>From 83ebd0f30be2b8e16a3f468b837f50ff8cab1c8c Mon Sep 17 00:00:00 2001
From: Krishna Pandey <kpandey81930 at gmail.com>
Date: Wed, 3 Sep 2025 17:47:02 +0530
Subject: [PATCH 4/4] docs: add sqrtbf16 higher math function
Signed-off-by: Krishna Pandey <kpandey81930 at gmail.com>
---
libc/docs/headers/math/index.rst | 214 +++++++++++++++----------------
1 file changed, 107 insertions(+), 107 deletions(-)
diff --git a/libc/docs/headers/math/index.rst b/libc/docs/headers/math/index.rst
index b329bf031312d..016d96ce69d4b 100644
--- a/libc/docs/headers/math/index.rst
+++ b/libc/docs/headers/math/index.rst
@@ -255,113 +255,113 @@ Basic Operations
Higher Math Functions
=====================
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| <Func> | <Func_f> (float) | <Func> (double) | <Func_l> (long double) | <Func_f16> (float16) | <Func_f128> (float128) | C23 Definition Section | C23 Error Handling Section |
-+===========+==================+=================+========================+======================+========================+========================+============================+
-| acos | |check| | |check| | | |check| | | 7.12.4.1 | F.10.1.1 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| acosh | |check| | | | |check| | | 7.12.5.1 | F.10.2.1 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| acospi | | | | |check| | | 7.12.4.8 | F.10.1.8 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| asin | |check| | |check| | | |check| | | 7.12.4.2 | F.10.1.2 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| asinh | |check| | | | |check| | | 7.12.5.2 | F.10.2.2 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| asinpi | | | | |check| | | 7.12.4.9 | F.10.1.9 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| atan | |check| | 1 ULP | | |check| | | 7.12.4.3 | F.10.1.3 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| atan2 | |check| | 1 ULP | | | 1 ULP | 7.12.4.4 | F.10.1.4 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| atan2pi | | | | | | 7.12.4.11 | F.10.1.11 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| atanh | |check| | | | |check| | | 7.12.5.3 | F.10.2.3 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| atanpi | | | | | | 7.12.4.10 | F.10.1.10 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| cbrt | |check| | |check| | | | | 7.12.7.1 | F.10.4.1 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| compoundn | | | | | | 7.12.7.2 | F.10.4.2 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| cos | |check| | |check| | | |check| | | 7.12.4.5 | F.10.1.5 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| cosh | |check| | | | |check| | | 7.12.5.4 | F.10.2.4 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| cospi | |check| | | | |check| | | 7.12.4.12 | F.10.1.12 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| dsqrt | N/A | N/A | |check| | N/A | |check|\* | 7.12.14.6 | F.10.11 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| erf | |check| | | | | | 7.12.8.1 | F.10.5.1 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| erfc | | | | | | 7.12.8.2 | F.10.5.2 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| exp | |check| | |check| | | |check| | | 7.12.6.1 | F.10.3.1 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| exp10 | |check| | |check| | | |check| | | 7.12.6.2 | F.10.3.2 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| exp10m1 | |check| | | | |check| | | 7.12.6.3 | F.10.3.3 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| exp2 | |check| | |check| | | |check| | | 7.12.6.4 | F.10.3.4 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| exp2m1 | |check| | | | |check| | | 7.12.6.5 | F.10.3.5 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| expm1 | |check| | |check| | | |check| | | 7.12.6.6 | F.10.3.6 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| fma | |check| | |check| | | |check| | | 7.12.13.1 | F.10.10.1 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| f16sqrt | |check|\* | |check|\* | |check|\* | N/A | |check| | 7.12.14.6 | F.10.11 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| fsqrt | N/A | |check| | |check| | N/A | |check|\* | 7.12.14.6 | F.10.11 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| hypot | |check| | |check| | | |check| | | 7.12.7.4 | F.10.4.4 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| lgamma | | | | | | 7.12.8.3 | F.10.5.3 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| log | |check| | |check| | | |check| | | 7.12.6.11 | F.10.3.11 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| log10 | |check| | |check| | | |check| | | 7.12.6.12 | F.10.3.12 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| log10p1 | | | | | | 7.12.6.13 | F.10.3.13 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| log1p | |check| | |check| | | | | 7.12.6.14 | F.10.3.14 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| log2 | |check| | |check| | | |check| | | 7.12.6.15 | F.10.3.15 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| log2p1 | | | | | | 7.12.6.16 | F.10.3.16 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| logp1 | | | | | | 7.12.6.14 | F.10.3.14 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| pow | |check| | 1 ULP | | | | 7.12.7.5 | F.10.4.5 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| powi\* | | | | | | | |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| pown | | | | | | 7.12.7.6 | F.10.4.6 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| powr | | | | | | 7.12.7.7 | F.10.4.7 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| rootn | | | | | | 7.12.7.8 | F.10.4.8 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| rsqrt | | | | | | 7.12.7.9 | F.10.4.9 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| sin | |check| | |check| | | |check| | | 7.12.4.6 | F.10.1.6 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| sincos | |check| | |check| | | | | | |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| sinh | |check| | | | |check| | | 7.12.5.5 | F.10.2.5 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| sinpi | |check| | | | |check| | | 7.12.4.13 | F.10.1.13 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| sqrt | |check| | |check| | |check| | |check| | |check| | 7.12.7.10 | F.10.4.10 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| tan | |check| | |check| | | |check| | | 7.12.4.7 | F.10.1.7 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| tanh | |check| | | | |check| | | 7.12.5.6 | F.10.2.6 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| tanpi | |check| | | | |check| | | 7.12.4.14 | F.10.1.14 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| tgamma | | | | | | 7.12.8.4 | F.10.5.4 |
-+-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+----------++------------+------------------------+----------------------------+
+| <Func> | <Func_f> (float) | <Func> (double) | <Func_l> (long double) | <Func_f16> (float16) | <Func_f128> (float128) | <Func_bf16> (bfloat16) | C23 Definition Section | C23 Error Handling Section |
++===========+==================+=================+========================+======================+========================+========================+========================+============================+
+| acos | |check| | |check| | | |check| | | | 7.12.4.1 | F.10.1.1 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| acosh | |check| | | | |check| | | | 7.12.5.1 | F.10.2.1 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| acospi | | | | |check| | | | 7.12.4.8 | F.10.1.8 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| asin | |check| | |check| | | |check| | | | 7.12.4.2 | F.10.1.2 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| asinh | |check| | | | |check| | | | 7.12.5.2 | F.10.2.2 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| asinpi | | | | |check| | | | 7.12.4.9 | F.10.1.9 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| atan | |check| | 1 ULP | | |check| | | | 7.12.4.3 | F.10.1.3 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| atan2 | |check| | 1 ULP | | | 1 ULP | | 7.12.4.4 | F.10.1.4 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| atan2pi | | | | | | | 7.12.4.11 | F.10.1.11 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| atanh | |check| | | | |check| | | | 7.12.5.3 | F.10.2.3 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| atanpi | | | | | | | 7.12.4.10 | F.10.1.10 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| cbrt | |check| | |check| | | | | | 7.12.7.1 | F.10.4.1 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| compoundn | | | | | | | 7.12.7.2 | F.10.4.2 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| cos | |check| | |check| | | |check| | | | 7.12.4.5 | F.10.1.5 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| cosh | |check| | | | |check| | | | 7.12.5.4 | F.10.2.4 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| cospi | |check| | | | |check| | | | 7.12.4.12 | F.10.1.12 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| dsqrt | N/A | N/A | |check| | N/A | |check|\* | | 7.12.14.6 | F.10.11 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| erf | |check| | | | | | | 7.12.8.1 | F.10.5.1 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| erfc | | | | | | | 7.12.8.2 | F.10.5.2 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| exp | |check| | |check| | | |check| | | | 7.12.6.1 | F.10.3.1 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| exp10 | |check| | |check| | | |check| | | | 7.12.6.2 | F.10.3.2 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| exp10m1 | |check| | | | |check| | | | 7.12.6.3 | F.10.3.3 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| exp2 | |check| | |check| | | |check| | | | 7.12.6.4 | F.10.3.4 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| exp2m1 | |check| | | | |check| | | | 7.12.6.5 | F.10.3.5 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| expm1 | |check| | |check| | | |check| | | | 7.12.6.6 | F.10.3.6 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| fma | |check| | |check| | | |check| | | | 7.12.13.1 | F.10.10.1 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| f16sqrt | |check|\* | |check|\* | |check|\* | N/A | |check| | | 7.12.14.6 | F.10.11 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| fsqrt | N/A | |check| | |check| | N/A | |check|\* | | 7.12.14.6 | F.10.11 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| hypot | |check| | |check| | | |check| | | | 7.12.7.4 | F.10.4.4 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| lgamma | | | | | | | 7.12.8.3 | F.10.5.3 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| log | |check| | |check| | | |check| | | | 7.12.6.11 | F.10.3.11 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| log10 | |check| | |check| | | |check| | | | 7.12.6.12 | F.10.3.12 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| log10p1 | | | | | | | 7.12.6.13 | F.10.3.13 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| log1p | |check| | |check| | | | | | 7.12.6.14 | F.10.3.14 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| log2 | |check| | |check| | | |check| | | | 7.12.6.15 | F.10.3.15 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| log2p1 | | | | | | | 7.12.6.16 | F.10.3.16 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| logp1 | | | | | | | 7.12.6.14 | F.10.3.14 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| pow | |check| | 1 ULP | | | | | 7.12.7.5 | F.10.4.5 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| powi\* | | | | | | | | |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| pown | | | | | | | 7.12.7.6 | F.10.4.6 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| powr | | | | | | | 7.12.7.7 | F.10.4.7 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| rootn | | | | | | | 7.12.7.8 | F.10.4.8 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| rsqrt | | | | | | | 7.12.7.9 | F.10.4.9 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| sin | |check| | |check| | | |check| | | | 7.12.4.6 | F.10.1.6 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| sincos | |check| | |check| | | | | | | |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| sinh | |check| | | | |check| | | | 7.12.5.5 | F.10.2.5 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| sinpi | |check| | | | |check| | | | 7.12.4.13 | F.10.1.13 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| sqrt | |check| | |check| | |check| | |check| | |check| | |check| | 7.12.7.10 | F.10.4.10 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| tan | |check| | |check| | | |check| | | | 7.12.4.7 | F.10.1.7 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| tanh | |check| | | | |check| | | | 7.12.5.6 | F.10.2.6 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| tanpi | |check| | | | |check| | | | 7.12.4.14 | F.10.1.14 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
+| tgamma | | | | | | | 7.12.8.4 | F.10.5.4 |
++-----------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
Legends:
More information about the libc-commits
mailing list