Re: [PATCH RFC] allow inline intrinsics for __ieee754_sqrt/f

Wilco Dijkstra <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <DB5PR08MB1030F5010736D58437793C28830C0@DB5PR08MB1030.eurprd08.prod.outlook.com>
Hi Jon,

> I was referring to your suggestion that all calls throughout libm to
> __ieee754_sqrt() should be replaced with calls to sqrt() as you think gcc
> can optimise it. While this may work for targets with a h/w sqrt
> instruction, this will be slower for targets that do not have a sqrt
> instruction, as you'll end up with the extra overhead and error handling
> code in w_sqrt.c being executed, no? 

Right - I thought your main concern was inlining sqrt instructions since they
are currently not inlined. It wouldn't be slower for targets without sqrt since
removing all calls to __ieee754_sqrt means you can now merge w_sqrt.c
and e_sqrt.c.

Both implementations have a check for < 0, and you only need one now. 
All the complex errno handling could be simplified too, check how trivial it
is in the new math code, eg. common/sinf.c.

Wilco
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.