[libc][bazel] Add targets for fmod* and scalbn*.
authorSiva Chandra Reddy <sivachandra@google.com>
Wed, 24 May 2023 17:42:40 +0000 (17:42 +0000)
committerSiva Chandra Reddy <sivachandra@google.com>
Thu, 25 May 2023 06:29:04 +0000 (06:29 +0000)
Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D151354

utils/bazel/llvm-project-overlay/libc/BUILD.bazel
utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel

index 9701b3a..818df56 100644 (file)
@@ -478,6 +478,21 @@ libc_support_library(
 )
 
 libc_support_library(
+    name = "__support_fputil_generic_fmod",
+    hdrs = ["src/__support/FPUtil/generic/FMod.h"],
+    deps = [
+        ":__support_builtin_wrappers",
+        ":__support_common",
+        ":__support_cpp_limits",
+        ":__support_cpp_type_traits",
+        ":__support_fputil_fp_bits",
+        ":__support_fputil_fenv_impl",
+        ":libc_root",
+        ":math_utils",
+    ],
+)
+
+libc_support_library(
     name = "__support_fputil_division_and_remainder_operations",
     hdrs = ["src/__support/FPUtil/DivisionAndRemainderOperations.h"],
     deps = [
@@ -1427,6 +1442,20 @@ libc_math_function(
 
 libc_math_function(name = "roundl")
 
+libc_math_function(
+    name = "fmod",
+    additional_deps = [
+        ":__support_fputil_generic_fmod",
+    ],
+)
+
+libc_math_function(
+    name = "fmodf",
+    additional_deps = [
+        ":__support_fputil_generic_fmod",
+    ],
+)
+
 libc_math_function(name = "frexp")
 
 libc_math_function(name = "frexpf")
@@ -1602,6 +1631,12 @@ libc_math_function(name = "nextafterf")
 
 libc_math_function(name = "nextafterl")
 
+libc_math_function(name = "scalbn")
+
+libc_math_function(name = "scalbnf")
+
+libc_math_function(name = "scalbnl")
+
 ############################### stdlib targets ###############################
 
 libc_function(
index f8a4ed8..d634785 100644 (file)
@@ -733,3 +733,37 @@ math_test(
         "//libc/utils/MPFRWrapper:mpfr_wrapper",
     ],
 )
+
+math_test(
+    name = "fmod",
+    hdrs = ["FModTest.h"]
+)
+
+math_test(
+    name = "fmodf",
+    hdrs = ["FModTest.h"]
+)
+
+math_test(
+    name = "scalbn",
+    hdrs = [
+        "LdExpTest.h",
+        "ScalbnTest.h"
+    ],
+)
+
+math_test(
+    name = "scalbnf",
+    hdrs = [
+        "LdExpTest.h",
+        "ScalbnTest.h"
+    ],
+)
+
+math_test(
+    name = "scalbnl",
+    hdrs = [
+        "LdExpTest.h",
+        "ScalbnTest.h"
+    ],
+)