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-*-*.

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"
 

Reply via email to