-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libc][bazel] Main f16 test targets, new f16 funcs #130208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This patch adds acosf16 and asinf16 which I missed last patch, and also the primary math tests for the float16 functions.
@llvm/pr-subscribers-libc Author: Michael Jones (michaelrj-google) ChangesThis patch adds acosf16 and asinf16 which I missed last patch, and also Full diff: https://github.com/llvm/llvm-project/pull/130208.diff 3 Files Affected:
diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
index 5339b30154ed1..4b0fec6473b67 100644
--- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
@@ -2198,6 +2198,20 @@ libc_math_function(
],
)
+libc_math_function(
+ name = "acosf16",
+ additional_deps = [
+ ":__support_fputil_cast",
+ ":__support_fputil_fma",
+ ":__support_fputil_multiply_add",
+ ":__support_fputil_nearest_integer",
+ ":__support_fputil_polyeval",
+ ":__support_fputil_sqrt",
+ ":__support_macros_optimization",
+ ":inv_trigf_utils",
+ ],
+)
+
libc_math_function(
name = "acoshf",
additional_deps = [
@@ -2226,6 +2240,20 @@ libc_math_function(
],
)
+libc_math_function(
+ name = "asinf16",
+ additional_deps = [
+ ":__support_fputil_cast",
+ ":__support_fputil_fma",
+ ":__support_fputil_multiply_add",
+ ":__support_fputil_nearest_integer",
+ ":__support_fputil_polyeval",
+ ":__support_fputil_sqrt",
+ ":__support_macros_optimization",
+ ":inv_trigf_utils",
+ ],
+)
+
libc_math_function(
name = "asinhf",
additional_deps = [
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 764c845435611..2154e71018226 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
@@ -47,6 +47,11 @@ math_mpfr_test(
hdrs = ["CeilTest.h"],
)
+math_mpfr_test(
+ name = "ceilf16",
+ hdrs = ["CeilTest.h"],
+)
+
math_mpfr_test(name = "cos")
math_mpfr_test(
@@ -144,6 +149,21 @@ math_mpfr_test(
hdrs = ["AddTest.h"],
)
+math_mpfr_test(
+ name = "f16add",
+ hdrs = ["AddTest.h"],
+)
+
+math_mpfr_test(
+ name = "f16addf",
+ hdrs = ["AddTest.h"],
+)
+
+math_mpfr_test(
+ name = "f16addl",
+ hdrs = ["AddTest.h"],
+)
+
math_mpfr_test(
name = "fdiv",
hdrs = ["DivTest.h"],
@@ -154,6 +174,21 @@ math_mpfr_test(
hdrs = ["DivTest.h"],
)
+math_mpfr_test(
+ name = "f16div",
+ hdrs = ["DivTest.h"],
+)
+
+math_mpfr_test(
+ name = "f16divf",
+ hdrs = ["DivTest.h"],
+)
+
+math_mpfr_test(
+ name = "f16divl",
+ hdrs = ["DivTest.h"],
+)
+
# TODO: Add ffma, ffmal test. Missing stdlib/rand dependency.
math_mpfr_test(
@@ -171,8 +206,21 @@ math_mpfr_test(
hdrs = ["FloorTest.h"],
)
+math_mpfr_test(
+ name = "floorf16",
+ hdrs = ["FloorTest.h"],
+)
+
# TODO: Add fma, fmaf, fmal, fmul, fmull tests. Missing stdlib/rand dependency.
+# math_mpfr_test(name = "f16mul")
+# math_mpfr_test(name = "f16mulf")
+# math_mpfr_test(name = "f16mull")
+
+# math_mpfr_test(name = "f16fma")
+# math_mpfr_test(name = "f16fmaf")
+# math_mpfr_test(name = "f16fmal")
+
math_mpfr_test(
name = "frexp",
hdrs = ["FrexpTest.h"],
@@ -208,6 +256,21 @@ math_mpfr_test(
hdrs = ["SubTest.h"],
)
+math_mpfr_test(
+ name = "f16sub",
+ hdrs = ["SubTest.h"],
+)
+
+math_mpfr_test(
+ name = "f16subf",
+ hdrs = ["SubTest.h"],
+)
+
+math_mpfr_test(
+ name = "f16subl",
+ hdrs = ["SubTest.h"],
+)
+
math_mpfr_test(
name = "hypot",
hdrs = ["HypotTest.h"],
@@ -236,6 +299,11 @@ math_mpfr_test(
hdrs = ["RoundToIntegerTest.h"],
)
+math_mpfr_test(
+ name = "llrintf16",
+ hdrs = ["RoundToIntegerTest.h"],
+)
+
math_mpfr_test(
name = "llround",
hdrs = ["RoundToIntegerTest.h"],
@@ -251,6 +319,16 @@ math_mpfr_test(
hdrs = ["RoundToIntegerTest.h"],
)
+math_mpfr_test(
+ name = "lroundf16",
+ hdrs = ["RoundToIntegerTest.h"],
+)
+
+math_mpfr_test(
+ name = "llroundf16",
+ hdrs = ["RoundToIntegerTest.h"],
+)
+
math_mpfr_test(name = "log")
math_mpfr_test(name = "logf")
@@ -282,6 +360,11 @@ math_mpfr_test(
hdrs = ["RoundToIntegerTest.h"],
)
+math_mpfr_test(
+ name = "lrintf16",
+ hdrs = ["RoundToIntegerTest.h"],
+)
+
math_mpfr_test(
name = "lround",
hdrs = ["RoundToIntegerTest.h"],
@@ -323,6 +406,14 @@ math_mpfr_test(
],
)
+math_mpfr_test(
+ name = "nearbyintf16",
+ hdrs = ["NearbyIntTest.h"],
+ deps = [
+ "//libc:__support_cpp_array",
+ ],
+)
+
math_mpfr_test(name = "pow")
math_mpfr_test(name = "powf")
@@ -357,6 +448,11 @@ math_mpfr_test(
hdrs = ["RIntTest.h"],
)
+math_mpfr_test(
+ name = "rintf16",
+ hdrs = ["RIntTest.h"],
+)
+
math_mpfr_test(
name = "roundeven",
hdrs = ["RoundEvenTest.h"],
@@ -372,6 +468,11 @@ math_mpfr_test(
hdrs = ["RoundEvenTest.h"],
)
+math_mpfr_test(
+ name = "roundevenf16",
+ hdrs = ["RoundEvenTest.h"],
+)
+
math_mpfr_test(
name = "round",
hdrs = ["RoundTest.h"],
@@ -387,6 +488,11 @@ math_mpfr_test(
hdrs = ["RoundTest.h"],
)
+math_mpfr_test(
+ name = "roundf16",
+ hdrs = ["RoundTest.h"],
+)
+
math_mpfr_test(name = "sin")
math_mpfr_test(
@@ -437,6 +543,21 @@ math_mpfr_test(
hdrs = ["SqrtTest.h"],
)
+math_mpfr_test(
+ name = "f16sqrt",
+ hdrs = ["SqrtTest.h"],
+)
+
+math_mpfr_test(
+ name = "f16sqrtf",
+ hdrs = ["SqrtTest.h"],
+)
+
+math_mpfr_test(
+ name = "f16sqrtl",
+ hdrs = ["SqrtTest.h"],
+)
+
math_mpfr_test(name = "tan")
math_mpfr_test(
@@ -463,3 +584,46 @@ math_mpfr_test(
name = "truncl",
hdrs = ["TruncTest.h"],
)
+
+math_mpfr_test(
+ name = "truncf16",
+ hdrs = ["TruncTest.h"],
+)
+
+math_mpfr_test(name = "cosf16")
+
+math_mpfr_test(name = "cospif16")
+
+math_mpfr_test(name = "sinf16")
+
+math_mpfr_test(name = "sinpif16")
+
+math_mpfr_test(name = "tanf16")
+
+math_mpfr_test(name = "tanpif16")
+
+math_mpfr_test(name = "expf16")
+
+math_mpfr_test(name = "exp2f16")
+
+math_mpfr_test(name = "exp2m1f16")
+
+math_mpfr_test(name = "exp10f16")
+
+math_mpfr_test(name = "exp10m1f16")
+
+math_mpfr_test(name = "asinf16")
+
+math_mpfr_test(name = "acosf16")
+
+math_mpfr_test(name = "coshf16")
+
+math_mpfr_test(name = "sinhf16")
+
+math_mpfr_test(name = "tanhf16")
+
+math_mpfr_test(name = "logf16")
+
+math_mpfr_test(name = "log2f16")
+
+math_mpfr_test(name = "log10f16")
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 c56f3c7cf4f34..803548178b0e3 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
@@ -14,8 +14,12 @@ math_test(name = "acosf")
math_test(name = "acoshf")
+math_test(name = "acosf16")
+
math_test(name = "asinf")
+math_test(name = "asinf16")
+
math_test(name = "asinhf")
math_test(name = "atan2")
|
vonosmas
approved these changes
Mar 7, 2025
jph-13
pushed a commit
to jph-13/llvm-project
that referenced
this pull request
Mar 21, 2025
This patch adds acosf16 and asinf16 which I missed last patch, and also the primary math tests for the float16 functions.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch adds acosf16 and asinf16 which I missed last patch, and also
the primary math tests for the float16 functions.