[llvm-branch-commits] [libc] [llvm] [libc][math] Add integer-only implementation for exp2f. (PR #233177)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sat Oct 17 20:46:47 PDT 2026


lntue wrote:

Code size comparison:

| Target | Implementation (`exp2f`) | `-O2` | `-O3` | `-Os` | `-Oz` | `.rodata` Table | Soft-FP Runtime |
| :--- | :--- | ---: | ---: | ---: | ---: | ---: | :--- |
| **`armv8m.main-none-eabi`** | **`integer_eval` (standalone)** | **342 B** | **346 B** | **342 B** | **336 B** | 88 B | **0 B** |
| *(Cortex-M33, 32-bit FPU)* | **`integer_eval` (shared table w/ `expf`)** | **254 B** | **258 B** | **254 B** | **248 B** | +0 B | **0 B** |
| | `float_eval` | 280 B | 300 B | 268 B | 312 B | 0 B | 0 B |
| **`armv7m-none-eabi`** | **`integer_eval` (standalone)** | **342 B** | **346 B** | **342 B** | **336 B** | 88 B | **0 B** |
| *(Cortex-M4, soft-float)* | **`integer_eval` (shared table w/ `expf`)** | **254 B** | **258 B** | **254 B** | **248 B** | +0 B | **0 B** |
| | `float_eval` | 418 B | 428 B | 404 B | 464 B | 0 B | +1,116–1,668 B |
| **`riscv32` (`rv32imafc`)** | **`integer_eval` (standalone)** | **412 B** | **412 B** | **402 B** | **404 B** | 88 B | **0 B** |
| *(32-bit FPU)* | **`integer_eval` (shared table w/ `expf`)** | **324 B** | **324 B** | **314 B** | **316 B** | +0 B | **0 B** |
| | `float_eval` | 352 B | 360 B | 344 B | 418 B | 0 B | 0 B |
| **`riscv32` (`rv32imac`)** | **`integer_eval` (standalone)** | **396 B** | **396 B** | **394 B** | **396 B** | 88 B | **0 B** |
| *(soft-float)* | **`integer_eval` (shared table w/ `expf`)** | **308 B** | **308 B** | **306 B** | **308 B** | +0 B | **0 B** |
| | `float_eval` | 566 B | 566 B | 566 B | 646 B | 0 B | +soft-FP runtime |

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


More information about the llvm-branch-commits mailing list