[libc-commits] [libc] [llvm] [libc][math] Fix powf exact cases, improve its performance, and add code-size optimized float-only version. (PR #226588)

via libc-commits libc-commits at lists.llvm.org
Fri Sep 25 13:51:36 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: lntue

<details>
<summary>Changes</summary>

Powf improvement:
- Fix exact case detection
- Improve performance
- Add code-size optimized float-only option
- Reorganize the implementation selection and tests.

Assisted-by: Gemini is used for code-size and performance analysis, and for refactoring.

---
Full diff: https://github.com/llvm/llvm-project/pull/226588.diff


12 Files Affected:

- (modified) libc/src/__support/FPUtil/double_double.h (+9-7) 
- (modified) libc/src/__support/math/CMakeLists.txt (+65-5) 
- (modified) libc/src/__support/math/powf.h (+14-1033) 
- (added) libc/src/__support/math/powf_double_eval.h (+548) 
- (added) libc/src/__support/math/powf_float_eval.h (+263) 
- (removed) libc/src/__support/math/powf_small_tables.h (-120) 
- (added) libc/src/__support/math/powf_utils.h (+718) 
- (modified) libc/test/src/math/CMakeLists.txt (+2) 
- (modified) libc/test/src/math/powf_test.cpp (+140-99) 
- (modified) libc/test/src/math/smoke/CMakeLists.txt (+2) 
- (modified) libc/test/src/math/smoke/powf_test.cpp (+261-231) 
- (modified) utils/bazel/llvm-project-overlay/libc/BUILD.bazel (+63-8) 


``````````diff
The server is unavailable at this time. Please wait a few minutes before you try again.
``````````

</details>


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


More information about the libc-commits mailing list