[libc-commits] [libc] [libc][math] Implement double precision cbrt correctly rounded to all rounding modes. (PR #99262)

LLVM Continuous Integration via libc-commits libc-commits at lists.llvm.org
Wed Jul 17 09:25:18 PDT 2024


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `libc-aarch64-ubuntu-fullbuild-dbg` running on `libc-aarch64-ubuntu` while building `libc` at step 4 "annotate".

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

Here is the relevant piece of the build log for the reference:
```
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
[147/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.nextafterf16.dir/nextafterf16.cpp.o
[148/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.nextafterl.__internal__.dir/nextafterl.cpp.o
[149/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.nextafterf.__internal__.dir/nextafterf.cpp.o
[150/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.nextafterf.dir/nextafterf.cpp.o
[151/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.nextafter.dir/nextafter.cpp.o
[152/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.nexttoward.__internal__.dir/nexttoward.cpp.o
[153/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.fmodl.__internal__.dir/fmodl.cpp.o
[154/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.nextafter.__internal__.dir/nextafter.cpp.o
[155/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.fromfpxf128.__internal__.dir/fromfpxf128.cpp.o
[156/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.cbrt.dir/cbrt.cpp.o
FAILED: projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.cbrt.dir/cbrt.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_19_0_0_git -D_DEBUG -Iprojects/libc/src/math/generic -I/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/math/generic -I/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc -isystem projects/libc/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -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 -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -fpie -ffreestanding -DLIBC_FULL_BUILD -nostdlibinc -idirafter/usr/include -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 -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -O3 -DLIBC_COPT_PUBLIC_PACKAGING -std=c++17 -MD -MT projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.cbrt.dir/cbrt.cpp.o -MF projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.cbrt.dir/cbrt.cpp.o.d -o projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.cbrt.dir/cbrt.cpp.o -c /home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/math/generic/cbrt.cpp
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/math/generic/cbrt.cpp:38:18: error: constexpr function never produces a constant expression [-Winvalid-constexpr]
constexpr double intial_approximation(double x) {
                 ^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/math/generic/cbrt.cpp:47:15: note: non-constexpr function 'multiply_add' cannot be used in a constant expression
  double c0 = fputil::multiply_add(x, COEFFS[1], COEFFS[0]);
              ^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/multiply_add.h:53:20: note: declared here
LIBC_INLINE double multiply_add(double x, double y, double z) {
                   ^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/math/generic/cbrt.cpp:62:18: error: constexpr function never produces a constant expression [-Winvalid-constexpr]
constexpr double get_error(const DoubleDouble &x_3, const DoubleDouble &a_sq) {
                 ^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/math/generic/cbrt.cpp:63:10: note: non-constexpr function 'multiply_add' cannot be used in a constant expression
  return fputil::multiply_add(x_3.hi, a_sq.hi, -1.0) +
         ^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/multiply_add.h:53:20: note: declared here
LIBC_INLINE double multiply_add(double x, double y, double z) {
                   ^
2 errors generated.
[157/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.fromfpf128.dir/fromfpf128.cpp.o
[158/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.rint.__NO_ROUND_OPT.__internal__.dir/rint.cpp.o
[159/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.copysignf.__internal__.dir/copysignf.cpp.o
[160/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.fmax.dir/fmax.cpp.o
[161/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.nanf128.dir/nanf128.cpp.o
[162/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.llroundf128.dir/llroundf128.cpp.o
[163/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.fdim.__internal__.dir/fdim.cpp.o
[164/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.nanf16.dir/nanf16.cpp.o
[165/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.nextafterl.dir/nextafterl.cpp.o
[166/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.fdimf128.__internal__.dir/fdimf128.cpp.o
[167/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.nan.dir/nan.cpp.o
[168/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.hypot.dir/hypot.cpp.o
[169/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.hypot.__internal__.dir/hypot.cpp.o
[170/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.cospif.__internal__.dir/cospif.cpp.o
[171/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.hypotf.__internal__.dir/hypotf.cpp.o
[172/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.acosf.__internal__.dir/acosf.cpp.o
[173/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.f16div.__internal__.dir/f16div.cpp.o
ninja: build stopped: subcommand failed.
Step 8 (libc-unit-tests) failure: libc-unit-tests (failure)
...
[147/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.nextafterf16.dir/nextafterf16.cpp.o
[148/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.nextafterl.__internal__.dir/nextafterl.cpp.o
[149/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.nextafterf.__internal__.dir/nextafterf.cpp.o
[150/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.nextafterf.dir/nextafterf.cpp.o
[151/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.nextafter.dir/nextafter.cpp.o
[152/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.nexttoward.__internal__.dir/nexttoward.cpp.o
[153/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.fmodl.__internal__.dir/fmodl.cpp.o
[154/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.nextafter.__internal__.dir/nextafter.cpp.o
[155/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.fromfpxf128.__internal__.dir/fromfpxf128.cpp.o
[156/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.cbrt.dir/cbrt.cpp.o
FAILED: projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.cbrt.dir/cbrt.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_19_0_0_git -D_DEBUG -Iprojects/libc/src/math/generic -I/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/math/generic -I/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc -isystem projects/libc/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -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 -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -fpie -ffreestanding -DLIBC_FULL_BUILD -nostdlibinc -idirafter/usr/include -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 -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -O3 -DLIBC_COPT_PUBLIC_PACKAGING -std=c++17 -MD -MT projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.cbrt.dir/cbrt.cpp.o -MF projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.cbrt.dir/cbrt.cpp.o.d -o projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.cbrt.dir/cbrt.cpp.o -c /home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/math/generic/cbrt.cpp
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/math/generic/cbrt.cpp:38:18: error: constexpr function never produces a constant expression [-Winvalid-constexpr]
constexpr double intial_approximation(double x) {
                 ^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/math/generic/cbrt.cpp:47:15: note: non-constexpr function 'multiply_add' cannot be used in a constant expression
  double c0 = fputil::multiply_add(x, COEFFS[1], COEFFS[0]);
              ^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/multiply_add.h:53:20: note: declared here
LIBC_INLINE double multiply_add(double x, double y, double z) {
                   ^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/math/generic/cbrt.cpp:62:18: error: constexpr function never produces a constant expression [-Winvalid-constexpr]
constexpr double get_error(const DoubleDouble &x_3, const DoubleDouble &a_sq) {
                 ^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/math/generic/cbrt.cpp:63:10: note: non-constexpr function 'multiply_add' cannot be used in a constant expression
  return fputil::multiply_add(x_3.hi, a_sq.hi, -1.0) +
         ^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/multiply_add.h:53:20: note: declared here
LIBC_INLINE double multiply_add(double x, double y, double z) {
                   ^
2 errors generated.
[157/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.fromfpf128.dir/fromfpf128.cpp.o
[158/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.rint.__NO_ROUND_OPT.__internal__.dir/rint.cpp.o
[159/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.copysignf.__internal__.dir/copysignf.cpp.o
[160/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.fmax.dir/fmax.cpp.o
[161/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.nanf128.dir/nanf128.cpp.o
[162/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.llroundf128.dir/llroundf128.cpp.o
[163/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.fdim.__internal__.dir/fdim.cpp.o
[164/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.nanf16.dir/nanf16.cpp.o
[165/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.nextafterl.dir/nextafterl.cpp.o
[166/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.fdimf128.__internal__.dir/fdimf128.cpp.o
[167/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.nan.dir/nan.cpp.o
[168/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.hypot.dir/hypot.cpp.o
[169/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.hypot.__internal__.dir/hypot.cpp.o
[170/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.cospif.__internal__.dir/cospif.cpp.o
[171/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.hypotf.__internal__.dir/hypotf.cpp.o
[172/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.acosf.__internal__.dir/acosf.cpp.o
[173/3105] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.f16div.__internal__.dir/f16div.cpp.o
ninja: build stopped: subcommand failed.

```

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


More information about the libc-commits mailing list