This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: [PATCH RFC] allow inline intrinsics for __ieee754_sqrt/f
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