This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [PATCH] PPC faster sqrt functions
- From: Steve Munroe <sjmunroe at us dot ibm dot com>
- To: Ulrich Drepper <drepper at redhat dot com>
- Cc: libc-alpha at sources dot redhat dot com
- Date: Tue, 25 May 2004 13:13:42 -0500
- Subject: Re: [PATCH] PPC faster sqrt functions
libc-alpha-owner@sources.redhat.com wrote on 05/25/2004 11:48:40 AM:
>
> > +/* The method is based on a description in
> > + Computation of elementary functions on the IBM RISC
> System/6000 processor,
> > + P. W. Markstein, IBM J. Res. Develop, 34(1) 1990.
> > + Basically, it consists of two interleaved Newton-Rhapson
approximations,
> > + one to find the actual square root, and one to find its reciprocal
> > + without the expense of a division operation. The tricky bit here
> > + is the use of the POWER/PowerPC multiply-add operation to get the
> > + required accuracy with high speed.
> > +
> > + ...
>
> What's all that crap? There is already a generic implementation and
> this must be used. If the generic implementation can be improved this
> is another thing but nothing of any concern here.
>
This is nothing new. This implementation has been in place for over 4 year
(as far back as cvsweb goes).
This is just the implementation from w_sqrt.c copied to e_sqrt.c because I
was told to: http://sources.redhat.com/ml/libc-alpha/2004-05/msg00004.html
Other architecture override e_sqrt so I don't understand why PPC should be
forced to use the generic e_sqrt implementation. This implementation,
while not as fast as the fsqrt instruction available on PPC64, is faster
than the generic implementation because it can take advantage of the
hardware multiply-add instructions and multiple independent pipelines of
PPC.
If other architectures have hardware multiply-add instructions and wish to
leverage this implementation they can do so by #include.
Steven J. Munroe
Linux on Power Toolchain Architect
IBM Corporation, Linux Technology Center