diff mbox

[rs6000] Enable some existing __float128 tests for powerpc64*

Message ID 50a1d80a-98e3-d95b-17f0-01448c38167b@linux.vnet.ibm.com
State New
Headers show

Commit Message

Bill Schmidt June 29, 2016, 4:12 a.m. UTC
Hi,

As Uros pointed out, there are a number of existing tests for __float128 in
gcc.dg and gcc.dg/torture.  This patch enables an appropriate subset of those
tests for 64-bit PowerPC, BE and LE.  A few of the tests aren't appropriate
for our architecture, as Joseph stated.  Still, this gives us some additional
coverage (10 more tests).

Tested on powerpc64[le]-unknown-linux-gnu.  Is this ok for trunk, and eventual
backport to gcc-6-branch?

Thanks,
Bill


2016-06-29  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* gcc.dg/const-float128-ped.c: Enable for powerpc64*-*-*.
	* gcc.dg/const-float128.c: Likewise.
	* gcc.dg/torture/float128-cmp-invalid.c: Likewise.
	* gcc.dg/torture/float128-div-underflow.c: Likewise.
	* gcc.dg/torture/float128-exact-underflow.c: Enable for
	powerpc64*-*-*gnu*.
	* gcc.dg/torture/float128-extend-nan.c: Enable for
	powerpc64*-*-*.
	* gcc.dg/torture/float128-nan.c: Likewise.
	* gcc.dg/torture/fp-int-convert-float128-timode-2.c: Likewise.
	* gcc.dg/torture/fp-int-convert-float128-timode-3.c: Likewise.
	* gcc.dg/torture/fp-int-convert-float128-timode.c: Likewise.

Comments

Joseph Myers June 29, 2016, 4:37 p.m. UTC | #1
On Tue, 28 Jun 2016, Bill Schmidt wrote:

> -/* { dg-do compile { target ia64-*-* i?86-*-* x86_64-*-* } } */
> +/* { dg-do compile { target ia64-*-* i?86-*-* x86_64-*-* powerpc64*-*-* } } */
>  /* { dg-options "-pedantic" } */
> +/* { dg-additional-options "-mfloat128 -mvsx" { target powerpc64*-*-* } } */

Rather than duplicating powerpc64 references everywhere, wouldn't it be 
better to add an effective-target keyword __float128, meaning that 
__float128 is available?  Along with { dg-add-options float128 }.

Also: powerpc-* targets with -m64 should always be handled in tests 
identically to powerpc64 targets, while powerpc64 targets with -m32 should 
presumably not run these tests.  That is, testing for powerpc64*-*-* is 
actually (always, for any test, not just these ones) incorrect in both 
directions (just as it's always incorrect for a test to list just one of 
i?86-*-* and x86_64-*-*, rather than listing both and then adding any 
restrictions required to 32-bit or 64-bit).

> -/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */
> +/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* powerpc64*-*-* } } */
>  /* { dg-options "" } */
>  /* { dg-require-effective-target fenv_exceptions } */
> +/* { dg-additional-options "-mfloat128 -mvsx" { target powerpc64*-*-* } } */

Also: for execution tests, if you add extra options, you also need to 
restrict the test to running when the hardware actually supports the 
required features.
Bill Schmidt June 30, 2016, 3:06 p.m. UTC | #2
On Wed, 2016-06-29 at 16:37 +0000, Joseph Myers wrote:
> On Tue, 28 Jun 2016, Bill Schmidt wrote:
> 
> > -/* { dg-do compile { target ia64-*-* i?86-*-* x86_64-*-* } } */
> > +/* { dg-do compile { target ia64-*-* i?86-*-* x86_64-*-* powerpc64*-*-* } } */
> >  /* { dg-options "-pedantic" } */
> > +/* { dg-additional-options "-mfloat128 -mvsx" { target powerpc64*-*-* } } */
> 
> Rather than duplicating powerpc64 references everywhere, wouldn't it be 
> better to add an effective-target keyword __float128, meaning that 
> __float128 is available?  Along with { dg-add-options float128 }.

Sure, I can do that.  I guess I need to stay away from the name
check_effective_target_float128, though, as in your pending patch that
will mean availability of _Float128.  Do you have a naming preference?

> 
> Also: powerpc-* targets with -m64 should always be handled in tests 
> identically to powerpc64 targets, while powerpc64 targets with -m32 should 
> presumably not run these tests.  That is, testing for powerpc64*-*-* is 
> actually (always, for any test, not just these ones) incorrect in both 
> directions (just as it's always incorrect for a test to list just one of 
> i?86-*-* and x86_64-*-*, rather than listing both and then adding any 
> restrictions required to 32-bit or 64-bit).
> 
> > -/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */
> > +/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* powerpc64*-*-* } } */
> >  /* { dg-options "" } */
> >  /* { dg-require-effective-target fenv_exceptions } */
> > +/* { dg-additional-options "-mfloat128 -mvsx" { target powerpc64*-*-* } } */
> 
> Also: for execution tests, if you add extra options, you also need to 
> restrict the test to running when the hardware actually supports the 
> required features.
> 

All good points, will fix in next revision.

Thanks!
Bill
Joseph Myers June 30, 2016, 5:49 p.m. UTC | #3
On Thu, 30 Jun 2016, Bill Schmidt wrote:

> On Wed, 2016-06-29 at 16:37 +0000, Joseph Myers wrote:
> > On Tue, 28 Jun 2016, Bill Schmidt wrote:
> > 
> > > -/* { dg-do compile { target ia64-*-* i?86-*-* x86_64-*-* } } */
> > > +/* { dg-do compile { target ia64-*-* i?86-*-* x86_64-*-* powerpc64*-*-* } } */
> > >  /* { dg-options "-pedantic" } */
> > > +/* { dg-additional-options "-mfloat128 -mvsx" { target powerpc64*-*-* } } */
> > 
> > Rather than duplicating powerpc64 references everywhere, wouldn't it be 
> > better to add an effective-target keyword __float128, meaning that 
> > __float128 is available?  Along with { dg-add-options float128 }.
> 
> Sure, I can do that.  I guess I need to stay away from the name
> check_effective_target_float128, though, as in your pending patch that
> will mean availability of _Float128.  Do you have a naming preference?

My suggestion is check_effective_target___float128, so __float128 is the 
effective-target keyword.  (You don't need separate naming for the 
dg-add-options case, since the same options will work for both __float128 
and _Float128.)
diff mbox

Patch

Index: gcc/testsuite/gcc.dg/const-float128-ped.c
===================================================================
--- gcc/testsuite/gcc.dg/const-float128-ped.c	(revision 237802)
+++ gcc/testsuite/gcc.dg/const-float128-ped.c	(working copy)
@@ -1,5 +1,6 @@ 
 /* Test 'q' suffix with -pedantic on __float128 type constants.  */
-/* { dg-do compile { target ia64-*-* i?86-*-* x86_64-*-* } } */
+/* { dg-do compile { target ia64-*-* i?86-*-* x86_64-*-* powerpc64*-*-* } } */
 /* { dg-options "-pedantic" } */
+/* { dg-additional-options "-mfloat128 -mvsx" { target powerpc64*-*-* } } */
 
 __float128 a = 123.456789q; /* { dg-warning "non-standard suffix on floating constant" } */
Index: gcc/testsuite/gcc.dg/const-float128.c
===================================================================
--- gcc/testsuite/gcc.dg/const-float128.c	(revision 237802)
+++ gcc/testsuite/gcc.dg/const-float128.c	(working copy)
@@ -1,6 +1,7 @@ 
 /* Test 'q' and 'Q' suffixes on __float128 type constants.  */
-/* { dg-do compile { target ia64-*-* i?86-*-* x86_64-*-* } } */
+/* { dg-do compile { target ia64-*-* i?86-*-* x86_64-*-* powerpc64*-*-* } } */
 /* { dg-options "" } */
+/* { dg-additional-options "-mfloat128 -mvsx" { target powerpc64*-*-* } } */
 
 __float128 a = 123.456789q;
 __float128 b = 123.456789Q;
Index: gcc/testsuite/gcc.dg/torture/float128-cmp-invalid.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/float128-cmp-invalid.c	(revision 237802)
+++ gcc/testsuite/gcc.dg/torture/float128-cmp-invalid.c	(working copy)
@@ -1,7 +1,8 @@ 
 /* Test for "invalid" exceptions from __float128 comparisons.  */
-/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* powerpc64*-*-* } } */
 /* { dg-options "" } */
 /* { dg-require-effective-target fenv_exceptions } */
+/* { dg-additional-options "-mfloat128 -mvsx" { target powerpc64*-*-* } } */
 
 #include <fenv.h>
 #include <stdlib.h>
Index: gcc/testsuite/gcc.dg/torture/float128-div-underflow.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/float128-div-underflow.c	(revision 237802)
+++ gcc/testsuite/gcc.dg/torture/float128-div-underflow.c	(working copy)
@@ -1,7 +1,8 @@ 
 /* Test for spurious underflow from __float128 division.  */
-/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* powerpc64*-*-* } } */
 /* { dg-options "" } */
 /* { dg-require-effective-target fenv_exceptions } */
+/* { dg-additional-options "-mfloat128 -mvsx" { target powerpc64*-*-* } } */
 
 #include <fenv.h>
 #include <stdlib.h>
Index: gcc/testsuite/gcc.dg/torture/float128-exact-underflow.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/float128-exact-underflow.c	(revision 237802)
+++ gcc/testsuite/gcc.dg/torture/float128-exact-underflow.c	(working copy)
@@ -2,9 +2,10 @@ 
    exception if trapping is enabled, but does not raise the flag
    otherwise.  */
 
-/* { dg-do run { target i?86-*-*gnu* x86_64-*-*gnu* ia64-*-*gnu* } } */
+/* { dg-do run { target i?86-*-*gnu* x86_64-*-*gnu* ia64-*-*gnu* powerpc64*-*-*gnu* } } */
 /* { dg-options "-D_GNU_SOURCE" } */
 /* { dg-require-effective-target fenv_exceptions } */
+/* { dg-additional-options "-mfloat128 -mvsx" { target powerpc64*-*-* } } */
 
 #include <fenv.h>
 #include <setjmp.h>
Index: gcc/testsuite/gcc.dg/torture/float128-extend-nan.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/float128-extend-nan.c	(revision 237802)
+++ gcc/testsuite/gcc.dg/torture/float128-extend-nan.c	(working copy)
@@ -1,7 +1,8 @@ 
 /* Test extensions to __float128 quiet signaling NaNs.  */
-/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* powerpc64*-*-* } } */
 /* { dg-options "-fsignaling-nans" } */
 /* { dg-require-effective-target fenv_exceptions } */
+/* { dg-additional-options "-mfloat128 -mvsx" { target powerpc64*-*-* } } */
 
 #include <fenv.h>
 #include <float.h>
Index: gcc/testsuite/gcc.dg/torture/float128-nan.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/float128-nan.c	(revision 237802)
+++ gcc/testsuite/gcc.dg/torture/float128-nan.c	(working copy)
@@ -1,7 +1,8 @@ 
 /* Test __float128 NaN generation.  */
-/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* powerpc64*-*-* } } */
 /* { dg-require-effective-target fenv_exceptions } */
 /* { dg-options "" } */
+/* { dg-additional-options "-mfloat128 -mvsx" { target powerpc64*-*-* } } */
 
 #include <fenv.h>
 #include <stdbool.h>
Index: gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode-2.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode-2.c	(revision 237802)
+++ gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode-2.c	(working copy)
@@ -1,9 +1,10 @@ 
 /* Test floating-point conversions.  __float128 type with TImode: bug
    53317.  */
 /* Origin: Joseph Myers <joseph@codesourcery.com> */
-/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* powerpc64*-*-* } } */
 /* { dg-require-effective-target int128 } */
 /* { dg-options "" } */
+/* { dg-additional-options "-mfloat128 -mvsx" { target powerpc64*-*-* } } */
 
 extern void abort (void);
 extern void exit (int);
Index: gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode-3.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode-3.c	(revision 237802)
+++ gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode-3.c	(working copy)
@@ -1,8 +1,9 @@ 
 /* Test for correct rounding of conversions from __int128 to
    __float128.  */
-/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* powerpc64*-*-* } } */
 /* { dg-require-effective-target int128 } */
 /* { dg-options "-frounding-math" } */
+/* { dg-additional-options "-mfloat128 -mvsx" { target powerpc64*-*-* } } */
 
 #include <fenv.h>
 #include <stdlib.h>
Index: gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode.c	(revision 237802)
+++ gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode.c	(working copy)
@@ -1,7 +1,8 @@ 
 /* Test floating-point conversions.  __float128 type with TImode.  */
 /* Origin: Joseph Myers <joseph@codesourcery.com> */
-/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* powerpc64*-*-* } } */
 /* { dg-options "" } */
+/* { dg-additional-options "-mfloat128 -mvsx" { target powerpc64*-*-* } } */
 
 #include "fp-int-convert.h"