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]

Re: [committed] Skip floating-point var-expand tests for soft-float MIPS targets


Richard Sandiford wrote:
-fvariable-expansion-in-unroller only considers cases where the
accumulator operations are native INSNs rather than libcalls.
This is good, because there is no pipelining benefit to the
optimisation when calls are used, and it simply introduces
more calls in the epilogue.  This patch therefore disables two
floating-point -fvariable-expansion-in-unroller tests on soft-float
MIPS targets.

gcc/testsuite/
	* lib/target-supports.exp (check_effective_target_mips_soft_float):
	New procedure.
	* gcc.dg/var-expand1.c: Skip for mips_soft_float.
	* gcc.dg/pr30957-1.c: Likewise.

Xtensa soft float targets have the same issue. What would you think about generalizing your check to handle other targets? This patch skips these tests for Xtensa, and I think preserves the current behavior for MIPS. I flipped the target procedure to check for "hard float" instead of "soft float" just because that seemed more natural when dealing with multiple targets.


2007-11-26  Bob Wilson  <bob.wilson@acm.org>
	
	* lib/target-supports.exp (check_effective_target_mips_soft_float):
	Delete.
	(check_effective_target_hard_float): New.
	* gcc.dg/var-expand1.c: Skip for targets without FPU instructions.
	* gcc.dg/pr30957-1.c: Likewise.

Index: gcc.dg/var-expand1.c
===================================================================
--- gcc.dg/var-expand1.c	(revision 130440)
+++ gcc.dg/var-expand1.c	(working copy)
@@ -1,7 +1,7 @@
 /* { dg-do compile } */
 /* We don't (and don't want to) perform this optimisation on soft-float
-   MIPS targets, where each addition is a library call.  */
-/* { dg-skip-if "" { mips_soft_float } { "*" } { "" } } */
+   targets, where each addition is a library call.  */
+/* { dg-require-effective-target hard_float } */
 /* { dg-options "-O2 -funroll-loops --fast-math -fvariable-expansion-in-unroller -dL" } */
 
 extern void abort (void);
Index: gcc.dg/pr30957-1.c
===================================================================
--- gcc.dg/pr30957-1.c	(revision 130440)
+++ gcc.dg/pr30957-1.c	(working copy)
@@ -1,7 +1,7 @@
 /* { dg-do run { xfail vax-*-* powerpc-*-*spe } } */
 /* We don't (and don't want to) perform this optimisation on soft-float
-   MIPS targets, where each addition is a library call.  */
-/* { dg-skip-if "" { mips_soft_float } { "*" } { "" } } */
+   targets, where each addition is a library call.  */
+/* { dg-require-effective-target hard_float } */
 /* { dg-options "-O2 -funroll-loops -funsafe-math-optimizations -fvariable-expansion-in-unroller -dL" } */
 
 extern void abort (void);
Index: lib/target-supports.exp
===================================================================
--- lib/target-supports.exp	(revision 130440)
+++ lib/target-supports.exp	(working copy)
@@ -615,12 +615,13 @@
     } "-mpaired-single"]
 }
 
-# Return true if we're testing a MIPS target that does not have access
-# to FPU instructions.
+# Return true if the target has access to FPU instructions.
 
-proc check_effective_target_mips_soft_float { } {
-    return [check_no_compiler_messages mips_soft_float assembly {
-	#if !defined (__mips_soft_float) && !defined (__mips16)
+proc check_effective_target_hard_float { } {
+    return [check_no_compiler_messages hard_float assembly {
+	#if ((defined __mips \
+	      && (defined __mips_soft_float || defined __mips16)) \
+	     || (defined __xtensa__ && defined __XTENSA_SOFT_FLOAT__))
 	#error FOO
 	#endif
     }]

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