This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] libquadmath/81848, allow PowerPC to enable libquadmath
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Michael Meissner <meissner at linux dot vnet dot ibm dot com>, Joseph Myers <joseph at codesourcery dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Segher Boessenkool <segher at kernel dot crashing dot org>, David Edelsohn <dje dot gcc at gmail dot com>, Bill Schmidt <wschmidt at linux dot vnet dot ibm dot com>, Tobias Burnus <burnus at net-b dot de>
- Date: Wed, 30 Aug 2017 01:11:51 +0200
- Subject: Re: [PATCH] libquadmath/81848, allow PowerPC to enable libquadmath
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jakub at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7893F4E33E
- References: <20170816000632.GA8862@ibm-tiger.the-meissners.org> <alpine.DEB.2.20.1708160146050.19980@digraph.polyomino.org.uk> <20170816030601.GA18844@ibm-tiger.the-meissners.org>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Aug 15, 2017 at 11:06:01PM -0400, Michael Meissner wrote:
> 2017-08-15 Michael Meissner <meissner@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 ?
> * 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.?
> --- 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.
> {
> - /* 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)
> + 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.
Jakub