[libc-commits] [libc] [llvm] [libc] Make sqrtf128 use emulated float128 (PR #216500)

via libc-commits libc-commits at lists.llvm.org
Tue Aug 18 23:38:20 PDT 2026


================
@@ -13567,6 +13567,8 @@ libc_math_function(
 libc_math_function(
     name = "sqrtf128",
     additional_deps = [
+        ":__support_cpp_bit",
+        ":__support_fputil_float128",
----------------
Sukumarsawant wrote:

exact error 
```CPP
INFO: Analyzed target @@+_repo_rules+llvm-project//libc:sqrtf128 (1 packages loaded, 279 targets configured).
ERROR: /home/sawan/.cache/bazel/_bazel_sawan/c10ac7b8754ee03c87df940808fa6d8a/external/+_repo_rules+llvm-project/libc/BUILD.bazel:13567:19: Compiling libc/src/math/sqrtf128.h failed: (Exit 1): cc_wrapper.sh failed: error executing CppCompile command (from target @@+_repo_rules+llvm-project//libc:sqrtf128) external/rules_cc++cc_configure_extension+local_config_cc/cc_wrapper.sh -xc++-header -fsyntax-only -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter ... (remaining 59 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
external/+_repo_rules+llvm-project/libc/src/math/sqrtf128.h:12:10: error: module +_repo_rules+llvm-project//libc:sqrtf128 does not depend on a module exporting 'src/__support/FPUtil/float128.h'
   12 | #include "src/__support/FPUtil/float128.h"
      |          ^
In file included from external/+_repo_rules+llvm-project/libc/src/math/sqrtf128.h:12:
In file included from external/+_repo_rules+llvm-project/libc/src/__support/FPUtil/float128.h:15:
external/+_repo_rules+llvm-project/libc/src/__support/FPUtil/cast.h:57:18: warning: shift count is negative [-Wshift-count-negative]
   57 |           x_mant >>= InFPBits::FRACTION_LEN - OutFPBits::FRACTION_LEN;
      |                  ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
external/+_repo_rules+llvm-project/libc/src/__support/FPUtil/float128.h:60:22: note: in instantiation of function template specialization '__llvm_libc_24_0_0_git::fputil::cast<__llvm_libc_24_0_0_git::fputil::Float128, float>' requested here
   60 |       bits = fputil::cast<Float128>(static_cast<float>(value)).bits;
      |                      ^
1 warning and 1 error generated.
ERROR: /home/sawan/.cache/bazel/_bazel_sawan/c10ac7b8754ee03c87df940808fa6d8a/external/+_repo_rules+llvm-project/libc/BUILD.bazel:13567:19: Compiling libc/src/math/generic/sqrtf128.cpp failed: (Exit 1): clang failed: error executing CppCompile command (from target @@+_repo_rules+llvm-project//libc:sqrtf128) /usr/bin/clang -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer '-std=c++17' -MD ... (remaining 57 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from external/+_repo_rules+llvm-project/libc/src/math/generic/sqrtf128.cpp:9:
external/+_repo_rules+llvm-project/libc/src/math/sqrtf128.h:12:10: error: module +_repo_rules+llvm-project//libc:sqrtf128 does not depend on a module exporting 'src/__support/FPUtil/float128.h'
   12 | #include "src/__support/FPUtil/float128.h"
      |          ^
In file included from external/+_repo_rules+llvm-project/libc/src/math/generic/sqrtf128.cpp:9:
In file included from external/+_repo_rules+llvm-project/libc/src/math/sqrtf128.h:12:
In file included from external/+_repo_rules+llvm-project/libc/src/__support/FPUtil/float128.h:15:
external/+_repo_rules+llvm-project/libc/src/__support/FPUtil/cast.h:57:18: warning: shift count is negative [-Wshift-count-negative]
   57 |           x_mant >>= InFPBits::FRACTION_LEN - OutFPBits::FRACTION_LEN;
      |                  ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
external/+_repo_rules+llvm-project/libc/src/__support/FPUtil/float128.h:60:22: note: in instantiation of function template specialization '__llvm_libc_24_0_0_git::fputil::cast<__llvm_libc_24_0_0_git::fputil::Float128, float>' requested here
   60 |       bits = fputil::cast<Float128>(static_cast<float>(value)).bits;
      |                      ^
1 warning and 1 error generated.
INFO: Found 1 target...
Target @@+_repo_rules+llvm-project//libc:sqrtf128 failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 6.398s, Critical Path: 2.26s
INFO: 4 processes: 231 action cache hit, 4 internal.
ERROR: Build did NOT complete successfully
```

https://github.com/llvm/llvm-project/pull/216500


More information about the libc-commits mailing list