This is the mail archive of the newlib@sourceware.org mailing list for the newlib 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: libm -fno-builtin


Jon Beniston wrote:
 
> After a quick look, I can't see any places where libm calls lround or lrint,
> other than for the long double implementations, so not sure it is beneficial
> in those cases. However, libm doesn't set errno in these functions anyway
> (perhaps it should though). 

It should since in newlib (math_errhandling & MATH_ERRNO) != 0.
lround is used by most of the new math functions in libm/common, hence the
use of -fno-math-errno.

> The code in libm/math calls __ieee754_sqrt rather than sqrt anyway. The only
> place it looks like sqrt is used is in csqrt.c, where the use of fabs on the
> argument should mean there aren't errors anyway. 

It should use sqrt really and -fno-math-errno so that the compiler will inline
sqrt as a single instruction on most targets. I did this in GLIBC a while back.

Wilco


    

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