[libc-commits] [libc] [llvm] [libc][math] Refactor bf16mul family to header-only (PR #182018)

Mohamed Emad via libc-commits libc-commits at lists.llvm.org
Wed Feb 18 05:11:51 PST 2026


https://github.com/hulxv created https://github.com/llvm/llvm-project/pull/182018

Refactors the bf16mul math family to be header-only.

Closes https://github.com/llvm/llvm-project/issues/182017

Target Functions:
  - bf16mul
  - bf16mulf
  - bf16mulf128
  - bf16mull

>From 2c702910c7990d1e5fdf7049a73bd9135eab6877 Mon Sep 17 00:00:00 2001
From: hulxv <hulxxv at gmail.com>
Date: Wed, 18 Feb 2026 15:11:35 +0200
Subject: [PATCH] [libc][math] Refactor bf16mul family to header-only

Refactored functions:
  - bf16mul
  - bf16mulf
  - bf16mulf128
  - bf16mull
---
 libc/shared/math.h                            |  4 ++
 libc/shared/math/bf16mul.h                    | 22 ++++++++++
 libc/shared/math/bf16mulf.h                   | 22 ++++++++++
 libc/shared/math/bf16mulf128.h                | 28 +++++++++++++
 libc/shared/math/bf16mull.h                   | 22 ++++++++++
 libc/src/__support/math/CMakeLists.txt        | 37 +++++++++++++++++
 libc/src/__support/math/bf16mul.h             | 27 ++++++++++++
 libc/src/__support/math/bf16mulf.h            | 27 ++++++++++++
 libc/src/__support/math/bf16mulf128.h         | 33 +++++++++++++++
 libc/src/__support/math/bf16mull.h            | 27 ++++++++++++
 libc/src/math/generic/CMakeLists.txt          | 24 ++---------
 libc/src/math/generic/bf16mul.cpp             |  7 +---
 libc/src/math/generic/bf16mulf.cpp            |  7 +---
 libc/src/math/generic/bf16mulf128.cpp         |  7 +---
 libc/src/math/generic/bf16mull.cpp            |  7 +---
 libc/test/shared/CMakeLists.txt               |  4 ++
 libc/test/shared/shared_math_test.cpp         |  9 ++++
 .../llvm-project-overlay/libc/BUILD.bazel     | 41 +++++++++++++++++++
 18 files changed, 315 insertions(+), 40 deletions(-)
 create mode 100644 libc/shared/math/bf16mul.h
 create mode 100644 libc/shared/math/bf16mulf.h
 create mode 100644 libc/shared/math/bf16mulf128.h
 create mode 100644 libc/shared/math/bf16mull.h
 create mode 100644 libc/src/__support/math/bf16mul.h
 create mode 100644 libc/src/__support/math/bf16mulf.h
 create mode 100644 libc/src/__support/math/bf16mulf128.h
 create mode 100644 libc/src/__support/math/bf16mull.h

diff --git a/libc/shared/math.h b/libc/shared/math.h
index 828980a3500df..b8bc2dcef7b47 100644
--- a/libc/shared/math.h
+++ b/libc/shared/math.h
@@ -35,6 +35,10 @@
 #include "math/bf16addf128.h"
 #include "math/bf16divf.h"
 #include "math/bf16fmaf.h"
+#include "math/bf16mul.h"
+#include "math/bf16mulf.h"
+#include "math/bf16mulf128.h"
+#include "math/bf16mull.h"
 #include "math/canonicalize.h"
 #include "math/canonicalizebf16.h"
 #include "math/canonicalizef.h"
diff --git a/libc/shared/math/bf16mul.h b/libc/shared/math/bf16mul.h
new file mode 100644
index 0000000000000..064416c498f59
--- /dev/null
+++ b/libc/shared/math/bf16mul.h
@@ -0,0 +1,22 @@
+//===-- Shared bf16mul 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_BF16MUL_H
+#define LLVM_LIBC_SHARED_MATH_BF16MUL_H
+
+#include "src/__support/math/bf16mul.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::bf16mul;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_BF16MUL_H
diff --git a/libc/shared/math/bf16mulf.h b/libc/shared/math/bf16mulf.h
new file mode 100644
index 0000000000000..456bf85bfadf4
--- /dev/null
+++ b/libc/shared/math/bf16mulf.h
@@ -0,0 +1,22 @@
+//===-- Shared bf16mulf 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_BF16MULF_H
+#define LLVM_LIBC_SHARED_MATH_BF16MULF_H
+
+#include "src/__support/math/bf16mulf.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::bf16mulf;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_BF16MULF_H
diff --git a/libc/shared/math/bf16mulf128.h b/libc/shared/math/bf16mulf128.h
new file mode 100644
index 0000000000000..41baf47dcd78d
--- /dev/null
+++ b/libc/shared/math/bf16mulf128.h
@@ -0,0 +1,28 @@
+//===-- Shared bf16mulf128 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_BF16MULF128_H
+#define LLVM_LIBC_SHARED_MATH_BF16MULF128_H
+
+#include "include/llvm-libc-types/float128.h"
+
+#ifdef LIBC_TYPES_HAS_FLOAT128
+
+#include "src/__support/math/bf16mulf128.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::bf16mulf128;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC_TYPES_HAS_FLOAT128
+
+#endif // LLVM_LIBC_SHARED_MATH_BF16MULF128_H
diff --git a/libc/shared/math/bf16mull.h b/libc/shared/math/bf16mull.h
new file mode 100644
index 0000000000000..fdea2182279b7
--- /dev/null
+++ b/libc/shared/math/bf16mull.h
@@ -0,0 +1,22 @@
+//===-- Shared bf16mull 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_BF16MULL_H
+#define LLVM_LIBC_SHARED_MATH_BF16MULL_H
+
+#include "src/__support/math/bf16mull.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::bf16mull;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_BF16MULL_H
diff --git a/libc/src/__support/math/CMakeLists.txt b/libc/src/__support/math/CMakeLists.txt
index af2c66597b75a..801a0365eff22 100644
--- a/libc/src/__support/math/CMakeLists.txt
+++ b/libc/src/__support/math/CMakeLists.txt
@@ -381,6 +381,43 @@ add_header_library(
     libc.src.__support.FPUtil.fma
     libc.src.__support.macros.config
 )
+add_header_library(
+  bf16mul
+  HDRS
+    bf16mul.h
+  DEPENDS
+    libc.src.__support.FPUtil.bfloat16
+    libc.src.__support.FPUtil.generic.mul
+    libc.src.__support.macros.config
+)
+add_header_library(
+  bf16mulf
+  HDRS
+    bf16mulf.h
+  DEPENDS
+    libc.src.__support.FPUtil.bfloat16
+    libc.src.__support.FPUtil.generic.mul
+    libc.src.__support.macros.config
+)
+add_header_library(
+  bf16mulf128
+  HDRS
+    bf16mulf128.h
+  DEPENDS
+    libc.include.llvm-libc-types.float128
+    libc.src.__support.FPUtil.bfloat16
+    libc.src.__support.FPUtil.generic.mul
+    libc.src.__support.macros.config
+)
+add_header_library(
+  bf16mull
+  HDRS
+    bf16mull.h
+  DEPENDS
+    libc.src.__support.FPUtil.bfloat16
+    libc.src.__support.FPUtil.generic.mul
+    libc.src.__support.macros.config
+)
 
 add_header_library(
   canonicalize
diff --git a/libc/src/__support/math/bf16mul.h b/libc/src/__support/math/bf16mul.h
new file mode 100644
index 0000000000000..af55c519ef9cf
--- /dev/null
+++ b/libc/src/__support/math/bf16mul.h
@@ -0,0 +1,27 @@
+//===-- Implementation header for bf16mul -----------------------*- 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_BF16MUL_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_BF16MUL_H
+
+#include "src/__support/FPUtil/bfloat16.h"
+#include "src/__support/FPUtil/generic/mul.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace math {
+
+LIBC_INLINE constexpr bfloat16 bf16mul(double x, double y) {
+  return fputil::generic::mul<bfloat16>(x, y);
+}
+
+} // namespace math
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SRC___SUPPORT_MATH_BF16MUL_H
diff --git a/libc/src/__support/math/bf16mulf.h b/libc/src/__support/math/bf16mulf.h
new file mode 100644
index 0000000000000..24eae3d43f419
--- /dev/null
+++ b/libc/src/__support/math/bf16mulf.h
@@ -0,0 +1,27 @@
+//===-- Implementation header for bf16mulf ----------------------*- 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_BF16MULF_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_BF16MULF_H
+
+#include "src/__support/FPUtil/bfloat16.h"
+#include "src/__support/FPUtil/generic/mul.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace math {
+
+LIBC_INLINE constexpr bfloat16 bf16mulf(float x, float y) {
+  return fputil::generic::mul<bfloat16>(x, y);
+}
+
+} // namespace math
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SRC___SUPPORT_MATH_BF16MULF_H
diff --git a/libc/src/__support/math/bf16mulf128.h b/libc/src/__support/math/bf16mulf128.h
new file mode 100644
index 0000000000000..d9f50044047bd
--- /dev/null
+++ b/libc/src/__support/math/bf16mulf128.h
@@ -0,0 +1,33 @@
+//===-- Implementation header for bf16mulf128 -------------------*- 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_BF16MULF128_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_BF16MULF128_H
+
+#include "include/llvm-libc-types/float128.h"
+
+#ifdef LIBC_TYPES_HAS_FLOAT128
+
+#include "src/__support/FPUtil/bfloat16.h"
+#include "src/__support/FPUtil/generic/mul.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace math {
+
+LIBC_INLINE constexpr bfloat16 bf16mulf128(float128 x, float128 y) {
+  return fputil::generic::mul<bfloat16>(x, y);
+}
+
+} // namespace math
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC_TYPES_HAS_FLOAT128
+
+#endif // LLVM_LIBC_SRC___SUPPORT_MATH_BF16MULF128_H
diff --git a/libc/src/__support/math/bf16mull.h b/libc/src/__support/math/bf16mull.h
new file mode 100644
index 0000000000000..d54a2e9bdc272
--- /dev/null
+++ b/libc/src/__support/math/bf16mull.h
@@ -0,0 +1,27 @@
+//===-- Implementation header for bf16mull ----------------------*- 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_BF16MULL_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_BF16MULL_H
+
+#include "src/__support/FPUtil/bfloat16.h"
+#include "src/__support/FPUtil/generic/mul.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace math {
+
+LIBC_INLINE constexpr bfloat16 bf16mull(long double x, long double y) {
+  return fputil::generic::mul<bfloat16>(x, y);
+}
+
+} // namespace math
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SRC___SUPPORT_MATH_BF16MULL_H
diff --git a/libc/src/math/generic/CMakeLists.txt b/libc/src/math/generic/CMakeLists.txt
index 47101706ce4c8..bb9b76f7a998c 100644
--- a/libc/src/math/generic/CMakeLists.txt
+++ b/libc/src/math/generic/CMakeLists.txt
@@ -5269,11 +5269,7 @@ add_entrypoint_object(
   HDRS
     ../bf16mul.h
   DEPENDS
-    libc.src.__support.common
-    libc.src.__support.FPUtil.bfloat16
-    libc.src.__support.FPUtil.generic.mul
-    libc.src.__support.macros.config
-    libc.src.__support.macros.properties.types
+    libc.src.__support.math.bf16mul
 )
 
 add_entrypoint_object(
@@ -5283,11 +5279,7 @@ add_entrypoint_object(
   HDRS
     ../bf16mulf.h
   DEPENDS
-    libc.src.__support.common
-    libc.src.__support.FPUtil.bfloat16
-    libc.src.__support.FPUtil.generic.mul
-    libc.src.__support.macros.config
-    libc.src.__support.macros.properties.types
+    libc.src.__support.math.bf16mulf
 )
 
 add_entrypoint_object(
@@ -5297,11 +5289,7 @@ add_entrypoint_object(
   HDRS
     ../bf16mull.h
   DEPENDS
-    libc.src.__support.common
-    libc.src.__support.FPUtil.bfloat16
-    libc.src.__support.FPUtil.generic.mul
-    libc.src.__support.macros.config
-    libc.src.__support.macros.properties.types
+    libc.src.__support.math.bf16mull
 )
 
 add_entrypoint_object(
@@ -5311,11 +5299,7 @@ add_entrypoint_object(
   HDRS
     ../bf16mulf128.h
   DEPENDS
-    libc.src.__support.common
-    libc.src.__support.FPUtil.bfloat16
-    libc.src.__support.FPUtil.generic.mul
-    libc.src.__support.macros.config
-    libc.src.__support.macros.properties.types
+    libc.src.__support.math.bf16mulf128
 )
 
 add_entrypoint_object(
diff --git a/libc/src/math/generic/bf16mul.cpp b/libc/src/math/generic/bf16mul.cpp
index c50eec2b52e5c..e6b5d81004d97 100644
--- a/libc/src/math/generic/bf16mul.cpp
+++ b/libc/src/math/generic/bf16mul.cpp
@@ -7,15 +7,12 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/math/bf16mul.h"
-#include "src/__support/FPUtil/bfloat16.h"
-#include "src/__support/FPUtil/generic/mul.h"
-#include "src/__support/common.h"
-#include "src/__support/macros/config.h"
+#include "src/__support/math/bf16mul.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
 LLVM_LIBC_FUNCTION(bfloat16, bf16mul, (double x, double y)) {
-  return fputil::generic::mul<bfloat16>(x, y);
+  return math::bf16mul(x, y);
 }
 
 } // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/math/generic/bf16mulf.cpp b/libc/src/math/generic/bf16mulf.cpp
index 117fcd1d661ab..a16086decb7ca 100644
--- a/libc/src/math/generic/bf16mulf.cpp
+++ b/libc/src/math/generic/bf16mulf.cpp
@@ -7,15 +7,12 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/math/bf16mulf.h"
-#include "src/__support/FPUtil/bfloat16.h"
-#include "src/__support/FPUtil/generic/mul.h"
-#include "src/__support/common.h"
-#include "src/__support/macros/config.h"
+#include "src/__support/math/bf16mulf.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
 LLVM_LIBC_FUNCTION(bfloat16, bf16mulf, (float x, float y)) {
-  return fputil::generic::mul<bfloat16>(x, y);
+  return math::bf16mulf(x, y);
 }
 
 } // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/math/generic/bf16mulf128.cpp b/libc/src/math/generic/bf16mulf128.cpp
index ff2a081d82e6b..685568c15d161 100644
--- a/libc/src/math/generic/bf16mulf128.cpp
+++ b/libc/src/math/generic/bf16mulf128.cpp
@@ -7,15 +7,12 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/math/bf16mulf128.h"
-#include "src/__support/FPUtil/bfloat16.h"
-#include "src/__support/FPUtil/generic/mul.h"
-#include "src/__support/common.h"
-#include "src/__support/macros/config.h"
+#include "src/__support/math/bf16mulf128.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
 LLVM_LIBC_FUNCTION(bfloat16, bf16mulf128, (float128 x, float128 y)) {
-  return fputil::generic::mul<bfloat16>(x, y);
+  return math::bf16mulf128(x, y);
 }
 
 } // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/math/generic/bf16mull.cpp b/libc/src/math/generic/bf16mull.cpp
index e7c4fc085a3cd..11a7ef833e6fb 100644
--- a/libc/src/math/generic/bf16mull.cpp
+++ b/libc/src/math/generic/bf16mull.cpp
@@ -7,15 +7,12 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/math/bf16mull.h"
-#include "src/__support/FPUtil/bfloat16.h"
-#include "src/__support/FPUtil/generic/mul.h"
-#include "src/__support/common.h"
-#include "src/__support/macros/config.h"
+#include "src/__support/math/bf16mull.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
 LLVM_LIBC_FUNCTION(bfloat16, bf16mull, (long double x, long double y)) {
-  return fputil::generic::mul<bfloat16>(x, y);
+  return math::bf16mull(x, y);
 }
 
 } // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/test/shared/CMakeLists.txt b/libc/test/shared/CMakeLists.txt
index dfe2378269921..99226f6b9f473 100644
--- a/libc/test/shared/CMakeLists.txt
+++ b/libc/test/shared/CMakeLists.txt
@@ -31,6 +31,10 @@ add_fp_unittest(
     libc.src.__support.math.bf16addf128
     libc.src.__support.math.bf16divf
     libc.src.__support.math.bf16fmaf
+    libc.src.__support.math.bf16mul
+    libc.src.__support.math.bf16mulf
+    libc.src.__support.math.bf16mulf128
+    libc.src.__support.math.bf16mull
     libc.src.__support.math.canonicalize
     libc.src.__support.math.canonicalizebf16
     libc.src.__support.math.canonicalizef
diff --git a/libc/test/shared/shared_math_test.cpp b/libc/test/shared/shared_math_test.cpp
index 8eba836538c41..45e24debea52a 100644
--- a/libc/test/shared/shared_math_test.cpp
+++ b/libc/test/shared/shared_math_test.cpp
@@ -142,6 +142,8 @@ TEST(LlvmLibcSharedMathTest, AllFloat) {
   EXPECT_EQ(0, LIBC_NAMESPACE::shared::canonicalizef(&canonicalizef_cx,
                                                      &canonicalizef_x));
   EXPECT_FP_EQ(0x0p+0f, canonicalizef_cx);
+
+  EXPECT_FP_EQ(0x0p+0f, LIBC_NAMESPACE::shared::bf16mulf(0.0f, 0.0f));
 }
 
 TEST(LlvmLibcSharedMathTest, AllDouble) {
@@ -194,6 +196,10 @@ TEST(LlvmLibcSharedMathTest, AllLongDouble) {
   EXPECT_EQ(0, LIBC_NAMESPACE::shared::canonicalizel(&canonicalizel_cx,
                                                      &canonicalizel_x));
   EXPECT_FP_EQ(0x0p+0L, canonicalizel_cx);
+
+  EXPECT_FP_EQ(0x0p+0L, LIBC_NAMESPACE::shared::bf16mul(0.0L, 0.0L));
+
+  EXPECT_FP_EQ(0x0p+0L, LIBC_NAMESPACE::shared::bf16mull(0.0L, 0.0L));
 }
 
 #ifdef LIBC_TYPES_HAS_FLOAT128
@@ -229,6 +235,9 @@ TEST(LlvmLibcSharedMathTest, AllFloat128) {
   EXPECT_EQ(0, LIBC_NAMESPACE::shared::canonicalizef128(&canonicalizef128_cx,
                                                         &canonicalizef128_x));
   EXPECT_FP_EQ(float128(0.0), canonicalizef128_cx);
+
+  EXPECT_FP_EQ(bfloat16(0.0), LIBC_NAMESPACE::shared::bf16mulf128(
+                                  float128(0.0), float128(0.0)));
 }
 
 #endif // LIBC_TYPES_HAS_FLOAT128
diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
index a5b6823b9ca3d..136ef4a58975e 100644
--- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
@@ -2685,6 +2685,47 @@ libc_support_library(
     ],
 )
 
+libc_support_library(
+    name = "__support_math_bf16mul",
+    hdrs = ["src/__support/math/bf16mul.h"],
+    deps = [
+        ":__support_fputil_basic_operations",
+        ":__support_fputil_bfloat16",
+        ":__support_macros_config",
+    ],
+)
+
+libc_support_library(
+    name = "__support_math_bf16mulf",
+    hdrs = ["src/__support/math/bf16mulf.h"],
+    deps = [
+        ":__support_fputil_basic_operations",
+        ":__support_fputil_bfloat16",
+        ":__support_macros_config",
+    ],
+)
+
+libc_support_library(
+    name = "__support_math_bf16mulf128",
+    hdrs = ["src/__support/math/bf16mulf128.h"],
+    deps = [
+        ":__support_fputil_basic_operations",
+        ":__support_fputil_bfloat16",
+        ":__support_macros_config",
+        ":llvm_libc_types_float128",
+    ],
+)
+
+libc_support_library(
+    name = "__support_math_bf16mull",
+    hdrs = ["src/__support/math/bf16mull.h"],
+    deps = [
+        ":__support_fputil_basic_operations",
+        ":__support_fputil_bfloat16",
+        ":__support_macros_config",
+    ],
+)
+
 libc_support_library(
     name = "__support_math_canonicalize",
     hdrs = ["src/__support/math/canonicalize.h"],



More information about the libc-commits mailing list