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

Patrick McGehearty patrick.mcgehearty@oracle.com
Fri Oct 20 14:58:00 GMT 2017


On 10/20/2017 8:38 AM, Wilco Dijkstra wrote:
> 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
>
>
The ULP diffs were mostly in the 2 to 3 range for the complex functions.
There no gross errors.

I appreciate the pointer to get_rounding_mode and libc_fesetround.
I was not previously aware of those functions.
I will give those a try today.

- patrick



More information about the Libc-alpha mailing list