libm -fno-builtin

Wilco Dijkstra Wilco.Dijkstra@arm.com
Fri Jun 22 14:12:00 GMT 2018


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


    


More information about the Newlib mailing list