[libc-commits] [libc] [llvm] [libc][math][c23] Add hypotbf16 function (PR #183460)

LLVM Continuous Integration via libc-commits libc-commits at lists.llvm.org
Fri Mar 13 07:19:16 PDT 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/42176

<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 1 test from 1 test suite.
[ RUN      ] LlvmLibcFmaTest.SpecialNumbers
[       OK ] LlvmLibcFmaTest.SpecialNumbers (132 us)
Ran 1 tests.  PASS: 1  FAIL: 0
[925/1474] Running unit test libc.test.src.math.smoke.bf16fmal_test.__unit__.__NO_FMA_OPT
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcFmaTest.SpecialNumbers
[       OK ] LlvmLibcFmaTest.SpecialNumbers (123 us)
Ran 1 tests.  PASS: 1  FAIL: 0
[926/1474] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.hypotbf16.__internal__.dir/hypotbf16.cpp.o
FAILED: libc/src/math/generic/CMakeFiles/libc.src.math.generic.hypotbf16.__internal__.dir/hypotbf16.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-dangling-pointer -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.hypotbf16.__internal__.dir/hypotbf16.cpp.o -MF libc/src/math/generic/CMakeFiles/libc.src.math.generic.hypotbf16.__internal__.dir/hypotbf16.cpp.o.d -o libc/src/math/generic/CMakeFiles/libc.src.math.generic.hypotbf16.__internal__.dir/hypotbf16.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/hypotbf16.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/__support/math/hypotbf16.h:12,
                 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/hypotbf16.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/FPUtil/Hypot.h: In instantiation of ‘T __llvm_libc_20_0_0_git::fputil::hypot(T, T) [with T = BFloat16; typename __llvm_libc_20_0_0_git::cpp::enable_if<is_floating_point_v<T>, int>::type <anonymous> = 0]’:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/__support/math/hypotbf16.h:22:33:   required from here
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/Hypot.h:221:44: error: conversion from ‘int’ to ‘StorageType’ {aka ‘short unsigned int’} may change value [-Werror=conversion]
  221 |     r = static_cast<StorageType>((r << 1)) +
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
  222 |         ((tail_bits & current_bit) ? 1 : 0);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
cc1plus: all warnings being treated as errors
[927/1474] Running unit test libc.test.src.math.smoke.bf16fmaf128_test.__unit__
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcFmaTest.SpecialNumbers
[       OK ] LlvmLibcFmaTest.SpecialNumbers (140 us)
Ran 1 tests.  PASS: 1  FAIL: 0
[928/1474] Running unit test libc.test.src.math.smoke.bf16fmaf128_test.__unit__.__NO_FMA_OPT
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcFmaTest.SpecialNumbers
[       OK ] LlvmLibcFmaTest.SpecialNumbers (136 us)
Ran 1 tests.  PASS: 1  FAIL: 0
[929/1474] Running unit test libc.test.src.math.smoke.bf16div_test.__unit__
[==========] Running 5 tests from 1 test suite.
[ RUN      ] LlvmLibcDivTest.SpecialNumbers
[       OK ] LlvmLibcDivTest.SpecialNumbers (26 us)
[ RUN      ] LlvmLibcDivTest.DivisionByZero
[       OK ] LlvmLibcDivTest.DivisionByZero (5 us)
[ RUN      ] LlvmLibcDivTest.InvalidOperations
[       OK ] LlvmLibcDivTest.InvalidOperations (15 us)
[ RUN      ] LlvmLibcDivTest.RangeErrors
[       OK ] LlvmLibcDivTest.RangeErrors (29 us)
[ RUN      ] LlvmLibcDivTest.InexactResults
[       OK ] LlvmLibcDivTest.InexactResults (3 us)
Ran 5 tests.  PASS: 5  FAIL: 0
[930/1474] Running unit test libc.test.src.math.smoke.bf16div_test.__unit__.__NO_FMA_OPT
[==========] Running 5 tests from 1 test suite.
[ RUN      ] LlvmLibcDivTest.SpecialNumbers
[       OK ] LlvmLibcDivTest.SpecialNumbers (18 us)

```

</details>

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


More information about the libc-commits mailing list