This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix x86 sqrt rounding (bug 14032)


On 11/28/2013 12:23 PM, Rich Felker wrote:
>> Surely this is much more complex than simply setting the rounding precision to
>> double before using fsqrt.
> 
> Setting the rounding precision is likely to be much slower, and has
> issues with signals (signal handlers could be invoked with wrong
> rounding precision, resulting in completely wrong results).

I thought signal handlers always have this problem; if the user expects
to be able to use any floating point from a signal handler one must always set
a complete floating point environment.  E.g. the program could be in the middle
of an integer conversion and have set round-to-zero.

As for slowness, I believe that all pentium4 and later support quick changes
between two different control values, if those values only differ in bits 8-12
(precision, rounding, infinity).

I guess we ought to be able to benchmark the two different schemes...


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]