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: [PATCH,testsuite] add powerpc_spe_ok effective target


On Tue, Jan 13, 2009 at 11:26:33AM -0800, Janis Johnson wrote:
> On Tue, 2009-01-13 at 11:00 -0800, Nathan Froyd wrote:
> > If we have a multilib that already specifies -mcpu=, then some of the
> > SPE-related tests in the testsuite lead to errors, because the multilib
> > -mcpu= is incompatible with the dg-options -mcpu=.  Fixed by adding an
> > effective target powerpc_spe_ok and using it where appropriate.
> 
> Instead of doing it this way, look at Joel Sherrill's recent patch
> http://gcc.gnu.org/ml/gcc-patches/2009-01/msg00470.html and follow that
> model instead: use powerpc-spe-nocache for the effective-target keyword
> and call the nocache version of check_no_compiler_messages with
> [current_compiler_flags] instead of the specific list, and use
> dg-skip-if after dg-options.

OK, updated patch below.  Tested on powerpc-none-eabi{,spe}.

(I considered trying to merge c_e_t_powerpc_spe{,_nocache}, but found
that it made things less clear, so I opted to just use the *_nocache bit
where obviously conflicting dg-options were used.)

-Nathan

2009-01-14  Daniel Jacobowitz  <dan@codesourcery.com>
	    Nathan Froyd  <froydnj@codesourcery.com>
	    Joseph Myers  <joseph@codesourcery.com>

	* lib/target-supports.exp (check_effective_target_powerpc_spe_nocache):
	New function.
	* gcc.target/powerpc/20030218-1.c: Skip if not powerpc_spe_nocache
	and use consistent CFLAGS.
	* gcc.target/powerpc/20030505.c: Likewise.
	* gcc.target/powerpc/20081204-1.c: Likewise.
	* gcc.target/powerpc/ppc-spe.c: Likewise.
	* gcc.target/powerpc/spe1.c: Likewise.
	* g++.dg/other/opaque-1.C: Likewise.
	* g++.dg/other/opaque-2.C: Likewise.
	* g++.dg/other/opaque-3.C: Likewise.

Index: gcc.target/powerpc/20030218-1.c
===================================================================
--- gcc.target/powerpc/20030218-1.c	(revision 143372)
+++ gcc.target/powerpc/20030218-1.c	(working copy)
@@ -1,5 +1,6 @@
-/* { dg-do compile { target powerpc-*-eabi* } } */
-/* { dg-options "-mspe=yes -mfloat-gprs=single" } */
+/* { dg-do compile } */
+/* { dg-options "-mcpu=8540 -mspe -mabi=spe -mfloat-gprs=single" } */
+/* { dg-skip-if "not an SPE target" { ! powerpc_spe_nocache } { "*" } { "" } } */
 
 /* Test vectors that can interconvert without a cast.  */
 
@@ -19,7 +20,7 @@ main (void)
 
   /* Just because this is a V2SI, it doesn't make it an opaque.  */
   vint = vshort; /* { dg-message "note: use -flax-vector-conversions to permit conversions between vectors with differing element types or numbers of subparts" } */
-  /* { dg-error "incompatible types when assigning" "" { target *-*-* } 21 } */
+  /* { dg-error "incompatible types when assigning" "" { target *-*-* } 22 } */
 
   return 0;
 }
Index: gcc.target/powerpc/20030505.c
===================================================================
--- gcc.target/powerpc/20030505.c	(revision 143372)
+++ gcc.target/powerpc/20030505.c	(working copy)
@@ -1,5 +1,6 @@
-/* { dg-do compile { target powerpc-*-eabi* } } */
+/* { dg-do compile } */
 /* { dg-options "-W -mcpu=8540 -mspe -mabi=spe -mfloat-gprs=single" } */
+/* { dg-skip-if "not an SPE target" { ! powerpc_spe_nocache } { "*" } { "" } } */
 
 #define __vector __attribute__((vector_size(8)))
 
Index: gcc.target/powerpc/20081204-1.c
===================================================================
--- gcc.target/powerpc/20081204-1.c	(revision 143372)
+++ gcc.target/powerpc/20081204-1.c	(working copy)
@@ -2,6 +2,8 @@
    TARGET_HARD_FLOAT && !TARGET_FPRS.  */
 /* { dg-do compile } */
 /* { dg-options "-mcpu=750 -mfloat-gprs=single" } */
+/* { dg-skip-if "not an SPE target" { ! powerpc_spe_nocache } { "*" } { "" } } */
+
 static int comp(const void *a,const void *b){
   return (*(float *)a<*(float *)b)-(*(float *)a>*(float *)b);
 }
Index: gcc.target/powerpc/ppc-spe.c
===================================================================
--- gcc.target/powerpc/ppc-spe.c	(revision 143372)
+++ gcc.target/powerpc/ppc-spe.c	(working copy)
@@ -1,5 +1,6 @@
-/* { dg-do compile { target powerpc-*-eabi* } } */
+/* { dg-do compile } */
 /* { dg-options "-mcpu=8540 -mspe -mabi=spe -mfloat-gprs=single -O0" } */
+/* { dg-skip-if "not an SPE target" { ! powerpc_spe_nocache } { "*" } { "" } } */
 
 /* (Test with -O0 so we don't optimize any of them away).  */
 
Index: gcc.target/powerpc/spe1.c
===================================================================
--- gcc.target/powerpc/spe1.c	(revision 143372)
+++ gcc.target/powerpc/spe1.c	(working copy)
@@ -1,5 +1,6 @@
-/* { dg-do compile { target powerpc-*-eabi* } } */
+/* { dg-do compile } */
 /* { dg-options "-mcpu=8540 -mspe -mabi=spe -mfloat-gprs=single -O0" } */
+/* { dg-skip-if "not an SPE target" { ! powerpc_spe_nocache } { "*" } { "" } } */
 
 /* (Test with -O0 so we don't optimize any of them away).  */
 
Index: gcc.target/powerpc/spe-vector-memcpy.c
===================================================================
--- gcc.target/powerpc/spe-vector-memcpy.c	(revision 143372)
+++ gcc.target/powerpc/spe-vector-memcpy.c	(working copy)
@@ -1,6 +1,6 @@
-/* { dg-do compile { target powerpc*-*-* } } */
-/* { dg-require-effective-target powerpc_spe } */
-/* { dg-options "-O -mspe=yes" } */
+/* { dg-do compile } */
+/* { dg-options "-O -mcpu=8540 -mspe -mabi=spe -mfloat-gprs=single" } */
+/* { dg-skip-if "not an SPE target" { ! powerpc_spe_nocache } { "*" } { "" } } */
 /* { dg-final { scan-assembler "evstdd" } } */
 
 void foo(void)
Index: g++.dg/other/opaque-1.C
===================================================================
--- g++.dg/other/opaque-1.C	(revision 143372)
+++ g++.dg/other/opaque-1.C	(working copy)
@@ -1,4 +1,6 @@
-/* { dg-do run { target { powerpc*-*-* && powerpc_spe } } } */
+/* { dg-do run } */
+/* { dg-options "-mcpu=8540 -mspe -mabi=spe -mfloat-gprs=single" } */
+/* { dg-skip-if "not an SPE target" { ! powerpc_spe_nocache } { "*" } { "" } } */
 
 #define __vector __attribute__((vector_size(8)))
 typedef float __vector __ev64_fs__;
Index: g++.dg/other/opaque-2.C
===================================================================
--- g++.dg/other/opaque-2.C	(revision 143372)
+++ g++.dg/other/opaque-2.C	(working copy)
@@ -1,5 +1,6 @@
-/* { dg-do compile { target powerpc-*-eabi* powerpc*-*-linux*spe* } } */
+/* { dg-do compile } */
 /* { dg-options "-mcpu=8540 -mspe -mabi=spe -mfloat-gprs=single" } */
+/* { dg-skip-if "not an SPE target" { ! powerpc_spe_nocache } { "*" } { "" } } */
 
 #define __vector __attribute__((vector_size(8)))
 typedef float __vector __ev64_fs__;
Index: g++.dg/other/opaque-3.C
===================================================================
--- g++.dg/other/opaque-3.C	(revision 143372)
+++ g++.dg/other/opaque-3.C	(working copy)
@@ -1,5 +1,6 @@
-/* { dg-do compile { target powerpc-*-eabi* powerpc*-*-linux*spe* } } */
+/* { dg-do compile } */
 /* { dg-options "-mcpu=8540 -mspe -mabi=spe -mfloat-gprs=single" } */
+/* { dg-skip-if "not an SPE target" { ! powerpc_spe_nocache } { "*" } { "" } } */
 
 __ev64_opaque__ o;
 #define v __attribute__((vector_size(8)))
Index: lib/target-supports.exp
===================================================================
--- lib/target-supports.exp	(revision 143372)
+++ lib/target-supports.exp	(working copy)
@@ -1535,6 +1535,23 @@ proc check_effective_target_powerpc_spu 
     }
 }
 
+# Return 1 if this is a PowerPC SPE target.  The check includes options
+# specified by dg-options for this test, so don't cache the result.
+
+proc check_effective_target_powerpc_spe_nocache { } {
+    if { [istarget powerpc*-*-*] } {
+	return [check_no_compiler_messages_nocache powerpc_spe object {
+	    #ifndef __SPE__
+	    #error not SPE
+	    #else
+	    int dummy;
+	    #endif
+	}]
+    } else {
+	return 0
+    }
+}
+
 # Return 1 if this is a PowerPC target with SPE enabled.
 
 proc check_effective_target_powerpc_spe { } {


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