[llvm] [libc][bazel] Add hypotf16 bazel targets. (PR #149761)

via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 20 21:00:23 PDT 2025


https://github.com/lntue created https://github.com/llvm/llvm-project/pull/149761

None

>From 647337f97039cac35594ea1502e007d8406a2c99 Mon Sep 17 00:00:00 2001
From: Tue Ly <lntue.h at gmail.com>
Date: Mon, 21 Jul 2025 03:53:50 +0000
Subject: [PATCH] [libc][bazel] Add hypotf16 bazel targets.

---
 utils/bazel/llvm-project-overlay/libc/BUILD.bazel         | 8 ++++++++
 .../bazel/llvm-project-overlay/libc/libc_build_rules.bzl  | 2 ++
 .../llvm-project-overlay/libc/test/src/math/BUILD.bazel   | 7 +++++++
 .../libc/test/src/math/smoke/BUILD.bazel                  | 5 +++++
 4 files changed, 22 insertions(+)

diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
index 337423cfb96cb..56a3474692720 100644
--- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
@@ -3471,6 +3471,14 @@ libc_math_function(
     ],
 )
 
+libc_math_function(
+    name = "hypotf16",
+    additional_deps = [
+        ":__support_fputil_multiply_add",
+        ":__support_fputil_sqrt",
+    ],
+)
+
 libc_math_function(name = "ilogb")
 
 libc_math_function(name = "ilogbf")
diff --git a/utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl b/utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl
index e123e4d32b785..45bf723bc5c91 100644
--- a/utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl
+++ b/utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl
@@ -17,6 +17,8 @@ def libc_common_copts():
         "-I" + libc_include_path,
         "-I" + paths.join(libc_include_path, "include"),
         "-DLIBC_NAMESPACE=" + LIBC_NAMESPACE,
+        # For complex floating point literals.
+        "-fext-numeric-literals",
     ]
 
 def libc_release_copts():
diff --git a/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel
index d20922df1b8b5..7f119e3e9b637 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel
@@ -286,6 +286,13 @@ math_mpfr_test(
     ],
 )
 
+math_mpfr_test(
+    name = "hypotf16",
+    hdrs = [
+        "HypotTest.h",
+    ],
+)
+
 math_mpfr_test(
     name = "llrint",
     hdrs = ["RoundToIntegerTest.h"],
diff --git a/utils/bazel/llvm-project-overlay/libc/test/src/math/smoke/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/src/math/smoke/BUILD.bazel
index 4df1c4508d764..6d9d1d6a33255 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/src/math/smoke/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/test/src/math/smoke/BUILD.bazel
@@ -898,6 +898,11 @@ math_test(
     hdrs = ["HypotTest.h"],
 )
 
+math_test(
+    name = "hypotf16",
+    hdrs = ["HypotTest.h"],
+)
+
 math_test(
     name = "ilogb",
     hdrs = ["ILogbTest.h"],



More information about the llvm-commits mailing list