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]

[testsuite] skip DFP rounding/fp exception tests for hardware DFP


The runtime emulated support for DPD decimal floating point arithmetic
includes undocumented support for rounding modes and floating-point
exceptions which were added for testing purposes.  That support doesn't
work for hardware DFP support.  Skip those tests if they are being
compiled to run on a system that has hardware DFP support.

Tested on powerpc64-linux with -m32 and -m64 on a POWER6 system with
both -mcpu=power6 (skipped) and -mcpu=power5 (not skipped), and on
i686-pc-linux-gnu.  Checked in on mainline and the 4.3 branch.

2008-12-05  Janis Johnson  <janis187@us.ibm.com>

	* lib/target-supports.exp (check_effective_target_hard_dfp): New.
	* gcc.dg/dfp/convert-dfp-round.c: Skip for hard_dfp.
	* gcc.dg/dfp/fe-binop.c: Ditto.
	* gcc.dg/dfp/fe-convert-1.c: Ditto.

Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp	(revision 142454)
+++ gcc/testsuite/lib/target-supports.exp	(working copy)
@@ -2656,3 +2656,12 @@
 	}
     } "-lm" ]
 }
+
+# Return 1 if current options generate DFP instructions, 0 otherwise.
+
+proc check_effective_target_hard_dfp {} {
+    return [check_no_messages_and_pattern hard_dfp "!adddd3" assembly {
+	_Decimal64 x, y, z;
+	void foo (void) { z = x + y; }
+    }]
+}
Index: gcc/testsuite/gcc.dg/dfp/convert-dfp-round.c
===================================================================
--- gcc/testsuite/gcc.dg/dfp/convert-dfp-round.c	(revision 142454)
+++ gcc/testsuite/gcc.dg/dfp/convert-dfp-round.c	(working copy)
@@ -1,4 +1,5 @@
 /* { dg-options "-O0 -std=gnu99" } */
+/* { dg-skip-if "test is for emulation" { hard_dfp } { "*" } { "" } } */
 
 /* N1150 5.2: Conversions among decimal floating types and between
    decimal floating types and generic floating types.
Index: gcc/testsuite/gcc.dg/dfp/fe-binop.c
===================================================================
--- gcc/testsuite/gcc.dg/dfp/fe-binop.c	(revision 142454)
+++ gcc/testsuite/gcc.dg/dfp/fe-binop.c	(working copy)
@@ -1,4 +1,5 @@
 /* { dg-options "-std=gnu99" } */
+/* { dg-skip-if "test is for emulation" { hard_dfp } { "*" } { "" } } */
 
 /* Touch tests that check for raising appropriate exceptions for binary
    arithmetic operations on decimal float values.  */
Index: gcc/testsuite/gcc.dg/dfp/fe-convert-1.c
===================================================================
--- gcc/testsuite/gcc.dg/dfp/fe-convert-1.c	(revision 142454)
+++ gcc/testsuite/gcc.dg/dfp/fe-convert-1.c	(working copy)
@@ -1,4 +1,5 @@
 /* { dg-options "-std=gnu99" } */
+/* { dg-skip-if "test is for emulation" { hard_dfp } { "*" } { "" } } */
 
 /* Check that appropriate exceptions are raised for conversions involving
    decimal float values.  */



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