[PATCH] Improves __ieee754_exp() performance by greater than 5x on sparc/x86.

Wilco Dijkstra Wilco.Dijkstra@arm.com
Fri Oct 20 13:38:00 GMT 2017


Patrick wrote:

        +      fe_val = __fegetround();

> Failing to use __fegetround(),__fesetround() causes over 40 math test
> accuracy failures for other rounding modes in exp, cexp, cpow, cosh,
> ccos, ccosh, csin, and csinh.  If the glibc/Linux community were to
> declare that the only rounding mode that was fully supported was
> FE_TONEAREST, we could simplify/speed up a lot of code. :-)

"Failure" is too unspecific. What is the difference in ULP? If it is from 
say 2 to 20 then yes that's an issue. If it is from 2 to 3 in a non-nearest
rounding mode then that's perfectly acceptable.

Anyway, never use __fegetround/__fesetround. Use get_rounding_mode
which is inlined on all targets and libc_fesetround which is inlined on most
targets.

Wilco




More information about the Libc-alpha mailing list