]> git.ipfire.org Git - thirdparty/glibc.git/commit
math: Optimize frexpl (intel96) with fast path for normal numbers
authorOsama Abdelkader <osama.abdelkader@gmail.com>
Mon, 10 Nov 2025 20:17:07 +0000 (20:17 +0000)
committerWilco Dijkstra <wilco.dijkstra@arm.com>
Fri, 14 Nov 2025 19:52:38 +0000 (19:52 +0000)
commit4f18501498e8fe7eca8d4adaeabb108ae62972cd
tree5f881c775f5d0805cc8330345e23a6d8e9f8f853
parent7fec8a5de6826ef9ae440238d698f0fe5a5fb372
math: Optimize frexpl (intel96) with fast path for normal numbers

Add fast path optimization for frexpl (80-bit x87 extended precision) using
a single unsigned comparison to identify normal floating-point numbers and
return immediately via arithmetic on the exponent field.

The implementation uses arithmetic operations (se - ex ) to
adjust the exponent directly, which is simpler than bit masking. For subnormals,
the traditional multiply-based normalization is retained as it handles the
split word format more reliably.

The zero/infinity/NaN check groups these special cases together for better
branch prediction.

Benchmark results on Intel Core i9-13900H (13th Gen):
  Baseline:     25.543 ns/op
  Optimized:    25.531 ns/op
  Speedup:      1.00x (neutral)
  Zero:         17.774 ns/op
  Denormal:     23.900 ns/op

Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
sysdeps/ieee754/ldbl-96/s_frexpl.c