[libc-commits] [libc] [llvm] [libc][math] Refactor fmul-fsub-frexp family to header-only (PR #195431)

LLVM Continuous Integration via libc-commits libc-commits at lists.llvm.org
Sat May 2 02:55:22 PDT 2026


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,utils` at step 4 "annotate".

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

<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)
...
[==========] Running 2 tests from 1 test suite.
[ RUN      ] LlvmLibcCImagTest.SpecialNumbers
[       OK ] LlvmLibcCImagTest.SpecialNumbers (9 us)
[ RUN      ] LlvmLibcCImagTest.RoundedNumbers
[       OK ] LlvmLibcCImagTest.RoundedNumbers (3 us)
Ran 2 tests.  PASS: 2  FAIL: 0
[59/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.exp.__internal__.dir/exp.cpp.o
[60/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.cos.dir/cos.cpp.o
[61/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.sincos.__internal__.dir/sincos.cpp.o
[62/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.fmul.dir/fmul.cpp.o
FAILED: libc/src/math/generic/CMakeFiles/libc.src.math.generic.fmul.dir/fmul.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc -isystem libc/include -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 -Wno-comment -Wstring-conversion -Wno-pass-failed -fdiagnostics-color -g -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_COPT_STRING_LENGTH_IMPL=clang_vector -DLIBC_COPT_FIND_FIRST_CHARACTER_IMPL=word -DLIBC_ADD_NULL_CHECKS -DLIBC_ERRNO_MODE=LIBC_ERRNO_MODE_DEFAULT -DLIBC_THREAD_MODE=LIBC_THREAD_MODE_PLATFORM -DLIBC_COPT_TIMEOUT_ENSURE_MONOTONICITY -DLIBC_CONF_WCTYPE_MODE=LIBC_WCTYPE_MODE_ASCII -DLIBC_COPT_RAW_MUTEX_DEFAULT_SPIN_COUNT=100 -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 -fstack-protector-strong -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 -std=gnu++17 -MD -MT libc/src/math/generic/CMakeFiles/libc.src.math.generic.fmul.dir/fmul.cpp.o -MF libc/src/math/generic/CMakeFiles/libc.src.math.generic.fmul.dir/fmul.cpp.o.d -o libc/src/math/generic/CMakeFiles/libc.src.math.generic.fmul.dir/fmul.cpp.o -c /home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/math/generic/fmul.cpp
In file included from /home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/math/generic/fmul.cpp:10:
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/__support/math/fmul.h:21:29: error: constexpr function never produces a constant expression [-Winvalid-constexpr]
LIBC_INLINE constexpr float fmul(double x, double y) {
                            ^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/__support/math/fmul.h:30:31: note: non-constexpr function 'exact_mult<double, 27>' cannot be used in a constant expression
  fputil::DoubleDouble prod = fputil::exact_mult(x, y);
                              ^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/double_double.h:132:42: note: declared here
LIBC_INLINE LIBC_CONSTEXPR NumberPair<T> exact_mult(T a, T b) {
                                         ^
1 error generated.
[63/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.asinpi.__NO_ROUND_OPT.__internal__.dir/asinpi.cpp.o
[64/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.exp2.dir/exp2.cpp.o
[65/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.exp.__NO_ROUND_OPT.dir/exp.cpp.o
[66/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.exp.__NO_ROUND_OPT.__internal__.dir/exp.cpp.o
[67/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.powf.__internal__.dir/powf.cpp.o
[68/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.fsubl.dir/fsubl.cpp.o
[69/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.sin.__internal__.dir/sin.cpp.o
[70/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.fmull.dir/fmull.cpp.o
[71/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.powf.dir/powf.cpp.o
[72/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.fsubf128.__internal__.dir/fsubf128.cpp.o
[73/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.tan.__NO_ROUND_OPT.__internal__.dir/tan.cpp.o
[74/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.expm1.dir/expm1.cpp.o
[75/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.tan.dir/tan.cpp.o
[76/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.tan.__NO_ROUND_OPT.dir/tan.cpp.o
[77/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.sin.__NO_ROUND_OPT.__internal__.dir/sin.cpp.o
[78/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.asin.__internal__.dir/asin.cpp.o
[79/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.log1p.__internal__.dir/log1p.cpp.o
ninja: build stopped: subcommand failed.
['ninja', 'libc-unit-tests'] 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 181, in step
    yield
  File "../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 154, in main
    run_command(['ninja', 'libc-unit-tests'])
  File "../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 196, in run_command
Step 8 (libc-unit-tests) failure: libc-unit-tests (failure)
...
[==========] Running 2 tests from 1 test suite.
[ RUN      ] LlvmLibcCImagTest.SpecialNumbers
[       OK ] LlvmLibcCImagTest.SpecialNumbers (9 us)
[ RUN      ] LlvmLibcCImagTest.RoundedNumbers
[       OK ] LlvmLibcCImagTest.RoundedNumbers (3 us)
Ran 2 tests.  PASS: 2  FAIL: 0
[59/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.exp.__internal__.dir/exp.cpp.o
[60/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.cos.dir/cos.cpp.o
[61/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.sincos.__internal__.dir/sincos.cpp.o
[62/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.fmul.dir/fmul.cpp.o
FAILED: libc/src/math/generic/CMakeFiles/libc.src.math.generic.fmul.dir/fmul.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc -isystem libc/include -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 -Wno-comment -Wstring-conversion -Wno-pass-failed -fdiagnostics-color -g -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_COPT_STRING_LENGTH_IMPL=clang_vector -DLIBC_COPT_FIND_FIRST_CHARACTER_IMPL=word -DLIBC_ADD_NULL_CHECKS -DLIBC_ERRNO_MODE=LIBC_ERRNO_MODE_DEFAULT -DLIBC_THREAD_MODE=LIBC_THREAD_MODE_PLATFORM -DLIBC_COPT_TIMEOUT_ENSURE_MONOTONICITY -DLIBC_CONF_WCTYPE_MODE=LIBC_WCTYPE_MODE_ASCII -DLIBC_COPT_RAW_MUTEX_DEFAULT_SPIN_COUNT=100 -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 -fstack-protector-strong -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 -std=gnu++17 -MD -MT libc/src/math/generic/CMakeFiles/libc.src.math.generic.fmul.dir/fmul.cpp.o -MF libc/src/math/generic/CMakeFiles/libc.src.math.generic.fmul.dir/fmul.cpp.o.d -o libc/src/math/generic/CMakeFiles/libc.src.math.generic.fmul.dir/fmul.cpp.o -c /home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/math/generic/fmul.cpp
In file included from /home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/math/generic/fmul.cpp:10:
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/__support/math/fmul.h:21:29: error: constexpr function never produces a constant expression [-Winvalid-constexpr]
LIBC_INLINE constexpr float fmul(double x, double y) {
                            ^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/__support/math/fmul.h:30:31: note: non-constexpr function 'exact_mult<double, 27>' cannot be used in a constant expression
  fputil::DoubleDouble prod = fputil::exact_mult(x, y);
                              ^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/double_double.h:132:42: note: declared here
LIBC_INLINE LIBC_CONSTEXPR NumberPair<T> exact_mult(T a, T b) {
                                         ^
1 error generated.
[63/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.asinpi.__NO_ROUND_OPT.__internal__.dir/asinpi.cpp.o
[64/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.exp2.dir/exp2.cpp.o
[65/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.exp.__NO_ROUND_OPT.dir/exp.cpp.o
[66/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.exp.__NO_ROUND_OPT.__internal__.dir/exp.cpp.o
[67/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.powf.__internal__.dir/powf.cpp.o
[68/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.fsubl.dir/fsubl.cpp.o
[69/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.sin.__internal__.dir/sin.cpp.o
[70/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.fmull.dir/fmull.cpp.o
[71/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.powf.dir/powf.cpp.o
[72/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.fsubf128.__internal__.dir/fsubf128.cpp.o
[73/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.tan.__NO_ROUND_OPT.__internal__.dir/tan.cpp.o
[74/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.expm1.dir/expm1.cpp.o
[75/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.tan.dir/tan.cpp.o
[76/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.tan.__NO_ROUND_OPT.dir/tan.cpp.o
[77/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.sin.__NO_ROUND_OPT.__internal__.dir/sin.cpp.o
[78/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.asin.__internal__.dir/asin.cpp.o
[79/1133] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.log1p.__internal__.dir/log1p.cpp.o
ninja: build stopped: subcommand failed.
['ninja', 'libc-unit-tests'] 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 181, in step
    yield
  File "../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 154, in main
    run_command(['ninja', 'libc-unit-tests'])
  File "../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 196, in run_command

```

</details>

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


More information about the libc-commits mailing list