This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [PATCH] PPC64 Use hardware sqrt.
- From: Steve Munroe <sjmunroe at us dot ibm dot com>
- To: libc-alpha at sources dot redhat dot com
- Cc: dgm69 at us dot ibm dot com, janis187 at us dot ibm dot com
- Date: Tue, 11 May 2004 21:12:01 -0500
- Subject: Re: [PATCH] PPC64 Use hardware sqrt.
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