[libc-commits] [libc] [llvm] [libc][math] Refactor log2f16 to Header Only. (PR #176526)
via libc-commits
libc-commits at lists.llvm.org
Fri Jan 16 17:30:37 PST 2026
github-actions[bot] wrote:
<!--PREMERGE ADVISOR COMMENT: Linux-->
# :penguin: Linux x64 Test Results
The build failed before running any tests. Click on a failure below to see the details.
<details>
<summary>libc/src/math/generic/CMakeFiles/libc.src.math.generic.log2f16.dir/log2f16.cpp.o</summary>
```
FAILED: libc/src/math/generic/CMakeFiles/libc.src.math.generic.log2f16.dir/log2f16.cpp.o
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/./bin/clang++ --target=x86_64-unknown-linux-gnu -DLIBC_NAMESPACE=__llvm_libc_23_0_0_git -I/home/gha/actions-runner/_work/llvm-project/llvm-project/libc -isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/runtimes/runtimes-bins/libc/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -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 -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=gnu++17 -mavx2 -mfma -msse4.2 -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 -ffixed-point -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 -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 -UNDEBUG -MD -MT libc/src/math/generic/CMakeFiles/libc.src.math.generic.log2f16.dir/log2f16.cpp.o -MF libc/src/math/generic/CMakeFiles/libc.src.math.generic.log2f16.dir/log2f16.cpp.o.d -o libc/src/math/generic/CMakeFiles/libc.src.math.generic.log2f16.dir/log2f16.cpp.o -c /home/gha/actions-runner/_work/llvm-project/llvm-project/libc/src/math/generic/log2f16.cpp
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/src/math/generic/log2f16.cpp:14:1: error: definition with same mangled name 'log2f16' as another definition
14 | LLVM_LIBC_FUNCTION(float16, log2f16, (float16 x)) { return math::log2f16(x); }
| ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/src/__support/common.h:65:3: note: expanded from macro 'LLVM_LIBC_FUNCTION'
65 | LLVM_LIBC_FUNCTION_IMPL(type, name, arglist)
| ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/src/__support/common.h:52:8: note: expanded from macro 'LLVM_LIBC_FUNCTION_IMPL'
52 | type __##name##_impl__ arglist
| ^
<scratch space>:2:1: note: expanded from here
2 | __log2f16_impl__
| ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/src/__support/math/log2f16.h:72:1: note: previous definition is here
72 | LLVM_LIBC_FUNCTION(float16, log2f16, (float16 x)) {
| ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/src/__support/common.h:65:3: note: expanded from macro 'LLVM_LIBC_FUNCTION'
65 | LLVM_LIBC_FUNCTION_IMPL(type, name, arglist)
| ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/src/__support/common.h:52:8: note: expanded from macro 'LLVM_LIBC_FUNCTION_IMPL'
52 | type __##name##_impl__ arglist
| ^
<scratch space>:518:1: note: expanded from here
518 | __log2f16_impl__
| ^
1 error generated.
```
</details>
<details>
<summary>libc/src/math/generic/CMakeFiles/libc.src.math.generic.log2f16.__NO_ROUND_OPT.dir/log2f16.cpp.o</summary>
```
FAILED: libc/src/math/generic/CMakeFiles/libc.src.math.generic.log2f16.__NO_ROUND_OPT.dir/log2f16.cpp.o
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/./bin/clang++ --target=x86_64-unknown-linux-gnu -DLIBC_NAMESPACE=__llvm_libc_23_0_0_git -I/home/gha/actions-runner/_work/llvm-project/llvm-project/libc -isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/runtimes/runtimes-bins/libc/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -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 -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=gnu++17 -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 -ffixed-point -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 -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 -UNDEBUG -MD -MT libc/src/math/generic/CMakeFiles/libc.src.math.generic.log2f16.__NO_ROUND_OPT.dir/log2f16.cpp.o -MF libc/src/math/generic/CMakeFiles/libc.src.math.generic.log2f16.__NO_ROUND_OPT.dir/log2f16.cpp.o.d -o libc/src/math/generic/CMakeFiles/libc.src.math.generic.log2f16.__NO_ROUND_OPT.dir/log2f16.cpp.o -c /home/gha/actions-runner/_work/llvm-project/llvm-project/libc/src/math/generic/log2f16.cpp
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/src/math/generic/log2f16.cpp:14:1: error: definition with same mangled name 'log2f16' as another definition
14 | LLVM_LIBC_FUNCTION(float16, log2f16, (float16 x)) { return math::log2f16(x); }
| ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/src/__support/common.h:65:3: note: expanded from macro 'LLVM_LIBC_FUNCTION'
65 | LLVM_LIBC_FUNCTION_IMPL(type, name, arglist)
| ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/src/__support/common.h:52:8: note: expanded from macro 'LLVM_LIBC_FUNCTION_IMPL'
52 | type __##name##_impl__ arglist
| ^
<scratch space>:2:1: note: expanded from here
2 | __log2f16_impl__
| ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/src/__support/math/log2f16.h:72:1: note: previous definition is here
72 | LLVM_LIBC_FUNCTION(float16, log2f16, (float16 x)) {
| ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/src/__support/common.h:65:3: note: expanded from macro 'LLVM_LIBC_FUNCTION'
65 | LLVM_LIBC_FUNCTION_IMPL(type, name, arglist)
| ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/src/__support/common.h:52:8: note: expanded from macro 'LLVM_LIBC_FUNCTION_IMPL'
52 | type __##name##_impl__ arglist
| ^
<scratch space>:518:1: note: expanded from here
518 | __log2f16_impl__
| ^
1 error generated.
```
</details>
<details>
<summary>libc/src/math/generic/CMakeFiles/libc.src.math.generic.log2f16.__NO_FMA_OPT.dir/log2f16.cpp.o</summary>
```
FAILED: libc/src/math/generic/CMakeFiles/libc.src.math.generic.log2f16.__NO_FMA_OPT.dir/log2f16.cpp.o
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/./bin/clang++ --target=x86_64-unknown-linux-gnu -DLIBC_NAMESPACE=__llvm_libc_23_0_0_git -I/home/gha/actions-runner/_work/llvm-project/llvm-project/libc -isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/runtimes/runtimes-bins/libc/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -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 -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=gnu++17 -msse4.2 -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 -ffixed-point -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 -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 -UNDEBUG -MD -MT libc/src/math/generic/CMakeFiles/libc.src.math.generic.log2f16.__NO_FMA_OPT.dir/log2f16.cpp.o -MF libc/src/math/generic/CMakeFiles/libc.src.math.generic.log2f16.__NO_FMA_OPT.dir/log2f16.cpp.o.d -o libc/src/math/generic/CMakeFiles/libc.src.math.generic.log2f16.__NO_FMA_OPT.dir/log2f16.cpp.o -c /home/gha/actions-runner/_work/llvm-project/llvm-project/libc/src/math/generic/log2f16.cpp
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/src/math/generic/log2f16.cpp:14:1: error: definition with same mangled name 'log2f16' as another definition
14 | LLVM_LIBC_FUNCTION(float16, log2f16, (float16 x)) { return math::log2f16(x); }
| ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/src/__support/common.h:65:3: note: expanded from macro 'LLVM_LIBC_FUNCTION'
65 | LLVM_LIBC_FUNCTION_IMPL(type, name, arglist)
| ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/src/__support/common.h:52:8: note: expanded from macro 'LLVM_LIBC_FUNCTION_IMPL'
52 | type __##name##_impl__ arglist
| ^
<scratch space>:523:1: note: expanded from here
523 | __log2f16_impl__
| ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/src/__support/math/log2f16.h:72:1: note: previous definition is here
72 | LLVM_LIBC_FUNCTION(float16, log2f16, (float16 x)) {
| ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/src/__support/common.h:65:3: note: expanded from macro 'LLVM_LIBC_FUNCTION'
65 | LLVM_LIBC_FUNCTION_IMPL(type, name, arglist)
| ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/src/__support/common.h:52:8: note: expanded from macro 'LLVM_LIBC_FUNCTION_IMPL'
52 | type __##name##_impl__ arglist
| ^
<scratch space>:516:1: note: expanded from here
516 | __log2f16_impl__
| ^
1 error generated.
```
</details>
<details>
<summary>libc/src/math/generic/CMakeFiles/libc.src.math.generic.log2f16.__NO_FMA_OPT.__NO_ROUND_OPT.dir/log2f16.cpp.o</summary>
```
FAILED: libc/src/math/generic/CMakeFiles/libc.src.math.generic.log2f16.__NO_FMA_OPT.__NO_ROUND_OPT.dir/log2f16.cpp.o
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/./bin/clang++ --target=x86_64-unknown-linux-gnu -DLIBC_NAMESPACE=__llvm_libc_23_0_0_git -I/home/gha/actions-runner/_work/llvm-project/llvm-project/libc -isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/runtimes/runtimes-bins/libc/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -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 -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=gnu++17 -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 -ffixed-point -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 -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 -UNDEBUG -MD -MT libc/src/math/generic/CMakeFiles/libc.src.math.generic.log2f16.__NO_FMA_OPT.__NO_ROUND_OPT.dir/log2f16.cpp.o -MF libc/src/math/generic/CMakeFiles/libc.src.math.generic.log2f16.__NO_FMA_OPT.__NO_ROUND_OPT.dir/log2f16.cpp.o.d -o libc/src/math/generic/CMakeFiles/libc.src.math.generic.log2f16.__NO_FMA_OPT.__NO_ROUND_OPT.dir/log2f16.cpp.o -c /home/gha/actions-runner/_work/llvm-project/llvm-project/libc/src/math/generic/log2f16.cpp
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/src/math/generic/log2f16.cpp:14:1: error: definition with same mangled name 'log2f16' as another definition
14 | LLVM_LIBC_FUNCTION(float16, log2f16, (float16 x)) { return math::log2f16(x); }
| ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/src/__support/common.h:65:3: note: expanded from macro 'LLVM_LIBC_FUNCTION'
65 | LLVM_LIBC_FUNCTION_IMPL(type, name, arglist)
| ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/src/__support/common.h:52:8: note: expanded from macro 'LLVM_LIBC_FUNCTION_IMPL'
52 | type __##name##_impl__ arglist
| ^
<scratch space>:523:1: note: expanded from here
523 | __log2f16_impl__
| ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/src/__support/math/log2f16.h:72:1: note: previous definition is here
72 | LLVM_LIBC_FUNCTION(float16, log2f16, (float16 x)) {
| ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/src/__support/common.h:65:3: note: expanded from macro 'LLVM_LIBC_FUNCTION'
65 | LLVM_LIBC_FUNCTION_IMPL(type, name, arglist)
| ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/src/__support/common.h:52:8: note: expanded from macro 'LLVM_LIBC_FUNCTION_IMPL'
52 | type __##name##_impl__ arglist
| ^
<scratch space>:516:1: note: expanded from here
516 | __log2f16_impl__
| ^
1 error generated.
```
</details>
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.
https://github.com/llvm/llvm-project/pull/176526
More information about the libc-commits
mailing list