[libc-commits] [libc] [libc][math][c++23] Add fmodbf16 math function (PR #155575)

LLVM Continuous Integration via libc-commits libc-commits at lists.llvm.org
Wed Sep 3 09:52:57 PDT 2025


llvm-ci wrote:

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

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

<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)
...
[ RUN      ] LlvmLibcWcstollTest.DecodeInOtherBases
[       OK ] LlvmLibcWcstollTest.DecodeInOtherBases (556 ms)
[ RUN      ] LlvmLibcWcstollTest.CleanBaseSixteenDecode
[       OK ] LlvmLibcWcstollTest.CleanBaseSixteenDecode (12 us)
[ RUN      ] LlvmLibcWcstollTest.MessyBaseSixteenDecode
[       OK ] LlvmLibcWcstollTest.MessyBaseSixteenDecode (4 us)
[ RUN      ] LlvmLibcWcstollTest.AutomaticBaseSelection
[       OK ] LlvmLibcWcstollTest.AutomaticBaseSelection (6 us)
Ran 7 tests.  PASS: 7  FAIL: 0
[1386/1410] Building CXX object libc/test/src/math/smoke/CMakeFiles/libc.test.src.math.smoke.fmodbf16_test.__unit__.__build__.dir/fmodbf16_test.cpp.o
FAILED: libc/test/src/math/smoke/CMakeFiles/libc.test.src.math.smoke.fmodbf16_test.__unit__.__build__.dir/fmodbf16_test.cpp.o 
/usr/bin/g++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/build/libc/include -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -Wimplicit-fallthrough -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -g -mavx2 -mfma -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_ADD_NULL_CHECKS -DLIBC_ERRNO_MODE=LIBC_ERRNO_MODE_DEFAULT -DLIBC_THREAD_MODE=LIBC_THREAD_MODE_PLATFORM -fpie -DLIBC_FULL_BUILD -ffreestanding -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -Wconversion -Wno-sign-conversion -Wimplicit-fallthrough -Wwrite-strings -fext-numeric-literals -Wno-pedantic -DLIBC_TEST=UNIT -std=gnu++17 -MD -MT libc/test/src/math/smoke/CMakeFiles/libc.test.src.math.smoke.fmodbf16_test.__unit__.__build__.dir/fmodbf16_test.cpp.o -MF libc/test/src/math/smoke/CMakeFiles/libc.test.src.math.smoke.fmodbf16_test.__unit__.__build__.dir/fmodbf16_test.cpp.o.d -o libc/test/src/math/smoke/CMakeFiles/libc.test.src.math.smoke.fmodbf16_test.__unit__.__build__.dir/fmodbf16_test.cpp.o -c /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/src/math/smoke/fmodbf16_test.cpp
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/src/math/smoke/fmodbf16_test.cpp:9:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/src/math/smoke/FModTest.h: In instantiation of ‘constexpr const __llvm_libc_20_0_0_git::fputil::BFloat16 FmodTest<__llvm_libc_20_0_0_git::fputil::BFloat16>::three’:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/src/math/smoke/FModTest.h:49:5:   required from ‘void FmodTest<T>::testSpecialNumbers(FModFunc) [with T = __llvm_libc_20_0_0_git::fputil::BFloat16; FModFunc = __llvm_libc_20_0_0_git::fputil::BFloat16 (*)(__llvm_libc_20_0_0_git::fputil::BFloat16, __llvm_libc_20_0_0_git::fputil::BFloat16)]’
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/src/math/smoke/fmodbf16_test.cpp:14:1:   required from here
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/src/math/smoke/FModTest.h:37:22: error: ‘constexpr __llvm_libc_20_0_0_git::fputil::BFloat16::BFloat16(T) [with T = double]’ called in a constant expression
   37 |   static constexpr T three = T(3.0);
      |                      ^~~~~
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/src/math/smoke/fmodbf16_test.cpp:11:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/bfloat16.h:32:56: note: ‘constexpr __llvm_libc_20_0_0_git::fputil::BFloat16::BFloat16(T) [with T = double]’ is not usable as a ‘constexpr’ function because:
   32 |   template <typename T> LIBC_INLINE constexpr explicit BFloat16(T value) {
      |                                                        ^~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/bfloat16.h:32:56: error: member ‘__llvm_libc_20_0_0_git::fputil::BFloat16::bits’ must be initialized by mem-initializer in ‘constexpr’ constructor
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/bfloat16.h:28:12: note: declared here
   28 |   uint16_t bits;
      |            ^~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/src/math/smoke/FModTest.h: In instantiation of ‘constexpr const __llvm_libc_20_0_0_git::fputil::BFloat16 FmodTest<__llvm_libc_20_0_0_git::fputil::BFloat16>::val_neg_1_1’:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/src/math/smoke/FModTest.h:68:5:   required from ‘void FmodTest<T>::testSpecialNumbers(FModFunc) [with T = __llvm_libc_20_0_0_git::fputil::BFloat16; FModFunc = __llvm_libc_20_0_0_git::fputil::BFloat16 (*)(__llvm_libc_20_0_0_git::fputil::BFloat16, __llvm_libc_20_0_0_git::fputil::BFloat16)]’
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/src/math/smoke/fmodbf16_test.cpp:14:1:   required from here
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/src/math/smoke/FModTest.h:38:22: error: ‘constexpr __llvm_libc_20_0_0_git::fputil::BFloat16::BFloat16(T) [with T = double]’ called in a constant expression
   38 |   static constexpr T val_neg_1_1 = T(-1.1);
      |                      ^~~~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/src/math/smoke/FModTest.h: In instantiation of ‘constexpr const __llvm_libc_20_0_0_git::fputil::BFloat16 FmodTest<__llvm_libc_20_0_0_git::fputil::BFloat16>::one’:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/src/math/smoke/FModTest.h:125:5:   required from ‘void FmodTest<T>::testSpecialNumbers(FModFunc) [with T = __llvm_libc_20_0_0_git::fputil::BFloat16; FModFunc = __llvm_libc_20_0_0_git::fputil::BFloat16 (*)(__llvm_libc_20_0_0_git::fputil::BFloat16, __llvm_libc_20_0_0_git::fputil::BFloat16)]’
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/src/math/smoke/fmodbf16_test.cpp:14:1:   required from here
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/src/math/smoke/FModTest.h:34:22: error: ‘constexpr __llvm_libc_20_0_0_git::fputil::BFloat16::BFloat16(T) [with T = double]’ called in a constant expression
   34 |   static constexpr T one = T(1.0);
      |                      ^~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/src/math/smoke/FModTest.h: In instantiation of ‘constexpr const __llvm_libc_20_0_0_git::fputil::BFloat16 FmodTest<__llvm_libc_20_0_0_git::fputil::BFloat16>::two’:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/src/math/smoke/FModTest.h:178:5:   required from ‘void FmodTest<T>::testSpecialNumbers(FModFunc) [with T = __llvm_libc_20_0_0_git::fputil::BFloat16; FModFunc = __llvm_libc_20_0_0_git::fputil::BFloat16 (*)(__llvm_libc_20_0_0_git::fputil::BFloat16, __llvm_libc_20_0_0_git::fputil::BFloat16)]’
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/src/math/smoke/fmodbf16_test.cpp:14:1:   required from here
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/src/math/smoke/FModTest.h:35:22: error: ‘constexpr __llvm_libc_20_0_0_git::fputil::BFloat16::BFloat16(T) [with T = double]’ called in a constant expression
   35 |   static constexpr T two = T(2.0);
      |                      ^~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/src/math/smoke/FModTest.h: In instantiation of ‘constexpr const __llvm_libc_20_0_0_git::fputil::BFloat16 FmodTest<__llvm_libc_20_0_0_git::fputil::BFloat16>::val_6_5’:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/src/math/smoke/FModTest.h:178:5:   required from ‘void FmodTest<T>::testSpecialNumbers(FModFunc) [with T = __llvm_libc_20_0_0_git::fputil::BFloat16; FModFunc = __llvm_libc_20_0_0_git::fputil::BFloat16 (*)(__llvm_libc_20_0_0_git::fputil::BFloat16, __llvm_libc_20_0_0_git::fputil::BFloat16)]’
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/src/math/smoke/fmodbf16_test.cpp:14:1:   required from here
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/src/math/smoke/FModTest.h:39:22: error: ‘constexpr __llvm_libc_20_0_0_git::fputil::BFloat16::BFloat16(T) [with T = double]’ called in a constant expression

```

</details>

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


More information about the libc-commits mailing list