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 Wed, 27 Nov 2013, Rich Felker wrote:

> 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). Also, in

I've no idea about speed (we don't currently have sqrt benchmarks checked 
in), but setting precision is certainly simpler, and we have various 
existing functions that do so in order to work correctly (IBM libm 
functions that rely on 53-bit precision for their internal operations).  
The signal handlers issue is as discussed lately for AS-safety: as per 
C11, you shouldn't rely on any particular floating-point environment in a 
signal handler and so should do fegetenv (&old_env) / fesetenv 
(FE_DFL_ENV) / (rest of signal handler) / fesetenv (&old_env) if doing 
floating point in a signal handler.  Failure of FE_DFL_ENV to set rounding 
precision to extended is (part of) bug 16068.

-- 
Joseph S. Myers
joseph@codesourcery.com


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