[libc-commits] [libc] [llvm] [libc][math][c23] Add acosbf16 math function (PR #184633)
via libc-commits
libc-commits at lists.llvm.org
Sat Jun 6 08:40:22 PDT 2026
================
@@ -0,0 +1,94 @@
+//===-- Implementation header for acosbf16 ----------------------*- 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_ACOSBF16_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_ACOSBF16_H
+
+#include "src/__support/FPUtil/FEnvImpl.h"
+#include "src/__support/FPUtil/FPBits.h"
+#include "src/__support/FPUtil/bfloat16.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"
+#include "src/__support/math/inv_trigf_utils.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace math {
+
+LIBC_INLINE bfloat16 acosbf16(bfloat16 x) {
+ // Generated by Sollya using the following command:
+ // > display = hexadecimal;
+ // > round(pi/2, SG, RN);
+ constexpr float PI_2 = 0x1.921fb6p0f;
+ // > round(pi, SG, RN);
+ constexpr float PI = 0x1.921fb6p1;
----------------
lntue wrote:
`0x1.921fb6p1f`
https://github.com/llvm/llvm-project/pull/184633
More information about the libc-commits
mailing list