[libc-commits] [libc] [llvm] [libc][math][c23] Add cosbf16 math function (PR #185801)
Muhammad Bassiouni via libc-commits
libc-commits at lists.llvm.org
Wed Jul 8 23:02:39 PDT 2026
================
@@ -0,0 +1,75 @@
+//===-- Implementation header for cosbf16 -----------------------*- 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_COSBF16_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_COSBF16_H
+
+#include "hdr/errno_macros.h"
+#include "hdr/fenv_macros.h"
+#include "sincosf_utils.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/macros/optimization.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace math {
+
+LIBC_INLINE bfloat16 cosbf16(bfloat16 x) {
----------------
bassiounix wrote:
We added some primitives recently to make math functions `constexpr`, could you use those and add the respective tests?
https://github.com/llvm/llvm-project/pull/185801
More information about the libc-commits
mailing list