Skip to content

[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 1 commit into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions utils/bazel/llvm-project-overlay/libc/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -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 = [
Expand Down
164 changes: 164 additions & 0 deletions utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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"],
Expand All @@ -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(
Expand All @@ -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"],
Expand Down Expand Up @@ -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"],
Expand Down Expand Up @@ -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"],
Expand All @@ -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")
Expand Down Expand Up @@ -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"],
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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"],
Expand All @@ -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"],
Expand All @@ -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(
Expand Down Expand Up @@ -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(
Expand All @@ -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")
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down