[libc-commits] [libc] [llvm] [libc][math][c23] Improve rsqrtf16 function for targets without fp32 FPUs. (PR #160639)

Anton Shepelev via libc-commits libc-commits at lists.llvm.org
Sat Jun 6 10:22:29 PDT 2026


amemov wrote:

### Code Size Diff

These are object-level size estimates from a tiny TU just calling `math::rsqrtf16`. These are not final linked binary sizes.  Decided to compare all the solutions that were introduced throughout my PR:

| Variant | Target | `.text` | `.rodata` | Total |
|---|---:|---:|---:|---:|
| Old float fallback ( commit `d80b51e`) | RV32 no-FPU | 2768 | 0 | 2768 |
| Integer pre-table fallback (commit `918e6ca`) | RV32 no-FPU | 1474 | 0 | 1474 |
| Current 16-entry table fallback | RV32 no-FPU | 1180 | 64 | 1244 |
| Current host/FPU path | x86_64 | 1921 | 76 | 1997 |
| Current forced fallback | x86_64 | 944 | 84 | 1028 |

Notes:
- RV32 current table fallback is about 55% smaller than the old float fallback.
- RV32 current table fallback is about 16% smaller than the pre-table integer fallback.
- The 16-entry lookup table contributes 64 bytes of read-only data.



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


More information about the libc-commits mailing list