Skip to content

Commit b6e440b

Browse files
authored
[libc][bazel] Add BUILD rules for fma and fmaf functions. (llvm#159502)
This change adds the capability to build fma/fmaf with Bazel (fmal, fmaf128 variants are not implemented yet), and run smoke tests. BUILD rules for regular MPFR-based tests will be added later, since they require support for building rand/srand as well, which is missing in Bazel for now.
1 parent 8548fa0 commit b6e440b

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

utils/bazel/llvm-project-overlay/libc/BUILD.bazel

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3834,7 +3834,19 @@ libc_math_function(name = "floorf128")
38343834

38353835
libc_math_function(name = "floorf16")
38363836

3837-
# TODO: Add fma, fmaf, fmal, fmaf128 functions.
3837+
libc_math_function(
3838+
name = "fma",
3839+
additional_deps = [
3840+
":__support_fputil_fma",
3841+
],
3842+
)
3843+
3844+
libc_math_function(
3845+
name = "fmaf",
3846+
additional_deps = [
3847+
":__support_fputil_fma",
3848+
],
3849+
)
38383850

38393851
libc_math_function(
38403852
name = "fmaf16",

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,15 @@ math_test(
475475
hdrs = ["FloorTest.h"],
476476
)
477477

478-
# TODO: Add fma, fmaf, fmal, fmaf128 tests.
478+
math_test(
479+
name = "fma",
480+
hdrs = ["FmaTest.h"],
481+
)
482+
483+
math_test(
484+
name = "fmaf",
485+
hdrs = ["FmaTest.h"],
486+
)
479487

480488
# TODO: Reenable this test once it passes at Google.
481489
# math_test(

0 commit comments

Comments
 (0)