For normal numbers there is no need to issue scalbn, the fma can set
the exponend directly. Performance-wise on x86_64-linux-gnu without
multi-arch it shows a latency improvement of ~5% and throughput of %7
(and sligth more for ABIs witht tail-call optimization).
Checked on x86_64-linux-gnu and i686-linux-gnu with --disable-multi-arch.
Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
i = -i;
double r = convertfromint64 (i); /* |r| is in [0x1p62,0x1p63] */
- if (e < -1022 - 62)
+ if (__glibc_likely (e >= -1084 && e <= 960))
+ /* Fast-path for normal numbers. */
+ return asdouble (asuint64 (r) + ((int64_t) e << MANTISSA_WIDTH));
+ else if (e < -1022 - 62)
{
/* Result is subnormal before rounding. */
if (e == -1022 - 63)