This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]