math: Improve fmod(f) performance
commit76d0f094dd177e303b36d7b77e21673f244a4b53
authorWilco Dijkstra <wilco.dijkstra@arm.com>
Mon, 17 Apr 2023 11:42:18 +0000 (17 12:42 +0100)
committerWilco Dijkstra <wilco.dijkstra@arm.com>
Mon, 17 Apr 2023 12:03:10 +0000 (17 13:03 +0100)
treeb8cfddb70177f13d48445665b40d0bca62a51878
parent2623479105a7e11ccd1e504b3f549cadbb875a42
math: Improve fmod(f) performance

Optimize the fast paths (x < y) and (x/y < 2^12).  Delay handling of special
cases to reduce the number of instructions executed before the fast paths.
Performance improvements for fmod:

Skylake Zen2 Neoverse V1
subnormals 11.8% 4.2% 11.5%
normal 3.9% 0.01% -0.5%
close-exponents 6.3% 5.6% 19.4%

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
sysdeps/ieee754/dbl-64/e_fmod.c
sysdeps/ieee754/flt-32/e_fmodf.c