public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Michael Meissner <meissner@linux.ibm.com>
To: Michael Meissner <meissner@linux.ibm.com>,
	gcc-patches@gcc.gnu.org,
	Segher Boessenkool <segher@kernel.crashing.org>,
	David Edelsohn <dje.gcc@gmail.com>,
	Bill Schmidt <wschmidt@linux.ibm.com>,
	Peter Bergner <bergner@linux.ibm.com>
Subject: [PATCH 2/3] PowerPC: require IBM long double for pr70117.
Date: Sat, 21 Nov 2020 00:37:10 -0500	[thread overview]
Message-ID: <20201121053710.GD17995@ibm-toto.the-meissners.org> (raw)
In-Reply-To: <20201121052230.GA15702@ibm-toto.the-meissners.org>

PowerPC: require IBM long double for pr70117.

Since the test is explicitly checking for IBM extended double, do not try to
run it when long double is IEEE 128-bit.

I have tested this patch and the first patch in the series on a little endian
power9 system with 3 compilers that have the 3 different long double types
configured.  I verified that this test is listed as unsupported if long double
is not IBM 128-bit, and it passes if long double is IBM 128-bit.

Can I check this patch into the master branch?  After an appropriate soak-in
time, can I back port this patch to the previous open GCC trees?

gcc/testsuite/
2020-11-21  Michael Meissner  <meissner@linux.ibm.com>

	PR target/70117
	* gcc.target/powerpc/pr70117.c: Only run the test if long double
	uses the IBM extended double format.
---
 gcc/testsuite/gcc.target/powerpc/pr70117.c | 22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)

diff --git a/gcc/testsuite/gcc.target/powerpc/pr70117.c b/gcc/testsuite/gcc.target/powerpc/pr70117.c
index 3bbd2c595e0..2077d15afd4 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr70117.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr70117.c
@@ -1,26 +1,12 @@
-/* { dg-do run { target { powerpc*-*-linux* powerpc*-*-darwin* powerpc*-*-aix* rs6000-*-* } } } */
-/* { dg-options "-std=c99 -mlong-double-128 -O2" } */
+/* { dg-require-effective-target ppc_long_double_ibm } */
+/* { dg-options "-std=c99 -O2" } */
 
 #include <float.h>
 
-#if defined(__LONG_DOUBLE_IEEE128__)
-/* If long double is IEEE 128-bit, we need to use the __ibm128 type instead of
-   long double.  We can't use __ibm128 on systems that don't support IEEE
-   128-bit floating point, because the type is not enabled on those
-   systems.  */
-#define LDOUBLE __ibm128
-
-#elif defined(__LONG_DOUBLE_IBM128__)
-#define LDOUBLE long double
-
-#else
-#error "long double must be either IBM 128-bit or IEEE 128-bit"
-#endif
-
 union gl_long_double_union
 {
   struct { double hi; double lo; } dd;
-  LDOUBLE ld;
+  long double ld;
 };
 
 /* This is gnulib's LDBL_MAX which, being 107 bits in precision, is
@@ -36,7 +22,7 @@ volatile double dnan = 0.0/0.0;
 int
 main (void)
 {
-  LDOUBLE ld;
+  long double ld;
 
   ld = gl_LDBL_MAX.ld;
   if (__builtin_isinf (ld))
-- 
2.22.0


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

  parent reply	other threads:[~2020-11-21  5:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-21  5:22 [PATH 0/3] Updated PowerPC tests for long double Michael Meissner
2020-11-21  5:33 ` [PATCH 1/3] PowerPC: Add long double target-supports Michael Meissner
2020-11-23 20:28   ` Segher Boessenkool
2020-11-24 21:44     ` Michael Meissner
2020-11-24 23:49       ` Segher Boessenkool
2020-11-21  5:37 ` Michael Meissner [this message]
2020-11-21 15:46   ` [PATCH 2/3] PowerPC: require IBM long double for pr70117 David Edelsohn
2020-11-22  6:31     ` Michael Meissner
2020-11-23 20:55   ` Segher Boessenkool
2020-11-21  5:39 ` [PATCH 3/3] PowerPC: Require IBM long double for conversion test Michael Meissner
2020-11-23 21:23   ` Segher Boessenkool
2020-12-04  3:41 [PATCH 0/3] Updates for float128 tests Michael Meissner
2020-12-04  3:57 ` [PATCH 2/3] PowerPC: require IBM long double for pr70117 Michael Meissner
2020-12-14 23:26   ` Segher Boessenkool
2020-12-17 18: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=20201121053710.GD17995@ibm-toto.the-meissners.org \
    --to=meissner@linux.ibm.com \
    --cc=bergner@linux.ibm.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=segher@kernel.crashing.org \
    --cc=wschmidt@linux.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).