public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Michael Meissner <meissner@linux.vnet.ibm.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>,
	       Segher Boessenkool <segher@kernel.crashing.org>,
	       David Edelsohn <dje.gcc@gmail.com>,
	       Bill Schmidt <wschmidt@linux.vnet.ibm.com>,
	       Tobias Burnus <burnus@net-b.de>,
	Jakub Jelinek <jakub@redhat.com>,
	       Joseph Myers <joseph@codesourcery.com>
Subject: [PATCH] libquadmath/81848, allow PowerPC to enable libquadmath
Date: Wed, 16 Aug 2017 03:28:00 -0000	[thread overview]
Message-ID: <20170816000632.GA8862@ibm-tiger.the-meissners.org> (raw)
Message-ID: <20170816032800.xXDuUV3QWfUI4RegeFfnLDNXL426YH8FSmNdBzmFFBg@z> (raw)

I'm working on some changes to finally make __float128 default for PowerPC VSX
targets (power7..power9).  I am reworking my PowerPC changes, but in using a
previous version of my code, I needed to do some minor tweaks to allow
libquadmath to build on PowerPC when __float128 becomes on by default.

I have checked this out by doing bootstrap builds and make check for C, C++,
and Fortran on both a little endian power8 system and an x86_64 system.  Both
systems bootstrapped fine, and there were no regressions.  Can I install these
changes in the trunk?

As I mention in the PR, there are two main changes:

1) Know how to create complex float128 on PowerPC's.  This is different from
Intel because the PowerPC already had a TF/TCmode for the IBM long double
format, and so we use KF/KCmode for the IEEE 128-bit floating point type if the
long double type is IBM long double.

2) There were a few places where long double was used instead of __float128.  I
fixed these cases, either by changing the type of the constant, or by modifying
the code to do an explicit conversion.

This is due to the fact that we do not allow expressions to have both IBM long
double and __float128 in the expression.  This in turn is caused by GCC not
expecting there to be more than one floating point type for a given size, and
due to having the existing IBM long double format, we have two different
128-bit floating point types.

Another factor is if you have IBM long double and __float128 in an expression,
should the resultant type be IBM long double or __float128.  On the power7 and
power8 systems, you would want long double, because the long double code is
faster than the emulation of IEEE 128-bit floating point.  However on the
power9 systems, since there is hardware support for IEEE 128-bit floating
point, you would want that.

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

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

             reply	other threads:[~2017-08-16  1:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-16  1:53 Michael Meissner [this message]
2017-08-16  3:28 ` Michael Meissner
2017-08-16  9:22 ` Joseph Myers
2017-08-16  9:31   ` Michael Meissner
2017-08-23 18:28     ` Ping " Michael Meissner
2017-08-30  8:24     ` Jakub Jelinek
2017-09-01 20:18       ` Michael Meissner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170816000632.GA8862@ibm-tiger.the-meissners.org \
    --to=meissner@linux.vnet.ibm.com \
    --cc=burnus@net-b.de \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=segher@kernel.crashing.org \
    --cc=wschmidt@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).