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


Hi Wilco,

>> This causes a problem for sqrtl when _LDBL_EQ_DBL is defined. The call to
>> sqrt is replaced with a sqrt instruction, so errno will not be set.
>
>Yes that's another example which needs to use -fno-builtin(-sqrt) in the
makefile.
>
>> I can't see many improvements in the code otherwise (there's a few
changes
>> in scheduling) - but perhaps that is target specific.
>
>It enables inlining of functions like lround, lrint and sqrt, and yes it
only helps targets
>which have inlines for those. 

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). 

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. 

But it seems it would affect quite a few other functions too, that are
occasionally used. Also, how do you specify per .c file options in an
Makefile.am. Seems tricky, for not much gain.

Cheers,
Jon



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