public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* C6X FP testcase fixes
@ 2011-07-15 12:17 Bernd Schmidt
  2011-07-15 17:31 ` Mike Stump
  0 siblings, 1 reply; 2+ messages in thread
From: Bernd Schmidt @ 2011-07-15 12:17 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 317 bytes --]

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

[-- Attachment #2: c6x-ieee.diff --]
[-- Type: text/plain, Size: 3841 bytes --]

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: C6X FP testcase fixes
  2011-07-15 12:17 C6X FP testcase fixes Bernd Schmidt
@ 2011-07-15 17:31 ` Mike Stump
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Stump @ 2011-07-15 17:31 UTC (permalink / raw)
  To: Bernd Schmidt; +Cc: GCC Patches

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-07-15 17:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-15 12:17 C6X FP testcase fixes Bernd Schmidt
2011-07-15 17:31 ` Mike Stump

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).