[PATCH] PPC64 Use hardware sqrt.
Steve Munroe
sjmunroe@us.ibm.com
Wed May 12 02:23:00 GMT 2004
Richard Henderson wrote on 05/01/2004 12:28:06 PM:
> On Thu, Apr 29, 2004 at 11:16:18AM -0500, Steve Munroe wrote:
> > * sysdeps/powerpc/powerpc64/fpu/w_sqrt.S: New file.
> > * sysdeps/powerpc/powerpc64/fpu/w_sqrtf.S: New file.
>
> You're supposed to override __ieee754_sqrt in e_sqrt.S.
>
I need an answer to this question to a correct solution ... sqrt is just
the first math function we are looking at.
This is a bit complicated... currently powerpc combines the wrapper and
implementation in to one file w_sqrt.c. (e_sqrt.c is empty). The POWERPC
fsqrt instruction seems to be a correct implementation for ieee754 (i.e
it handles all input case (Nan, Inf, and negative values) and gives
appropriate results) except for calling __kernel_standard(x,x,26)
for the negative case. So the wrapper (generic/w_sqrt.c) is mostly
redundant.
Splitting the code back out into "wrapper" and "implementation" would
add significant overhead. For example using the generic/w_sqrt.S and
replacing the e_sqrt implementation with a single fsqrt instruction (and
return branch), the wrapper would more then double the path!
I noticed that IA64 w_sqrt.S is an empty implementation and all the code is
in e_sqrt. Is this an more "legitimate" then powerpc putting all the code
in w_sqrt and having an empty e_sqrt?
Steven J. Munroe
Linux on Power Toolchain Architect
IBM Corporation, Linux Technology Center
More information about the Libc-alpha
mailing list