This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Adjust vect_cmdline_needed for SPE
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 21 Dec 2006 17:54:43 +0000 (UTC)
- Subject: Adjust vect_cmdline_needed for SPE
The vect_cmdline_needed effective-target is used for generic vector tests
where vector instructions being enabled would perturb the test.
It is of course possible to run the testsuite with multilib options, or
for targets, that enable vector instructions where the usual defaults for
that CPU don't, and so this effective target in general needs to allow for
this. This patch does one case of that: checking for PowerPC SPE. Other
cases can be added individually by those testing on the relevant targets /
multilibs (e.g. anyone testing powerpc-*-linux-gnualtivec might wish to
add a similar check for Altivec already being enabled).
Tested powerpc-none-linux-gnuspe. OK to commit?
2006-12-21 Joseph Myers <joseph@codesourcery.com>
* lib/target-supports.exp (check_effective_target_powerpc_spe):
New.
(check_effective_target_vect_cmdline_needed): Use it.
Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp (revision 120102)
+++ gcc/testsuite/lib/target-supports.exp (working copy)
@@ -1240,7 +1240,9 @@
set et_vect_cmdline_needed_saved 1
if { [istarget ia64-*-*]
|| (([istarget x86_64-*-*] || [istarget i?86-*-*])
- && [check_effective_target_lp64])} {
+ && [check_effective_target_lp64])
+ || ([istarget powerpc*-*-*]
+ && [check_effective_target_powerpc_spe])} {
set et_vect_cmdline_needed_saved 0
}
}
@@ -1360,6 +1362,22 @@
}
}
+# Return 1 if this is a PowerPC target with SPE enabled.
+
+proc check_effective_target_powerpc_spe { } {
+ if { [istarget powerpc*-*-*] } {
+ return [check_no_compiler_messages powerpc_spe object {
+ #ifndef __SPE__
+ #error not SPE
+ #else
+ int dummy;
+ #endif
+ }]
+ } else {
+ return 0
+ }
+}
+
# Return 1 if the target supports hardware vector shift operation.
proc check_effective_target_vect_shift { } {
--
Joseph S. Myers
joseph@codesourcery.com