diff mbox series

[2/3] PowerPC: require IBM long double for pr70117.

Message ID 20201121053710.GD17995@ibm-toto.the-meissners.org
State New
Headers show
Series Updated PowerPC tests for long double | expand

Commit Message

Michael Meissner Nov. 21, 2020, 5:37 a.m. UTC
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(-)

Comments

David Edelsohn Nov. 21, 2020, 3:46 p.m. UTC | #1
On Sat, Nov 21, 2020 at 12:37 AM Michael Meissner
<meissner@linux.ibm.com> wrote:
>
> 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" } */

Mike,

You still need a

/* { dg-do run } */

line.  But without any target specified.

Segher may have other comments.

Thanks, David
Michael Meissner Nov. 22, 2020, 6:31 a.m. UTC | #2
On Sat, Nov 21, 2020 at 10:46:45AM -0500, David Edelsohn wrote:
> On Sat, Nov 21, 2020 at 12:37 AM Michael Meissner
> <meissner@linux.ibm.com> wrote:
> >
> > 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" } */
> 
> Mike,
> 
> You still need a
> 
> /* { dg-do run } */
> 
> line.  But without any target specified.
> 
> Segher may have other comments.
> 
> Thanks, David

Thanks.
Segher Boessenkool Nov. 23, 2020, 8:55 p.m. UTC | #3
Hi!

On Sat, Nov 21, 2020 at 12:37:10AM -0500, Michael Meissner wrote:
> Since the test is explicitly checking for IBM extended double, do not try to
> run it when long double is IEEE 128-bit.

Before your change, it would explicitly use __ibm128 if that is not the
same as long double.

You need a better explanation / justification for the patch.

What goes wrong without the patch?  Is that to be expected?  Etc.

You get less coverage than before after this patch (it will now only run
on systems that have double-double as long double).


Segher
diff mbox series

Patch

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))