On Wed, Aug 30, 2017 at 01:11:51AM +0200, Jakub Jelinek wrote:
> On Tue, Aug 15, 2017 at 11:06:01PM -0400, Michael Meissner wrote:
> > 2017-08-15  Michael Meissner  <meiss...@linux.vnet.ibm.com>
> > 
> >     PR libquadmath/81848
> >     * configure.ac (powerpc*-linux*): Use attribute mode KC to create
> >     complex __float128 on PowerPC instead of attribute mode TC.
> >     * quadmth.h (__complex128): Likewise.
> 
> quadmath.h ?

Yes, thanks.

> >     * configure: Regenerate.
> >     * math/cbrtq.c (CBRT2): Use __float128 not long double.
> >     (CBRT4): Likewise.
> >     (CBRT2I): Likewise.
> >     (CBRT4I): Likewise.
> >     * math/j0q.c (U0): Likewise.
> >     * math/sqrtq.c (sqrtq): Don't depend on implicit conversion
> >     between __float128, instead explicitly convert the __float128
> >     value to long double because the PowerPC does not allow __float128
> >     and long double in the same expression.
> 
> Does the Q suffix on ppc* imply __float128 like on x86_64 etc.?

Yes.

> > --- libquadmath/math/sqrtq.c        (revision 251097)
> > +++ libquadmath/math/sqrtq.c        (working copy)
> > @@ -31,15 +31,18 @@ sqrtq (const __float128 x)
> >      return y;
> >    }
> >  
> > -#ifdef HAVE_SQRTL
> > -  if (x <= LDBL_MAX && x >= LDBL_MIN)
> > +#if defined(HAVE_SQRTL)
> 
> Why the #ifdef -> #if defined change?  That looks unnecessary.

I'll change it back.

> >    {
> > -    /* Use long double result as starting point.  */
> > -    y = sqrtl ((long double) x);
> > +    long double xl = (long double)x;
> 
> Please add a space after (long double)

Ok.

> > +    if (xl <= LDBL_MAX && xl >= LDBL_MIN)
> > +      {
> > +   /* Use long double result as starting point.  */
> > +   y = sqrtl (xl);
> >  
> > -    /* One Newton iteration.  */
> > -    y -= 0.5q * (y - x / y);
> > -    return y;
> > +   /* One Newton iteration.  */
> > +   y -= 0.5q * (y - x / y);
> > +   return y;
> > +      }
> >    }
> >  #endif
> >  
> 
> Otherwise LGTM.

Thanks.

-- 
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: meiss...@linux.vnet.ibm.com, phone: +1 (978) 899-4797

Reply via email to