[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:24:50 PDT 2024


llvm-ci wrote:

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

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

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)
...
-- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile
-- Performing Test HAVE_POSIX_REGEX -- success
-- Performing Test HAVE_STEADY_CLOCK -- success
-- Performing Test HAVE_PTHREAD_AFFINITY -- failed to compile
-- Configuring done
-- Generating done
-- Build files have been written to: /home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu/build
@@@BUILD_STEP build libc@@@
Running: ninja libc
[1/2] 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_18_0_0_git -D_DEBUG -Iprojects/libc/src/math/generic -I/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu/llvm-project/libc/src/math/generic -I/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu/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 -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/llvm-project/libc/src/math/generic/cbrt.cpp
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu/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/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/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/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/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/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.
ninja: build stopped: subcommand failed.
['ninja', 'libc'] exited with return code 1.
The build step threw an exception...
Traceback (most recent call last):
  File "../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 164, in step
    yield
  File "../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 121, in main
    run_command(['ninja', 'libc'])
  File "../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 179, in run_command
    util.report_run_cmd(cmd, cwd=directory)
  File "/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu/llvm-zorg/zorg/buildbot/builders/annotated/util.py", line 49, in report_run_cmd
    subprocess.check_call(cmd, shell=shell, *args, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
CalledProcessError: Command '['ninja', 'libc']' returned non-zero exit status 1
@@@STEP_FAILURE@@@
@@@BUILD_STEP libc-unit-tests@@@
Running: ninja libc-unit-tests

```

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


More information about the libc-commits mailing list