[libc-commits] [libc] [libc][math] Improve the performance of sqrtf128. (PR #122578)

LLVM Continuous Integration via libc-commits libc-commits at lists.llvm.org
Thu Feb 13 16:03:49 PST 2025


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `libc-riscv32-qemu-yocto-fullbuild-dbg` running on `rv32gc-qemu-system` while building `libc` at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/196/builds/4895

<details>
<summary>Here is the relevant piece of the build log for the reference</summary>

```
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
[432/3590] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.log1p.__internal__.dir/log1p.cpp.o
[433/3590] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.fsub.__internal__.dir/fsub.cpp.o
[434/3590] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.fsub.dir/fsub.cpp.o
[435/3590] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.fsubl.__internal__.dir/fsubl.cpp.o
[436/3590] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.fsubf128.__internal__.dir/fsubf128.cpp.o
[437/3590] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.fmul.dir/fmul.cpp.o
[438/3590] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.fmull.dir/fmull.cpp.o
[439/3590] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.fmull.__internal__.dir/fmull.cpp.o
[440/3590] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.fsubl.dir/fsubl.cpp.o
[441/3590] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.sqrtf128.dir/sqrtf128.cpp.o
FAILED: libc/src/math/generic/CMakeFiles/libc.src.math.generic.sqrtf128.dir/sqrtf128.cpp.o 
/usr/local/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc -isystem /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/build/libc/include -mabi=ilp32d -march=rv32imafdc --target=riscv32-unknown-linux-gnu --sysroot=/opt/riscv/sysroot --gcc-toolchain=/opt/riscv -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -g -std=gnu++17 --target=riscv32-unknown-linux-gnu -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_ADD_NULL_CHECKS -fpie -ffreestanding -DLIBC_FULL_BUILD -nostdlibinc -idirafter=/usr/include -ffixed-point -fno-builtin -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wdeprecated -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -DLIBC_COPT_PUBLIC_PACKAGING -MD -MT libc/src/math/generic/CMakeFiles/libc.src.math.generic.sqrtf128.dir/sqrtf128.cpp.o -MF libc/src/math/generic/CMakeFiles/libc.src.math.generic.sqrtf128.dir/sqrtf128.cpp.o.d -o libc/src/math/generic/CMakeFiles/libc.src.math.generic.sqrtf128.dir/sqrtf128.cpp.o -c /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/math/generic/sqrtf128.cpp
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/math/generic/sqrtf128.cpp:386:22: error: use of overloaded operator '^' is ambiguous (with operand types 'BigInt<128, false>' and 'Int128' (aka 'BigInt<128U, true, unsigned long long>'))
  386 |       t1 -= (m << 1) ^ sgn;
      |             ~~~~~~~~ ^ ~~~
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/__support/big_int.h:863:3: note: candidate function
  863 |   DEFINE_BINOP(^) // ^ and ^=
      |   ^
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/__support/big_int.h:847:39: note: expanded from macro 'DEFINE_BINOP'
  847 |   LIBC_INLINE friend constexpr BigInt operator OP(const BigInt &lhs,           \
      |                                       ^
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/__support/big_int.h:863:3: note: candidate function
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/__support/big_int.h:847:39: note: expanded from macro 'DEFINE_BINOP'
  847 |   LIBC_INLINE friend constexpr BigInt operator OP(const BigInt &lhs,           \
      |                                       ^
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/math/generic/sqrtf128.cpp:387:15: error: invalid operands to binary expression ('int' and 'Int128' (aka 'BigInt<128U, true, unsigned long long>'))
  387 |       t1 += 1 + sgn;
      |             ~ ^ ~~~
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/math/generic/sqrtf128.cpp:393:24: error: use of overloaded operator '^' is ambiguous (with operand types 'BigInt<128, false>' and 'Int128' (aka 'BigInt<128U, true, unsigned long long>'))
  393 |         t1 -= (m << 1) ^ sgn;
      |               ~~~~~~~~ ^ ~~~
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/__support/big_int.h:863:3: note: candidate function
  863 |   DEFINE_BINOP(^) // ^ and ^=
      |   ^
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/__support/big_int.h:847:39: note: expanded from macro 'DEFINE_BINOP'
  847 |   LIBC_INLINE friend constexpr BigInt operator OP(const BigInt &lhs,           \
      |                                       ^
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/__support/big_int.h:863:3: note: candidate function
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/__support/big_int.h:847:39: note: expanded from macro 'DEFINE_BINOP'
  847 |   LIBC_INLINE friend constexpr BigInt operator OP(const BigInt &lhs,           \
      |                                       ^
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/math/generic/sqrtf128.cpp:394:17: error: invalid operands to binary expression ('int' and 'Int128' (aka 'BigInt<128U, true, unsigned long long>'))
  394 |         t1 += 1 + sgn;
      |               ~ ^ ~~~
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/math/generic/sqrtf128.cpp:399:21: error: invalid operands to binary expression ('int' and 'Int128' (aka 'BigInt<128U, true, unsigned long long>'))
  399 |         v = (m - (2 * sgn + 1)) << 15;
      |                   ~ ^ ~~~
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/math/generic/sqrtf128.cpp:404:49: error: invalid operands to binary expression ('int' and 'Int128' (aka 'BigInt<128U, true, unsigned long long>'))
  404 |         v -= ((sgn & side) | (~sgn & 1)) << (15 + side);

```

</details>

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


More information about the libc-commits mailing list