This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: libm -fno-builtin
- From: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- To: Jon Beniston <jon at beniston dot com>, "freddie_chopin at op dot pl" <freddie_chopin at op dot pl>
- Cc: nd <nd at arm dot com>, "newlib at sourceware dot org" <newlib at sourceware dot org>
- Date: Thu, 21 Jun 2018 21:56:32 +0000
- Subject: Re: libm -fno-builtin
- Nodisclaimer: True
- References: <DB5PR08MB1030884D639F27B0A877D88B83760@DB5PR08MB1030.eurprd08.prod.outlook.com>,<012701d4097e$df983310$9ec89930$@beniston.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
Jon Beniston wrote:
> 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. Compilers can also do more optimization since math
functions become pure if errno is no longer assumed to be live after each call.
I've got a patch in review to change the default behaviour of GCC, so fixing any failing
cases now is good future proofing.
Wilco