Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 8 additions & 0 deletions utils/bazel/llvm-project-overlay/libc/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 2 additions & 0 deletions utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are those used? I'm somewhat surprised hypotf16 is the first use we discover (i.e. the first Bazel target where we need it).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I should move this flag to libc_test definition. It is also presented in our cmake test compile options. I wonder how can we build our current complex tests? When I tried with bazel test @llvm-project//libc/..., complex tests are failed to build due to -fi complex literals.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe because some of the bots don't have MPC installed and/or using the compiler for which the special flag is not needed? In one of the downstream deployments we have libc/test/src/complex tests running successfully.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, this option is present in libc/cmake/modules/LLVMLibCCompileOptionRules.cmake (but only for GNU compiler), so maybe we just don't need a special flag when we build with Clang?

]

def libc_release_copts():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,13 @@ math_mpfr_test(
],
)

math_mpfr_test(
name = "hypotf16",
hdrs = [
"HypotTest.h",
],
)

math_mpfr_test(
name = "llrint",
hdrs = ["RoundToIntegerTest.h"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,11 @@ math_test(
hdrs = ["HypotTest.h"],
)

math_test(
name = "hypotf16",
hdrs = ["HypotTest.h"],
)

math_test(
name = "ilogb",
hdrs = ["ILogbTest.h"],
Expand Down
Loading