This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCHv3, testsuite] Enable some existing __float128 tests for powerpc


Hi,

This changes my previous patch to use a separate base_quadfloat_support
effective target that can be used in conjunction with either the float128
or __float128 effective targets, and modifies the tests accordingly.
I dropped adding support for float128-exact-underflow.c for now; that can
be addressed later if desired.

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

Thanks,
Bill


2016-07-01  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* gcc.dg/const-float128-ped.c: Require __float128 effective
	target, and specify additional options for powerpc*-*-*.
	* gcc.dg/const-float128.c: Likewise.
	* gcc.dg/torture/float128-cmp-invalid.c: Require
	__float128 and base_quadfloat_support effective targets, and
	specify additional options for powerpc*-*-*.
	* gcc.dg/torture/float128-div-underflow.c: Likewise.
	* gcc.dg/torture/float128-extend-nan.c: Require
	__float128 and base-quadfloat_support effective targets, and
	specify additional options for powerpc*-*-*.
	* 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.
	* lib/target-supports.exp (check_effective_target___float128):
	New.
	(check_effective_target_base_quadword_support): New.


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,7 @@
 /* Test 'q' suffix with -pedantic on __float128 type constants.  */
-/* { dg-do compile { target ia64-*-* i?86-*-* x86_64-*-* } } */
+/* { dg-do compile } */
+/* { dg-require-effective-target __float128 } */
 /* { dg-options "-pedantic" } */
+/* { dg-additional-options "-mfloat128 -mvsx" { target powerpc*-*-* } } */
 
 __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,8 @@
 /* Test 'q' and 'Q' suffixes on __float128 type constants.  */
-/* { dg-do compile { target ia64-*-* i?86-*-* x86_64-*-* } } */
+/* { dg-do compile } */
+/* { dg-require-effective-target __float128 } */
 /* { dg-options "" } */
+/* { dg-additional-options "-mfloat128 -mvsx" { target powerpc*-*-* } } */
 
 __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,10 @@
 /* Test for "invalid" exceptions from __float128 comparisons.  */
-/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-do run } */
 /* { dg-options "" } */
+/* { dg-require-effective-target __float128 } */
+/* { dg-require-effective-target base_quadfloat_support } */
 /* { dg-require-effective-target fenv_exceptions } */
+/* { dg-additional-options "-mfloat128 -mvsx" { target powerpc*-*-* } } */
 
 #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,10 @@
 /* Test for spurious underflow from __float128 division.  */
-/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-do run } */
 /* { dg-options "" } */
+/* { dg-require-effective-target __float128 } */
+/* { dg-require-effective-target base_quadfloat_support } */
 /* { dg-require-effective-target fenv_exceptions } */
+/* { dg-additional-options "-mfloat128 -mvsx" { target powerpc*-*-* } } */
 
 #include <fenv.h>
 #include <stdlib.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,10 @@
 /* Test extensions to __float128 quiet signaling NaNs.  */
-/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-do run } */
 /* { dg-options "-fsignaling-nans" } */
+/* { dg-require-effective-target __float128 } */
+/* { dg-require-effective-target base_quadfloat_support } */
 /* { dg-require-effective-target fenv_exceptions } */
+/* { dg-additional-options "-mfloat128 -mvsx" { target powerpc*-*-* } } */
 
 #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,10 @@
 /* Test __float128 NaN generation.  */
-/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-do run } */
 /* { dg-require-effective-target fenv_exceptions } */
+/* { dg-require-effective-target __float128 } */
+/* { dg-require-effective-target base_quadfloat_support } */
 /* { dg-options "" } */
+/* { dg-additional-options "-mfloat128 -mvsx" { target powerpc*-*-* } } */
 
 #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,12 @@
 /* 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 } */
+/* { dg-require-effective-target __float128 } */
+/* { dg-require-effective-target base_quadfloat_support } */
 /* { dg-require-effective-target int128 } */
 /* { dg-options "" } */
+/* { dg-additional-options "-mfloat128 -mvsx" { target powerpc*-*-* } } */
 
 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,11 @@
 /* Test for correct rounding of conversions from __int128 to
    __float128.  */
-/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-do run } */
+/* { dg-require-effective-target __float128 } */
+/* { dg-require-effective-target base_quadfloat_support } */
 /* { dg-require-effective-target int128 } */
 /* { dg-options "-frounding-math" } */
+/* { dg-additional-options "-mfloat128 -mvsx" { target powerpc*-*-* } } */
 
 #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,10 @@
 /* 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 } */
+/* { dg-require-effective-target __float128 } */
+/* { dg-require-effective-target base_quadfloat_support } */
 /* { dg-options "" } */
+/* { dg-additional-options "-mfloat128 -mvsx" { target powerpc*-*-* } } */
 
 #include "fp-int-convert.h"
 
Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp	(revision 237802)
+++ gcc/testsuite/lib/target-supports.exp	(working copy)
@@ -2370,6 +2370,33 @@ proc check_effective_target_has_q_floating_suffix
 	float dummy = 1.0q;
     } "$opts"]
 }
+
+# Return 1 if the target supports __float128,
+# 0 otherwise.
+
+proc check_effective_target___float128 { } {
+    if { [istarget powerpc*-*-*] } {
+	return [check_ppc_float128_sw_available]
+    }
+    if { [istarget ia64-*-*]
+	 || [istarget i?86-*-*]
+	 || [istarget x86_64-*-*] } {
+	return 1
+    }
+    return 0
+}
+
+# Return 1 if the target supports any special run-time requirements
+# for __float128 or _Float128,
+# 0 otherwise.
+
+proc check_effective_target_base_quadfloat_support { } {
+    if { [istarget powerpc*-*-*] } {
+	return [check_vsx_hw_available]
+    }
+    return 1
+}
+
 # Return 1 if the target supports compiling fixed-point,
 # 0 otherwise.
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]