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.


Steven J. Munroe
Linux on Power Toolchain Architect
IBM Corporation, Linux Technology Center


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.
> 

This is a bit complicated... currently powerpc combines the wrapper and 
implementation in to one file w_sqrt.S. 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 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?

Finally for powerpc32 I can't assume that the fsqrt instruction is 
implemented. Currently it is implemented on ALL PPC64 hardware. So I would 
like to use the AT_HWCAP to detect this and conditionally use fsqrt. 
Looking at i386/fpu/fesetround I see that dl_hwcap is used to check for 
SSE.

        if ((GLRO(dl_hwcap) & HWCAP_I386_XMM) != 0)

But when I try something similar on powerpc I get:

../sysdeps/powerpc/fpu/w_sqrtf.c:37: undefined reference to 
`_rtld_global_ro'

So I am missing something that allows libm to access _rtld_global_ro and 
would appreciate any clues how to resolve.


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