Skip to content

Conversation

@krishna2803
Copy link
Contributor

@krishna2803 krishna2803 commented Jul 12, 2025

This PR implements fabsbf16 math function for BFloat16 type along with the tests.

@krishna2803 krishna2803 changed the title [libc][c++23][math] Add fabsbf16 math function [libc][math][c++23] Add fabsbf16 math function Jul 23, 2025
krishna2803 and others added 2 commits July 23, 2025 20:25
@lntue lntue merged commit 111edfc into llvm:main Jul 29, 2025
19 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 29, 2025

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/27937

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)
...
-- Set CPU features: FullFP16
-- Compiler features available: builtin_ceil_floor_rint_trunc;builtin_fmax_fmin;builtin_fmaxf16_fminf16;builtin_round;cfloat128;float128;float16
-- Using getrandom for hashtable randomness
-- check-runtimes does nothing.
-- 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 libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsbf16.dir/fabsbf16.cpp.o
FAILED: libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsbf16.dir/fabsbf16.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/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 -fdiagnostics-color -g -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_ADD_NULL_CHECKS -DLIBC_ERRNO_MODE=LIBC_ERRNO_MODE_DEFAULT -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 -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.fabsbf16.dir/fabsbf16.cpp.o -MF libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsbf16.dir/fabsbf16.cpp.o.d -o libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsbf16.dir/fabsbf16.cpp.o -c /home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu/llvm-project/libc/src/math/generic/fabsbf16.cpp
In file included from /home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu/llvm-project/libc/src/math/generic/fabsbf16.cpp:12:
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu/llvm-project/libc/src/__support/FPUtil/bfloat16.h:31:56: error: inline function '__llvm_libc_20_0_0_git::fputil::BFloat16::BFloat16<float>' is not defined [-Werror,-Wundefined-inline]
  template <typename T> LIBC_INLINE constexpr explicit BFloat16(T value) {
                                                       ^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu/llvm-project/libc/src/__support/FPUtil/cast.h:71:10: note: used here
  return static_cast<OutType>(x);
         ^
1 error 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 181, in step
    yield
  File "../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 143, in main
    run_command(['ninja', 'libc'])
  File "../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 196, 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
[1/1022] Running unit test libc.test.src.math.roundf_test.__unit__
[==========] Running 4 tests from 1 test suite.
[ RUN      ] LlvmLibcRoundTest.SpecialNumbers
[       OK ] LlvmLibcRoundTest.SpecialNumbers (3 us)
[ RUN      ] LlvmLibcRoundTest.RoundedNubmers
[       OK ] LlvmLibcRoundTest.RoundedNubmers (1 us)
[ RUN      ] LlvmLibcRoundTest.Fractions
[       OK ] LlvmLibcRoundTest.Fractions (3 us)
[ RUN      ] LlvmLibcRoundTest.Range
[       OK ] LlvmLibcRoundTest.Range (31 ms)
Ran 4 tests.  PASS: 4  FAIL: 0

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 29, 2025

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

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

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)
...
[       OK ] LlvmLibcLdExpTest.NormalOperation (1 ms)
Ran 6 tests.  PASS: 6  FAIL: 0
[213/923] Running unit test libc.test.src.math.smoke.exp2f_test.__unit__.__NO_ROUND_OPT
[==========] Running 2 tests from 1 test suite.
[ RUN      ] LlvmLibcExp2fTest.SpecialNumbers
[       OK ] LlvmLibcExp2fTest.SpecialNumbers (14 us)
[ RUN      ] LlvmLibcExp2fTest.Overflow
[       OK ] LlvmLibcExp2fTest.Overflow (3 us)
Ran 2 tests.  PASS: 2  FAIL: 0
[214/923] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsbf16.dir/fabsbf16.cpp.o
FAILED: libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsbf16.dir/fabsbf16.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 -fdiagnostics-color -g -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_ADD_NULL_CHECKS -DLIBC_ERRNO_MODE=LIBC_ERRNO_MODE_DEFAULT -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 -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.fabsbf16.dir/fabsbf16.cpp.o -MF libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsbf16.dir/fabsbf16.cpp.o.d -o libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsbf16.dir/fabsbf16.cpp.o -c /home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/math/generic/fabsbf16.cpp
In file included from /home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/math/generic/fabsbf16.cpp:12:
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/bfloat16.h:31:56: error: inline function '__llvm_libc_20_0_0_git::fputil::BFloat16::BFloat16<float>' is not defined [-Werror,-Wundefined-inline]
  template <typename T> LIBC_INLINE constexpr explicit BFloat16(T value) {
                                                       ^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/cast.h:71:10: note: used here
  return static_cast<OutType>(x);
         ^
1 error generated.
[215/923] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsbf16.__internal__.dir/fabsbf16.cpp.o
FAILED: libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsbf16.__internal__.dir/fabsbf16.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 -fdiagnostics-color -g -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_ADD_NULL_CHECKS -DLIBC_ERRNO_MODE=LIBC_ERRNO_MODE_DEFAULT -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 -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 -std=gnu++17 -MD -MT libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsbf16.__internal__.dir/fabsbf16.cpp.o -MF libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsbf16.__internal__.dir/fabsbf16.cpp.o.d -o libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsbf16.__internal__.dir/fabsbf16.cpp.o -c /home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/math/generic/fabsbf16.cpp
In file included from /home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/math/generic/fabsbf16.cpp:12:
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/bfloat16.h:31:56: error: inline function '__llvm_libc_20_0_0_git::fputil::BFloat16::BFloat16<float>' is not defined [-Werror,-Wundefined-inline]
  template <typename T> LIBC_INLINE constexpr explicit BFloat16(T value) {
                                                       ^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/cast.h:71:10: note: used here
  return static_cast<OutType>(x);
         ^
1 error generated.
[216/923] Running unit test libc.test.src.math.fminl_test.__unit__
[==========] Running 5 tests from 1 test suite.
[ RUN      ] LlvmLibcFMinTest.NaN
[       OK ] LlvmLibcFMinTest.NaN (4 us)
[ RUN      ] LlvmLibcFMinTest.InfArg
[       OK ] LlvmLibcFMinTest.InfArg (2 us)
[ RUN      ] LlvmLibcFMinTest.NegInfArg
[       OK ] LlvmLibcFMinTest.NegInfArg (2 us)
[ RUN      ] LlvmLibcFMinTest.BothZero
[       OK ] LlvmLibcFMinTest.BothZero (2 us)
[ RUN      ] LlvmLibcFMinTest.Range
[       OK ] LlvmLibcFMinTest.Range (53 ms)
Ran 5 tests.  PASS: 5  FAIL: 0
[217/923] Running unit test libc.test.src.math.fminf_test.__unit__
[==========] Running 5 tests from 1 test suite.
[ RUN      ] LlvmLibcFMinTest.NaN
[       OK ] LlvmLibcFMinTest.NaN (3 us)
[ RUN      ] LlvmLibcFMinTest.InfArg

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 29, 2025

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

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

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)
...
  Math tests using MPC will be skipped.


-- check-runtimes does nothing.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-dbg/build
@@@BUILD_STEP build libc@@@
Running: ninja libc
[1/2] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsbf16.dir/fabsbf16.cpp.o
FAILED: libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsbf16.dir/fabsbf16.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-dbg/llvm-project/libc -isystem /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-dbg/build/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 -fdiagnostics-color -g -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_ADD_NULL_CHECKS -DLIBC_ERRNO_MODE=LIBC_ERRNO_MODE_DEFAULT -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 -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.fabsbf16.dir/fabsbf16.cpp.o -MF libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsbf16.dir/fabsbf16.cpp.o.d -o libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsbf16.dir/fabsbf16.cpp.o -c /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-dbg/llvm-project/libc/src/math/generic/fabsbf16.cpp
In file included from /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-dbg/llvm-project/libc/src/math/generic/fabsbf16.cpp:12:
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-dbg/llvm-project/libc/src/__support/FPUtil/bfloat16.h:31:56: error: inline function '__llvm_libc_20_0_0_git::fputil::BFloat16::BFloat16<float>' is not defined [-Werror,-Wundefined-inline]
  template <typename T> LIBC_INLINE constexpr explicit BFloat16(T value) {
                                                       ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-dbg/llvm-project/libc/src/__support/FPUtil/cast.h:71:10: note: used here
  return static_cast<OutType>(x);
         ^
1 error 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 "/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-dbg/build/../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 181, in step
    yield
  File "/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-dbg/build/../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 143, in main
    run_command(['ninja', 'libc'])
  File "/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-dbg/build/../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 196, in run_command
    util.report_run_cmd(cmd, cwd=directory)
  File "/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-dbg/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/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ninja', 'libc']' returned non-zero exit status 1.
@@@STEP_FAILURE@@@
@@@BUILD_STEP libc-unit-tests@@@
Running: ninja libc-unit-tests
[1/1205] Running unit test libc.test.src.__support.block_test.__unit__
[==========] Running 23 tests from 1 test suite.
[ RUN      ] LlvmLibcBlockTest.CanCreateSingleAlignedBlock
[       OK ] LlvmLibcBlockTest.CanCreateSingleAlignedBlock (16 us)
[ RUN      ] LlvmLibcBlockTest.CanCreateUnalignedSingleBlock
[       OK ] LlvmLibcBlockTest.CanCreateUnalignedSingleBlock (6 us)
[ RUN      ] LlvmLibcBlockTest.CannotCreateTooSmallBlock
[       OK ] LlvmLibcBlockTest.CannotCreateTooSmallBlock (3 us)
[ RUN      ] LlvmLibcBlockTest.CanSplitBlock
[       OK ] LlvmLibcBlockTest.CanSplitBlock (9 us)
[ RUN      ] LlvmLibcBlockTest.CanSplitBlockUnaligned
Step 6 (build libc) failure: build libc (failure)
@@@BUILD_STEP build libc@@@
Running: ninja libc
[1/2] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsbf16.dir/fabsbf16.cpp.o
FAILED: libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsbf16.dir/fabsbf16.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-dbg/llvm-project/libc -isystem /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-dbg/build/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 -fdiagnostics-color -g -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_ADD_NULL_CHECKS -DLIBC_ERRNO_MODE=LIBC_ERRNO_MODE_DEFAULT -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 -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.fabsbf16.dir/fabsbf16.cpp.o -MF libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsbf16.dir/fabsbf16.cpp.o.d -o libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsbf16.dir/fabsbf16.cpp.o -c /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-dbg/llvm-project/libc/src/math/generic/fabsbf16.cpp
In file included from /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-dbg/llvm-project/libc/src/math/generic/fabsbf16.cpp:12:
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-dbg/llvm-project/libc/src/__support/FPUtil/bfloat16.h:31:56: error: inline function '__llvm_libc_20_0_0_git::fputil::BFloat16::BFloat16<float>' is not defined [-Werror,-Wundefined-inline]
  template <typename T> LIBC_INLINE constexpr explicit BFloat16(T value) {
                                                       ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-dbg/llvm-project/libc/src/__support/FPUtil/cast.h:71:10: note: used here
  return static_cast<OutType>(x);
         ^
1 error 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 "/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-dbg/build/../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 181, in step
    yield
  File "/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-dbg/build/../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 143, in main
    run_command(['ninja', 'libc'])
  File "/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-dbg/build/../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 196, in run_command
    util.report_run_cmd(cmd, cwd=directory)
  File "/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-dbg/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/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ninja', 'libc']' returned non-zero exit status 1.

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 29, 2025

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

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

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)
...
[ RUN      ] LlvmLibcPlatformFileTest.CreateAppendSeekAndReadBack
[       OK ] LlvmLibcPlatformFileTest.CreateAppendSeekAndReadBack (217 us)
[ RUN      ] LlvmLibcPlatformFileTest.LargeFile
[       OK ] LlvmLibcPlatformFileTest.LargeFile (569 us)
[ RUN      ] LlvmLibcPlatformFileTest.ReadSeekCurAndRead
[       OK ] LlvmLibcPlatformFileTest.ReadSeekCurAndRead (181 us)
[ RUN      ] LlvmLibcPlatformFileTest.IncorrectOperation
[       OK ] LlvmLibcPlatformFileTest.IncorrectOperation (95 us)
Ran 7 tests.  PASS: 7  FAIL: 0
[37/1090] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsbf16.__internal__.dir/fabsbf16.cpp.o
FAILED: libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsbf16.__internal__.dir/fabsbf16.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc -isystem /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/build/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 -fdiagnostics-color -g -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_ADD_NULL_CHECKS -DLIBC_ERRNO_MODE=LIBC_ERRNO_MODE_DEFAULT -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 -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 -std=gnu++17 -MD -MT libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsbf16.__internal__.dir/fabsbf16.cpp.o -MF libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsbf16.__internal__.dir/fabsbf16.cpp.o.d -o libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsbf16.__internal__.dir/fabsbf16.cpp.o -c /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/math/generic/fabsbf16.cpp
In file included from /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/math/generic/fabsbf16.cpp:12:
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/bfloat16.h:31:56: error: inline function '__llvm_libc_20_0_0_git::fputil::BFloat16::BFloat16<float>' is not defined [-Werror,-Wundefined-inline]
  template <typename T> LIBC_INLINE constexpr explicit BFloat16(T value) {
                                                       ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/cast.h:71:10: note: used here
  return static_cast<OutType>(x);
         ^
1 error generated.
[38/1090] Running unit test libc.test.src.__support.OSUtil.linux.vdso_test.__unit__
[==========] Running 9 tests from 1 test suite.
[ RUN      ] LlvmLibcOSUtilVDSOTest.GetTimeOfDay
[       OK ] LlvmLibcOSUtilVDSOTest.GetTimeOfDay (149 us)
[ RUN      ] LlvmLibcOSUtilVDSOTest.Time
[       OK ] LlvmLibcOSUtilVDSOTest.Time (2 us)
[ RUN      ] LlvmLibcOSUtilVDSOTest.ClockGetTime
[       OK ] LlvmLibcOSUtilVDSOTest.ClockGetTime (5 us)
[ RUN      ] LlvmLibcOSUtilVDSOTest.ClockGetTime64
[       OK ] LlvmLibcOSUtilVDSOTest.ClockGetTime64 (3 us)
[ RUN      ] LlvmLibcOSUtilVDSOTest.ClockGetRes
[       OK ] LlvmLibcOSUtilVDSOTest.ClockGetRes (4 us)
[ RUN      ] LlvmLibcOSUtilVDSOTest.GetCpu
[       OK ] LlvmLibcOSUtilVDSOTest.GetCpu (6 us)
[ RUN      ] LlvmLibcOSUtilVDSOTest.RtSigReturn
[       OK ] LlvmLibcOSUtilVDSOTest.RtSigReturn (30 us)
[ RUN      ] LlvmLibcOSUtilVDSOTest.FlushICache
[       OK ] LlvmLibcOSUtilVDSOTest.FlushICache (6 us)
[ RUN      ] LlvmLibcOSUtilVDSOTest.RiscvHwProbe
[       OK ] LlvmLibcOSUtilVDSOTest.RiscvHwProbe (3 us)
Ran 9 tests.  PASS: 9  FAIL: 0
[39/1090] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsbf16.dir/fabsbf16.cpp.o
FAILED: libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsbf16.dir/fabsbf16.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc -isystem /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/build/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 -fdiagnostics-color -g -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_ADD_NULL_CHECKS -DLIBC_ERRNO_MODE=LIBC_ERRNO_MODE_DEFAULT -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 -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.fabsbf16.dir/fabsbf16.cpp.o -MF libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsbf16.dir/fabsbf16.cpp.o.d -o libc/src/math/generic/CMakeFiles/libc.src.math.generic.fabsbf16.dir/fabsbf16.cpp.o -c /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/math/generic/fabsbf16.cpp
In file included from /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/math/generic/fabsbf16.cpp:12:
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/bfloat16.h:31:56: error: inline function '__llvm_libc_20_0_0_git::fputil::BFloat16::BFloat16<float>' is not defined [-Werror,-Wundefined-inline]
  template <typename T> LIBC_INLINE constexpr explicit BFloat16(T value) {
                                                       ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/cast.h:71:10: note: used here

@krishna2803 krishna2803 deleted the fabsbf16 branch July 29, 2025 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants