diff mbox

C6X FP testcase fixes

Message ID 4E201FFD.2000300@codesourcery.com
State New
Headers show

Commit Message

Bernd Schmidt July 15, 2011, 11:09 a.m. UTC
This fixes a number of testsuite failures on C6X for targets with
floating point hardware. The hardware has the following quirks:

* Divide is implemented using reciprocals; TI requested a default of
  -freciprocal-math
* Multiply, comparison and conversion instructions treat denormal
  inputs as zero.

Ok?


Bernd
* gcc.c-torture/execute/ieee/mul-subnormal-single-1.x: Add tic6x-*-*
	case.
	* gcc.c-torture/execute/ieee/20000320-1.x: Likewise.
	* gcc.c-torture/execute/ieee/hugeval.x: Likewise.
	* gcc.c-torture/execute/ieee/mzero2.c: Comment out the divide tests for
	C67X.
	* gcc.c-torture/execute/ieee/pr29302.x: New file.
	* gcc.dg/torture/type-generic-1.c: Add -DUNSAFE for tic6x-*-*.

Comments

Mike Stump July 15, 2011, 5:22 p.m. UTC | #1
On Jul 15, 2011, at 4:09 AM, Bernd Schmidt wrote:
> This fixes a number of testsuite failures on C6X for targets with
> floating point hardware. The hardware has the following quirks:
> 
> * Divide is implemented using reciprocals; TI requested a default of
>  -freciprocal-math
> * Multiply, comparison and conversion instructions treat denormal
>  inputs as zero.
> 
> Ok?

Ok.  I'm hoping someone might have a more elegant way to handle gcc/testsuite/gcc.c-torture/execute/ieee/mzero2.c. I don't have any specific suggestion, which is why I'm approving it.  If someone has of a better way to handle it, feel free to check in a better version.  :-)  Watch for reviews by fp-type people...  I'd defer to them...
diff mbox

Patch

Index: gcc/testsuite/gcc.c-torture/execute/ieee/mul-subnormal-single-1.x
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/ieee/mul-subnormal-single-1.x	(revision 332057)
+++ gcc/testsuite/gcc.c-torture/execute/ieee/mul-subnormal-single-1.x	(working copy)
@@ -13,4 +13,9 @@  if [istarget "spu-*-*"] {
     # support subnormals.
     return 1
 }
+if { [istarget "tic6x-*-*"] && [check_effective_target_ti_c67x] } {
+    # C6X floating point hardware turns denormals to zero in multiplications.
+    set torture_execute_xfail "tic6x-*-*"
+    return 1
+}
 return 0
Index: gcc/testsuite/gcc.c-torture/execute/ieee/pr29302-1.x
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/ieee/pr29302-1.x	(revision 0)
+++ gcc/testsuite/gcc.c-torture/execute/ieee/pr29302-1.x	(revision 0)
@@ -0,0 +1,6 @@ 
+if { [istarget "tic6x-*-*"] && [check_effective_target_ti_c67x] } {
+    # C6X uses -freciprocal-math by default.
+    set torture_execute_xfail "tic6x-*-*"
+    return 1
+}
+return 0
Index: gcc/testsuite/gcc.c-torture/execute/ieee/20000320-1.x
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/ieee/20000320-1.x	(revision 332057)
+++ gcc/testsuite/gcc.c-torture/execute/ieee/20000320-1.x	(working copy)
@@ -7,4 +7,9 @@  if [istarget "avr-*-*"] {
     # AVR doubles are floats
     return 1
 }
+if { [istarget "tic6x-*-*"] && [check_effective_target_ti_c67x] } {
+    # C6X floating point hardware turns denormals to zero in FP conversions.
+    set torture_execute_xfail "tic6x-*-*"
+    return 1
+}
 return 0
Index: gcc/testsuite/gcc.c-torture/execute/ieee/mzero2.c
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/ieee/mzero2.c	(revision 332057)
+++ gcc/testsuite/gcc.c-torture/execute/ieee/mzero2.c	(working copy)
@@ -44,6 +44,8 @@  main ()
   expect (+1.00 * nzero, nzero);
   expect (-1.00 * nzero, pzero);
 
+#ifndef _TMS320C6700
+  /* C6X floating point division is implemented using reciprocals.  */
   expect (pzero / pzero, nan);
   expect (pzero / nzero, nan);
   expect (nzero / pzero, nan);
@@ -53,6 +55,7 @@  main ()
   expect (-1.00 / pzero, ninf);
   expect (+1.00 / nzero, ninf);
   expect (-1.00 / nzero, pinf);
+#endif
 
   exit (0);
 }
Index: gcc/testsuite/gcc.c-torture/execute/ieee/hugeval.x
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/ieee/hugeval.x	(revision 332057)
+++ gcc/testsuite/gcc.c-torture/execute/ieee/hugeval.x	(working copy)
@@ -19,5 +19,11 @@  if {[istarget "*-*-vxworks*"]} {
     }
 }
 
+if { [istarget "tic6x-*-*"] && [check_effective_target_ti_c67x] } {
+    # C6X uses -freciprocal-math by default.
+    set torture_execute_xfail "$target_triplet"
+    return 1
+}
+
 return 0
 
Index: gcc/testsuite/gcc.dg/torture/type-generic-1.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/type-generic-1.c	(revision 332057)
+++ gcc/testsuite/gcc.dg/torture/type-generic-1.c	(working copy)
@@ -5,6 +5,7 @@ 
 /* { dg-skip-if "No Inf/NaN support" { spu-*-* } } */
 /* { dg-add-options ieee } */
 /* { dg-options "-Wl,--defsym=__cs3_mips_float_type=2 -lcs3-mips-cp1 -lcs3-mips-fpemu" { target mips*-*sde*-* } } */
+/* { dg-options "-DUNSAFE" { target tic6x*-*-* } } */
 
 #include "../tg-tests.h"