This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
gcc.target/powerpc check if really ppc405
- From: Joel Sherrill <joel dot sherrill at oarcorp dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>, Janis Johnson <janis187 at us dot ibm dot com>
- Date: Fri, 9 Jan 2009 14:23:00 -0600
- Subject: gcc.target/powerpc check if really ppc405
Hi,
Thanks to Janis, I have a patch which detects
when the compiler options result in you NOT
generating code for a ppc405. This patch
adds a dg-skip-if to all ppc405 options. This
turns them from fails to unsupported.
The patch is not as bad as the ChangeLog entry. :)
Ok to commit?
2009-01-09 Joel Sherrill <joel.sherrill@oarcorp.com>
* lib/target-supports.exp: Add method to determine if the effective
target is really a ppc405 after applying all compile options.
* gcc.target/powerpc/405-mulhhwu-2.c: Add dg-skip-if not ppc405.
* gcc.target/powerpc/405-nmachhw-1.c: Likewise.
* gcc.target/powerpc/405-nmaclhw-1.c: Likewise.
* gcc.target/powerpc/405-machhwu-1.c: Likewise.
* gcc.target/powerpc/405-mullhwu-1.c: Likewise.
* gcc.target/powerpc/405-nmacchw-1.c: Likewise.
* gcc.target/powerpc/405-mulchwu-1.c: Likewise.
* gcc.target/powerpc/405-nmachhw-2.c: Likewise.
* gcc.target/powerpc/405-nmaclhw-2.c: Likewise.
* gcc.target/powerpc/405-machhwu-2.c: Likewise.
* gcc.target/powerpc/405-mulhhw-1.c: Likewise.
* gcc.target/powerpc/405-machhw-1.c: Likewise.
* gcc.target/powerpc/405-mullhw-1.c: Likewise.
* gcc.target/powerpc/405-maclhw-1.c: Likewise.
* gcc.target/powerpc/405-dlmzb-strlen-1.c: Likewise.
* gcc.target/powerpc/405-mullhwu-2.c: Likewise.
* gcc.target/powerpc/405-nmacchw-2.c: Likewise.
* gcc.target/powerpc/405-mulchwu-2.c: Likewise.
* gcc.target/powerpc/405-mulchw-1.c: Likewise.
* gcc.target/powerpc/405-maclhwu-1.c: Likewise.
* gcc.target/powerpc/405-macchw-1.c: Likewise.
* gcc.target/powerpc/405-mulhhw-2.c: Likewise.
* gcc.target/powerpc/405-machhw-2.c: Likewise.
* gcc.target/powerpc/405-mullhw-2.c: Likewise.
* gcc.target/powerpc/405-maclhw-2.c: Likewise.
* gcc.target/powerpc/405-macchwu-1.c: Likewise.
* gcc.target/powerpc/405-mulhhwu-1.c: Likewise.
* gcc.target/powerpc/405-mulchw-2.c: Likewise.
* gcc.target/powerpc/405-maclhwu-2.c: Likewise.
* gcc.target/powerpc/405-macchw-2.c: Likewise.
* gcc.target/powerpc/405-macchwu-2.c: Likewise.
--joel
Index: gcc.target/powerpc/405-mulhhwu-2.c
===================================================================
--- gcc.target/powerpc/405-mulhhwu-2.c (revision 143187)
+++ gcc.target/powerpc/405-mulhhwu-2.c (working copy)
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O2 -mcpu=405" } */
+/* { dg-skip-if "other options override -mcpu=405" { ! powerpc_405_nocache } { "*" } { "" } } */
/* { dg-final { scan-assembler "mulhhwu\\. " } } */
Index: gcc.target/powerpc/405-nmachhw-1.c
===================================================================
--- gcc.target/powerpc/405-nmachhw-1.c (revision 143187)
+++ gcc.target/powerpc/405-nmachhw-1.c (working copy)
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O2 -mcpu=405" } */
+/* { dg-skip-if "other options override -mcpu=405" { ! powerpc_405_nocache } { "*" } { "" } } */
/* { dg-final { scan-assembler "nmachhw " } } */
Index: gcc.target/powerpc/405-nmaclhw-1.c
===================================================================
--- gcc.target/powerpc/405-nmaclhw-1.c (revision 143187)
+++ gcc.target/powerpc/405-nmaclhw-1.c (working copy)
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O2 -mcpu=405" } */
+/* { dg-skip-if "other options override -mcpu=405" { ! powerpc_405_nocache } { "*" } { "" } } */
/* { dg-final { scan-assembler "nmaclhw " } } */
Index: gcc.target/powerpc/405-machhwu-1.c
===================================================================
--- gcc.target/powerpc/405-machhwu-1.c (revision 143187)
+++ gcc.target/powerpc/405-machhwu-1.c (working copy)
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O2 -mcpu=405" } */
+/* { dg-skip-if "other options override -mcpu=405" { ! powerpc_405_nocache } { "*" } { "" } } */
/* { dg-final { scan-assembler "machhwu " } } */
Index: gcc.target/powerpc/405-mullhwu-1.c
===================================================================
--- gcc.target/powerpc/405-mullhwu-1.c (revision 143187)
+++ gcc.target/powerpc/405-mullhwu-1.c (working copy)
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O2 -mcpu=405" } */
+/* { dg-skip-if "other options override -mcpu=405" { ! powerpc_405_nocache } { "*" } { "" } } */
/* { dg-final { scan-assembler "mullhwu " } } */
Index: gcc.target/powerpc/405-nmacchw-1.c
===================================================================
--- gcc.target/powerpc/405-nmacchw-1.c (revision 143187)
+++ gcc.target/powerpc/405-nmacchw-1.c (working copy)
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O2 -mcpu=405" } */
+/* { dg-skip-if "other options override -mcpu=405" { ! powerpc_405_nocache } { "*" } { "" } } */
/* { dg-final { scan-assembler "nmacchw " } } */
Index: gcc.target/powerpc/405-mulchwu-1.c
===================================================================
--- gcc.target/powerpc/405-mulchwu-1.c (revision 143187)
+++ gcc.target/powerpc/405-mulchwu-1.c (working copy)
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O2 -mcpu=405" } */
+/* { dg-skip-if "other options override -mcpu=405" { ! powerpc_405_nocache } { "*" } { "" } } */
/* { dg-final { scan-assembler "mulchwu " } } */
Index: gcc.target/powerpc/405-nmachhw-2.c
===================================================================
--- gcc.target/powerpc/405-nmachhw-2.c (revision 143187)
+++ gcc.target/powerpc/405-nmachhw-2.c (working copy)
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O2 -mcpu=405" } */
+/* { dg-skip-if "other options override -mcpu=405" { ! powerpc_405_nocache } { "*" } { "" } } */
/* { dg-final { scan-assembler "nmachhw\\. " } } */
Index: gcc.target/powerpc/405-nmaclhw-2.c
===================================================================
--- gcc.target/powerpc/405-nmaclhw-2.c (revision 143187)
+++ gcc.target/powerpc/405-nmaclhw-2.c (working copy)
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O2 -mcpu=405" } */
+/* { dg-skip-if "other options override -mcpu=405" { ! powerpc_405_nocache } { "*" } { "" } } */
/* { dg-final { scan-assembler "nmaclhw\\. " } } */
Index: gcc.target/powerpc/405-machhwu-2.c
===================================================================
--- gcc.target/powerpc/405-machhwu-2.c (revision 143187)
+++ gcc.target/powerpc/405-machhwu-2.c (working copy)
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O2 -mcpu=405" } */
+/* { dg-skip-if "other options override -mcpu=405" { ! powerpc_405_nocache } { "*" } { "" } } */
/* { dg-final { scan-assembler "machhwu\\. " } } */
Index: gcc.target/powerpc/405-mulhhw-1.c
===================================================================
--- gcc.target/powerpc/405-mulhhw-1.c (revision 143187)
+++ gcc.target/powerpc/405-mulhhw-1.c (working copy)
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O2 -mcpu=405" } */
+/* { dg-skip-if "other options override -mcpu=405" { ! powerpc_405_nocache } { "*" } { "" } } */
/* { dg-final { scan-assembler "mulhhw " } } */
Index: gcc.target/powerpc/405-machhw-1.c
===================================================================
--- gcc.target/powerpc/405-machhw-1.c (revision 143187)
+++ gcc.target/powerpc/405-machhw-1.c (working copy)
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O2 -mcpu=405" } */
+/* { dg-skip-if "other options override -mcpu=405" { ! powerpc_405_nocache } { "*" } { "" } } */
/* { dg-final { scan-assembler "machhw " } } */
Index: gcc.target/powerpc/405-mullhw-1.c
===================================================================
--- gcc.target/powerpc/405-mullhw-1.c (revision 143187)
+++ gcc.target/powerpc/405-mullhw-1.c (working copy)
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O2 -mcpu=405" } */
+/* { dg-skip-if "other options override -mcpu=405" { ! powerpc_405_nocache } { "*" } { "" } } */
/* { dg-final { scan-assembler "mullhw " } } */
Index: gcc.target/powerpc/405-maclhw-1.c
===================================================================
--- gcc.target/powerpc/405-maclhw-1.c (revision 143187)
+++ gcc.target/powerpc/405-maclhw-1.c (working copy)
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O2 -mcpu=405" } */
+/* { dg-skip-if "other options override -mcpu=405" { ! powerpc_405_nocache } { "*" } { "" } } */
/* { dg-final { scan-assembler "maclhw " } } */
Index: gcc.target/powerpc/405-dlmzb-strlen-1.c
===================================================================
--- gcc.target/powerpc/405-dlmzb-strlen-1.c (revision 143187)
+++ gcc.target/powerpc/405-dlmzb-strlen-1.c (working copy)
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O2 -mcpu=405" } */
+/* { dg-skip-if "other options override -mcpu=405" { ! powerpc_405_nocache } { "*" } { "" } } */
/* { dg-final { scan-assembler "dlmzb\\. " } } */
Index: gcc.target/powerpc/405-mullhwu-2.c
===================================================================
--- gcc.target/powerpc/405-mullhwu-2.c (revision 143187)
+++ gcc.target/powerpc/405-mullhwu-2.c (working copy)
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O2 -mcpu=405" } */
+/* { dg-skip-if "other options override -mcpu=405" { ! powerpc_405_nocache } { "*" } { "" } } */
/* { dg-final { scan-assembler "mullhwu\\. " } } */
Index: gcc.target/powerpc/405-nmacchw-2.c
===================================================================
--- gcc.target/powerpc/405-nmacchw-2.c (revision 143187)
+++ gcc.target/powerpc/405-nmacchw-2.c (working copy)
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O2 -mcpu=405" } */
+/* { dg-skip-if "other options override -mcpu=405" { ! powerpc_405_nocache } { "*" } { "" } } */
/* { dg-final { scan-assembler "nmacchw\\. " } } */
Index: gcc.target/powerpc/405-mulchwu-2.c
===================================================================
--- gcc.target/powerpc/405-mulchwu-2.c (revision 143187)
+++ gcc.target/powerpc/405-mulchwu-2.c (working copy)
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O2 -mcpu=405" } */
+/* { dg-skip-if "other options override -mcpu=405" { ! powerpc_405_nocache } { "*" } { "" } } */
/* { dg-final { scan-assembler "mulchwu\\. " } } */
Index: gcc.target/powerpc/405-mulchw-1.c
===================================================================
--- gcc.target/powerpc/405-mulchw-1.c (revision 143187)
+++ gcc.target/powerpc/405-mulchw-1.c (working copy)
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O2 -mcpu=405" } */
+/* { dg-skip-if "other options override -mcpu=405" { ! powerpc_405_nocache } { "*" } { "" } } */
/* { dg-final { scan-assembler "mulchw " } } */
Index: gcc.target/powerpc/405-maclhwu-1.c
===================================================================
--- gcc.target/powerpc/405-maclhwu-1.c (revision 143187)
+++ gcc.target/powerpc/405-maclhwu-1.c (working copy)
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O2 -mcpu=405" } */
+/* { dg-skip-if "other options override -mcpu=405" { ! powerpc_405_nocache } { "*" } { "" } } */
/* { dg-final { scan-assembler "maclhwu " } } */
Index: gcc.target/powerpc/405-macchw-1.c
===================================================================
--- gcc.target/powerpc/405-macchw-1.c (revision 143187)
+++ gcc.target/powerpc/405-macchw-1.c (working copy)
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O2 -mcpu=405" } */
+/* { dg-skip-if "other options override -mcpu=405" { ! powerpc_405_nocache } { "*" } { "" } } */
/* { dg-final { scan-assembler "macchw " } } */
Index: gcc.target/powerpc/405-mulhhw-2.c
===================================================================
--- gcc.target/powerpc/405-mulhhw-2.c (revision 143187)
+++ gcc.target/powerpc/405-mulhhw-2.c (working copy)
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O2 -mcpu=405" } */
+/* { dg-skip-if "other options override -mcpu=405" { ! powerpc_405_nocache } { "*" } { "" } } */
/* { dg-final { scan-assembler "mulhhw\\. " } } */
Index: gcc.target/powerpc/405-machhw-2.c
===================================================================
--- gcc.target/powerpc/405-machhw-2.c (revision 143187)
+++ gcc.target/powerpc/405-machhw-2.c (working copy)
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O2 -mcpu=405" } */
+/* { dg-skip-if "other options override -mcpu=405" { ! powerpc_405_nocache } { "*" } { "" } } */
/* { dg-final { scan-assembler "machhw\\. " } } */
Index: gcc.target/powerpc/405-mullhw-2.c
===================================================================
--- gcc.target/powerpc/405-mullhw-2.c (revision 143187)
+++ gcc.target/powerpc/405-mullhw-2.c (working copy)
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O2 -mcpu=405" } */
+/* { dg-skip-if "other options override -mcpu=405" { ! powerpc_405_nocache } { "*" } { "" } } */
/* { dg-final { scan-assembler "mullhw\\. " } } */
Index: gcc.target/powerpc/405-maclhw-2.c
===================================================================
--- gcc.target/powerpc/405-maclhw-2.c (revision 143187)
+++ gcc.target/powerpc/405-maclhw-2.c (working copy)
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O2 -mcpu=405" } */
+/* { dg-skip-if "other options override -mcpu=405" { ! powerpc_405_nocache } { "*" } { "" } } */
/* { dg-final { scan-assembler "maclhw\\. " } } */
Index: gcc.target/powerpc/405-macchwu-1.c
===================================================================
--- gcc.target/powerpc/405-macchwu-1.c (revision 143187)
+++ gcc.target/powerpc/405-macchwu-1.c (working copy)
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O2 -mcpu=405" } */
+/* { dg-skip-if "other options override -mcpu=405" { ! powerpc_405_nocache } { "*" } { "" } } */
/* { dg-final { scan-assembler "macchwu " } } */
Index: gcc.target/powerpc/405-mulhhwu-1.c
===================================================================
--- gcc.target/powerpc/405-mulhhwu-1.c (revision 143187)
+++ gcc.target/powerpc/405-mulhhwu-1.c (working copy)
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O2 -mcpu=405" } */
+/* { dg-skip-if "other options override -mcpu=405" { ! powerpc_405_nocache } { "*" } { "" } } */
/* { dg-final { scan-assembler "mulhhwu " } } */
Index: gcc.target/powerpc/405-mulchw-2.c
===================================================================
--- gcc.target/powerpc/405-mulchw-2.c (revision 143187)
+++ gcc.target/powerpc/405-mulchw-2.c (working copy)
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O2 -mcpu=405" } */
+/* { dg-skip-if "other options override -mcpu=405" { ! powerpc_405_nocache } { "*" } { "" } } */
/* { dg-final { scan-assembler "mulchw\\. " } } */
Index: gcc.target/powerpc/405-maclhwu-2.c
===================================================================
--- gcc.target/powerpc/405-maclhwu-2.c (revision 143187)
+++ gcc.target/powerpc/405-maclhwu-2.c (working copy)
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O2 -mcpu=405" } */
+/* { dg-skip-if "other options override -mcpu=405" { ! powerpc_405_nocache } { "*" } { "" } } */
/* { dg-final { scan-assembler "maclhwu\\. " } } */
Index: gcc.target/powerpc/405-macchw-2.c
===================================================================
--- gcc.target/powerpc/405-macchw-2.c (revision 143187)
+++ gcc.target/powerpc/405-macchw-2.c (working copy)
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O2 -mcpu=405" } */
+/* { dg-skip-if "other options override -mcpu=405" { ! powerpc_405_nocache } { "*" } { "" } } */
/* { dg-final { scan-assembler "macchw\\. " } } */
Index: gcc.target/powerpc/405-macchwu-2.c
===================================================================
--- gcc.target/powerpc/405-macchwu-2.c (revision 143187)
+++ gcc.target/powerpc/405-macchwu-2.c (working copy)
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O2 -mcpu=405" } */
+/* { dg-skip-if "other options override -mcpu=405" { ! powerpc_405_nocache } { "*" } { "" } } */
/* { dg-final { scan-assembler "macchwu\\. " } } */
Index: lib/target-supports.exp
===================================================================
--- lib/target-supports.exp (revision 143187)
+++ lib/target-supports.exp (working copy)
@@ -1474,6 +1474,23 @@
}
}
+# Return 1 if this is a PowerPC 405 target. The check includes options
+# specified by dg-options for this test, so don't cache the result.
+
+proc check_effective_target_powerpc_405_nocache { } {
+ if { [istarget powerpc*-*-*] || [istarget rs6000-*-*] } {
+ return [check_no_compiler_messages_nocache powerpc_405 object {
+ #ifdef __PPC405__
+ int dummy;
+ #else
+ #error not a PPC405
+ #endif
+ } [current_compiler_flags]]
+ } else {
+ return 0
+ }
+}
+
# Return 1 if this is a SPU target with a toolchain that
# supports automatic overlay generation.