[libc-commits] [libc] [llvm] [libc][math][c23] Add sinhbf16 function (PR #224645)

via libc-commits libc-commits at lists.llvm.org
Wed Nov 4 03:04:08 PST 2026


================
@@ -0,0 +1,171 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// General sinh/cosh functions for bfloat16.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SRC___SUPPORT_MATH_SINHCOSHBF16_UTILS_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_SINHCOSHBF16_UTILS_H
+
+#include "src/__support/FPUtil/FPBits.h"
+#include "src/__support/FPUtil/PolyEval.h"
+#include "src/__support/FPUtil/multiply_add.h"
+#include "src/__support/FPUtil/nearest_integer.h"
+#include "src/__support/macros/attributes.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace math {
+
+namespace sinhcoshbf16_internal {
+
+LIBC_INLINE_VAR constexpr float LOG2F_E = 0x1.715476p+0f;
+
+LIBC_INLINE_VAR constexpr float LOGF_2 = 0x1.62e43p-1f;
+
+LIBC_INLINE_VAR constexpr cpp::array<uint32_t, 32> EXP2_MID_5_BITS = {
----------------
dil12321 wrote:

updated b14be4691e618dbeadf2b30b25dbaaf884c362c2

https://github.com/llvm/llvm-project/pull/224645


More information about the libc-commits mailing list