[libc-commits] [libc] [llvm] [libc][math] Refactor bf16divf implementation to header-only in src/__support/math folder. (PR #181086)
LLVM Continuous Integration via libc-commits
libc-commits at lists.llvm.org
Tue Feb 17 13:58:49 PST 2026
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,utils` at step 4 "annotate".
Full details are available at: https://lab.llvm.org/buildbot/#/builders/131/builds/40272
<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 ] LlvmLibcHypotfTest.SpecialNumbers
[ OK ] LlvmLibcHypotfTest.SpecialNumbers (104 us)
[ RUN ] LlvmLibcHypotfTest.FTZMode
[ OK ] LlvmLibcHypotfTest.FTZMode (3 us)
[ RUN ] LlvmLibcHypotfTest.DAZMode
[ OK ] LlvmLibcHypotfTest.DAZMode (4 us)
[ RUN ] LlvmLibcHypotfTest.FTZDAZMode
[ OK ] LlvmLibcHypotfTest.FTZDAZMode (4 us)
Ran 4 tests. PASS: 4 FAIL: 0
[610/1429] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.bf16divf.__internal__.dir/bf16divf.cpp.o
FAILED: libc/src/math/generic/CMakeFiles/libc.src.math.generic.bf16divf.__internal__.dir/bf16divf.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-array-bounds -Wno-stringop-overread -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_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_CONF_WCTYPE_MODE=LIBC_WCTYPE_MODE_ASCII -DLIBC_COPT_RAW_MUTEX_DEFAULT_SPIN_COUNT=100 -fpie -ffreestanding -DLIBC_FULL_BUILD -isystem/usr/lib/gcc/x86_64-linux-gnu/12//include -nostdinc -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 -mno-omit-leaf-frame-pointer -fstack-protector-strong -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wdeprecated -fext-numeric-literals -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -std=gnu++17 -MD -MT libc/src/math/generic/CMakeFiles/libc.src.math.generic.bf16divf.__internal__.dir/bf16divf.cpp.o -MF libc/src/math/generic/CMakeFiles/libc.src.math.generic.bf16divf.__internal__.dir/bf16divf.cpp.o.d -o libc/src/math/generic/CMakeFiles/libc.src.math.generic.bf16divf.__internal__.dir/bf16divf.cpp.o -c /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/math/generic/bf16divf.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/src/math/generic/bf16divf.cpp:10:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/__support/math/bf16divf.h: In function ‘constexpr bfloat16 __llvm_libc_20_0_0_git::math::bf16divf(float, float)’:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/__support/math/bf16divf.h:21:40: error: call to non-‘constexpr’ function ‘__llvm_libc_20_0_0_git::cpp::enable_if_t<((is_floating_point_v<OutType> && is_floating_point_v<InType>) && (sizeof (OutType) <= sizeof (InType))), OutType> __llvm_libc_20_0_0_git::fputil::generic::div(InType, InType) [with OutType = __llvm_libc_20_0_0_git::fputil::BFloat16; InType = float; __llvm_libc_20_0_0_git::cpp::enable_if_t<((is_floating_point_v<OutType> && is_floating_point_v<InType>) && (sizeof (OutType) <= sizeof (InType))), OutType> = __llvm_libc_20_0_0_git::fputil::BFloat16]’
21 | return fputil::generic::div<bfloat16>(x, y);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
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/src/__support/FPUtil/bfloat16.h:19,
from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/__support/math/bf16divf.h:12:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/generic/div.h:33:1: note: ‘__llvm_libc_20_0_0_git::cpp::enable_if_t<((is_floating_point_v<OutType> && is_floating_point_v<InType>) && (sizeof (OutType) <= sizeof (InType))), OutType> __llvm_libc_20_0_0_git::fputil::generic::div(InType, InType) [with OutType = __llvm_libc_20_0_0_git::fputil::BFloat16; InType = float; __llvm_libc_20_0_0_git::cpp::enable_if_t<((is_floating_point_v<OutType> && is_floating_point_v<InType>) && (sizeof (OutType) <= sizeof (InType))), OutType> = __llvm_libc_20_0_0_git::fputil::BFloat16]’ declared here
33 | div(InType x, InType y) {
| ^~~
[611/1429] Running unit test libc.test.src.math.smoke.hypotf_test.__unit__
[==========] Running 4 tests from 1 test suite.
[ RUN ] LlvmLibcHypotfTest.SpecialNumbers
[ OK ] LlvmLibcHypotfTest.SpecialNumbers (105 us)
[ RUN ] LlvmLibcHypotfTest.FTZMode
[ OK ] LlvmLibcHypotfTest.FTZMode (3 us)
[ RUN ] LlvmLibcHypotfTest.DAZMode
[ OK ] LlvmLibcHypotfTest.DAZMode (4 us)
[ RUN ] LlvmLibcHypotfTest.FTZDAZMode
[ OK ] LlvmLibcHypotfTest.FTZDAZMode (4 us)
Ran 4 tests. PASS: 4 FAIL: 0
[612/1429] Running unit test libc.test.src.math.smoke.fminimum_mag_num_test.__unit__.__NO_FMA_OPT
[==========] Running 5 tests from 1 test suite.
[ RUN ] LlvmLibcFMinimumMagNumTest.NaN
[ OK ] LlvmLibcFMinimumMagNumTest.NaN (27 us)
[ RUN ] LlvmLibcFMinimumMagNumTest.InfArg
[ OK ] LlvmLibcFMinimumMagNumTest.InfArg (5 us)
[ RUN ] LlvmLibcFMinimumMagNumTest.NegInfArg
[ OK ] LlvmLibcFMinimumMagNumTest.NegInfArg (5 us)
[ RUN ] LlvmLibcFMinimumMagNumTest.BothZero
[ OK ] LlvmLibcFMinimumMagNumTest.BothZero (6 us)
[ RUN ] LlvmLibcFMinimumMagNumTest.Range
[ OK ] LlvmLibcFMinimumMagNumTest.Range (68 ms)
Ran 5 tests. PASS: 5 FAIL: 0
[613/1429] Running unit test libc.test.src.math.smoke.hypot_test.__unit__
[==========] Running 1 test from 1 test suite.
[ RUN ] LlvmLibcHypotTest.SpecialNumbers
```
</details>
https://github.com/llvm/llvm-project/pull/181086
More information about the libc-commits
mailing list