[libc-commits] [libc] [libc][math] Speed up log2f subnormals and log10f table access (PR #223718)

via libc-commits libc-commits at lists.llvm.org
Tue Sep 29 12:54:55 PDT 2026


================
@@ -91,7 +92,13 @@ LIBC_INLINE float log2f(float x) {
       return x;
     }
     // Normalize denormal inputs.
-    xbits = FPBits(xbits.get_val() * 0x1.0p23f);
+    int biased_exponent = 32 - cpp::countl_zero(x_u);
----------------
lntue wrote:

Let me try to get it tested on my Zen3 machine and I'll post the results here tomorrow.

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


More information about the libc-commits mailing list