From 81d49cc1a4b15b69e83b995cf18e3e83fe0097f5 Mon Sep 17 00:00:00 2001 From: jsm28 Date: Mon, 18 Jan 2016 13:30:43 +0000 Subject: [PATCH] Handle Octeon 3 not supporting MIPS paired-single instructions. The Octeon 3 processor does not support the MIPS paired-single instructions. This results in illegal instruction errors in the testsuite when vectorization tests try to use those instructions. This patch teaches the compiler about that lack of support, so that warnings are given when -mpaired-single (or something implying it) is used when compiling for such a processor. I chose to test TARGET_OCTEON as the simplest conditional; since the older Octeon processors don't support hard float at all, I don't think the choice matters for them. Tests that then failed with the warning were updated to disable them for Octeon. Tested with no regressions for cross to mips64el-linux-gnu (Octeon 3). gcc: * config/mips/mips.h (ISA_HAS_PAIRED_SINGLE): Require !TARGET_OCTEON. gcc/testsuite: * gcc.target/mips/mips-3d-1.c: Use forbid_cpu=octeon.* in dg-options. * gcc.target/mips/mips-3d-2.c: Likewise. * gcc.target/mips/mips-3d-3.c: Likewise. * gcc.target/mips/mips-3d-4.c: Likewise. * gcc.target/mips/mips-3d-5.c: Likewise. * gcc.target/mips/mips-3d-6.c: Likewise. * gcc.target/mips/mips-3d-7.c: Likewise. * gcc.target/mips/mips-3d-8.c: Likewise. * gcc.target/mips/mips-3d-9.c: Likewise. * gcc.target/mips/mips-ps-1.c: Likewise. * gcc.target/mips/mips-ps-2.c: Likewise. * gcc.target/mips/mips-ps-3.c: Likewise. * gcc.target/mips/mips-ps-4.c: Likewise. * gcc.target/mips/mips-ps-5.c: Likewise. * gcc.target/mips/mips-ps-6.c: Likewise. * gcc.target/mips/mips-ps-7.c: Likewise. * gcc.target/mips/mips-ps-type.c: Likewise. * gcc.target/mips/mips-ps-type-2.c: Likewise. * gcc.target/mips/mips16-attributes-6.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232517 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/config/mips/mips.h | 7 ++++--- gcc/testsuite/ChangeLog | 23 ++++++++++++++++++++++ gcc/testsuite/gcc.target/mips/mips-3d-1.c | 2 +- gcc/testsuite/gcc.target/mips/mips-3d-2.c | 2 +- gcc/testsuite/gcc.target/mips/mips-3d-3.c | 2 +- gcc/testsuite/gcc.target/mips/mips-3d-4.c | 2 +- gcc/testsuite/gcc.target/mips/mips-3d-5.c | 2 +- gcc/testsuite/gcc.target/mips/mips-3d-6.c | 2 +- gcc/testsuite/gcc.target/mips/mips-3d-7.c | 2 +- gcc/testsuite/gcc.target/mips/mips-3d-8.c | 2 +- gcc/testsuite/gcc.target/mips/mips-3d-9.c | 2 +- gcc/testsuite/gcc.target/mips/mips-ps-1.c | 2 +- gcc/testsuite/gcc.target/mips/mips-ps-2.c | 2 +- gcc/testsuite/gcc.target/mips/mips-ps-3.c | 2 +- gcc/testsuite/gcc.target/mips/mips-ps-4.c | 2 +- gcc/testsuite/gcc.target/mips/mips-ps-5.c | 2 +- gcc/testsuite/gcc.target/mips/mips-ps-6.c | 2 +- gcc/testsuite/gcc.target/mips/mips-ps-7.c | 2 +- gcc/testsuite/gcc.target/mips/mips-ps-type-2.c | 2 +- gcc/testsuite/gcc.target/mips/mips-ps-type.c | 2 +- .../gcc.target/mips/mips16-attributes-6.c | 2 +- 22 files changed, 51 insertions(+), 22 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d011a4ffa9b..972ddec8182 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-01-18 Joseph Myers + + * config/mips/mips.h (ISA_HAS_PAIRED_SINGLE): Require + !TARGET_OCTEON. + 2016-01-18 Richard Biener PR middle-end/69308 diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index 3097a416668..803ab98e760 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -1014,9 +1014,10 @@ struct mips_cpu_info { #define ISA_HAS_LXC1_SXC1 ISA_HAS_FP4 /* ISA has paired-single instructions. */ -#define ISA_HAS_PAIRED_SINGLE (ISA_MIPS64 \ - || (mips_isa_rev >= 2 \ - && mips_isa_rev <= 5)) +#define ISA_HAS_PAIRED_SINGLE ((ISA_MIPS64 \ + || (mips_isa_rev >= 2 \ + && mips_isa_rev <= 5)) \ + && !TARGET_OCTEON) /* ISA has conditional trap instructions. */ #define ISA_HAS_COND_TRAP (!ISA_MIPS1 \ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 18c4f6c9e7f..050535f6bc6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,26 @@ +2016-01-18 Joseph Myers + + * gcc.target/mips/mips-3d-1.c: Use forbid_cpu=octeon.* in + dg-options. + * gcc.target/mips/mips-3d-2.c: Likewise. + * gcc.target/mips/mips-3d-3.c: Likewise. + * gcc.target/mips/mips-3d-4.c: Likewise. + * gcc.target/mips/mips-3d-5.c: Likewise. + * gcc.target/mips/mips-3d-6.c: Likewise. + * gcc.target/mips/mips-3d-7.c: Likewise. + * gcc.target/mips/mips-3d-8.c: Likewise. + * gcc.target/mips/mips-3d-9.c: Likewise. + * gcc.target/mips/mips-ps-1.c: Likewise. + * gcc.target/mips/mips-ps-2.c: Likewise. + * gcc.target/mips/mips-ps-3.c: Likewise. + * gcc.target/mips/mips-ps-4.c: Likewise. + * gcc.target/mips/mips-ps-5.c: Likewise. + * gcc.target/mips/mips-ps-6.c: Likewise. + * gcc.target/mips/mips-ps-7.c: Likewise. + * gcc.target/mips/mips-ps-type.c: Likewise. + * gcc.target/mips/mips-ps-type-2.c: Likewise. + * gcc.target/mips/mips16-attributes-6.c: Likewise. + 2016-01-18 Tom de Vries * c-c++-common/goacc/kernels-counter-vars-function-scope.c: New test. diff --git a/gcc/testsuite/gcc.target/mips/mips-3d-1.c b/gcc/testsuite/gcc.target/mips/mips-3d-1.c index f11ffc5a80f..9c675130927 100644 --- a/gcc/testsuite/gcc.target/mips/mips-3d-1.c +++ b/gcc/testsuite/gcc.target/mips/mips-3d-1.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-mips3d" } */ +/* { dg-options "-mips3d forbid_cpu=octeon.*" } */ /* Test MIPS-3D builtin functions */ #include diff --git a/gcc/testsuite/gcc.target/mips/mips-3d-2.c b/gcc/testsuite/gcc.target/mips/mips-3d-2.c index b04c3bfb5d5..4da059f9ec0 100644 --- a/gcc/testsuite/gcc.target/mips/mips-3d-2.c +++ b/gcc/testsuite/gcc.target/mips/mips-3d-2.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-mips3d" } */ +/* { dg-options "-mips3d forbid_cpu=octeon.*" } */ /* Test MIPS-3D branch-if-any-two builtin functions */ #include diff --git a/gcc/testsuite/gcc.target/mips/mips-3d-3.c b/gcc/testsuite/gcc.target/mips/mips-3d-3.c index e4de8fb19bf..fcdcf24e6c0 100644 --- a/gcc/testsuite/gcc.target/mips/mips-3d-3.c +++ b/gcc/testsuite/gcc.target/mips/mips-3d-3.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-mips3d" } */ +/* { dg-options "-mips3d forbid_cpu=octeon.*" } */ /* Test MIPS-3D absolute compare builtin functions */ #include diff --git a/gcc/testsuite/gcc.target/mips/mips-3d-4.c b/gcc/testsuite/gcc.target/mips/mips-3d-4.c index 3d28d7f2c66..340921c586e 100644 --- a/gcc/testsuite/gcc.target/mips/mips-3d-4.c +++ b/gcc/testsuite/gcc.target/mips/mips-3d-4.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-mips3d" } */ +/* { dg-options "-mips3d forbid_cpu=octeon.*" } */ /* Test MIPS-3D branch-if-any-four builtin functions */ #include diff --git a/gcc/testsuite/gcc.target/mips/mips-3d-5.c b/gcc/testsuite/gcc.target/mips/mips-3d-5.c index a433675cab9..e7dbfebef63 100644 --- a/gcc/testsuite/gcc.target/mips/mips-3d-5.c +++ b/gcc/testsuite/gcc.target/mips/mips-3d-5.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-mips3d" } */ +/* { dg-options "-mips3d forbid_cpu=octeon.*" } */ /* Test MIPS-3D absolute-compare & branch-if-any-four builtin functions */ #include diff --git a/gcc/testsuite/gcc.target/mips/mips-3d-6.c b/gcc/testsuite/gcc.target/mips/mips-3d-6.c index e6b44f07585..d75faa1a91b 100644 --- a/gcc/testsuite/gcc.target/mips/mips-3d-6.c +++ b/gcc/testsuite/gcc.target/mips/mips-3d-6.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-mips3d" } */ +/* { dg-options "-mips3d forbid_cpu=octeon.*" } */ /* Test MIPS-3D absolute compare (floats) builtin functions */ #include diff --git a/gcc/testsuite/gcc.target/mips/mips-3d-7.c b/gcc/testsuite/gcc.target/mips/mips-3d-7.c index 2531ddf8b1a..8e69d49b122 100644 --- a/gcc/testsuite/gcc.target/mips/mips-3d-7.c +++ b/gcc/testsuite/gcc.target/mips/mips-3d-7.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-mips3d" } */ +/* { dg-options "-mips3d forbid_cpu=octeon.*" } */ /* Test MIPS-3D absolute compare (doubles) builtin functions */ #include diff --git a/gcc/testsuite/gcc.target/mips/mips-3d-8.c b/gcc/testsuite/gcc.target/mips/mips-3d-8.c index 1d199d7d0c0..0ad8c482aa1 100644 --- a/gcc/testsuite/gcc.target/mips/mips-3d-8.c +++ b/gcc/testsuite/gcc.target/mips/mips-3d-8.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-mips3d" } */ +/* { dg-options "-mips3d forbid_cpu=octeon.*" } */ /* Test MIPS-3D absolute compare and conditional move builtin functions */ #include diff --git a/gcc/testsuite/gcc.target/mips/mips-3d-9.c b/gcc/testsuite/gcc.target/mips/mips-3d-9.c index d697efdedf1..0c302528506 100644 --- a/gcc/testsuite/gcc.target/mips/mips-3d-9.c +++ b/gcc/testsuite/gcc.target/mips/mips-3d-9.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-mips3d" } */ +/* { dg-options "-mips3d forbid_cpu=octeon.*" } */ /* Matrix Multiplications */ #include diff --git a/gcc/testsuite/gcc.target/mips/mips-ps-1.c b/gcc/testsuite/gcc.target/mips/mips-ps-1.c index 73598a840bd..980dd05db84 100644 --- a/gcc/testsuite/gcc.target/mips/mips-ps-1.c +++ b/gcc/testsuite/gcc.target/mips/mips-ps-1.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-mpaired-single" } */ +/* { dg-options "-mpaired-single forbid_cpu=octeon.*" } */ /* Test v2sf calculations */ #include diff --git a/gcc/testsuite/gcc.target/mips/mips-ps-2.c b/gcc/testsuite/gcc.target/mips/mips-ps-2.c index 52642558664..654aa062d80 100644 --- a/gcc/testsuite/gcc.target/mips/mips-ps-2.c +++ b/gcc/testsuite/gcc.target/mips/mips-ps-2.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-mpaired-single" } */ +/* { dg-options "-mpaired-single forbid_cpu=octeon.*" } */ /* Test MIPS paired-single builtin functions */ #include diff --git a/gcc/testsuite/gcc.target/mips/mips-ps-3.c b/gcc/testsuite/gcc.target/mips/mips-ps-3.c index 7e6ffd0667b..fc892a805a1 100644 --- a/gcc/testsuite/gcc.target/mips/mips-ps-3.c +++ b/gcc/testsuite/gcc.target/mips/mips-ps-3.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-mpaired-single" } */ +/* { dg-options "-mpaired-single forbid_cpu=octeon.*" } */ /* Test MIPS paired-single conditional move */ #include diff --git a/gcc/testsuite/gcc.target/mips/mips-ps-4.c b/gcc/testsuite/gcc.target/mips/mips-ps-4.c index 06850adb300..7871e56d2b9 100644 --- a/gcc/testsuite/gcc.target/mips/mips-ps-4.c +++ b/gcc/testsuite/gcc.target/mips/mips-ps-4.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-mpaired-single" } */ +/* { dg-options "-mpaired-single forbid_cpu=octeon.*" } */ /* Test MIPS paired-single comparisons */ #include diff --git a/gcc/testsuite/gcc.target/mips/mips-ps-5.c b/gcc/testsuite/gcc.target/mips/mips-ps-5.c index 077076f4736..4499e54ed1e 100644 --- a/gcc/testsuite/gcc.target/mips/mips-ps-5.c +++ b/gcc/testsuite/gcc.target/mips/mips-ps-5.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mpaired-single -mgp64 -ftree-vectorize" } */ +/* { dg-options "-mpaired-single -mgp64 -ftree-vectorize forbid_cpu=octeon.*" } */ /* { dg-skip-if "requires vectorization" { *-*-* } { "-O0" "-Os" } { "" } } */ extern float a[] __attribute__ ((aligned (8))); diff --git a/gcc/testsuite/gcc.target/mips/mips-ps-6.c b/gcc/testsuite/gcc.target/mips/mips-ps-6.c index 5bdfe436f40..42c1756136f 100644 --- a/gcc/testsuite/gcc.target/mips/mips-ps-6.c +++ b/gcc/testsuite/gcc.target/mips/mips-ps-6.c @@ -1,7 +1,7 @@ /* mips-ps-2.c with an extra -ffinite-math-only option. This option changes the way that abs.ps is handled. */ /* { dg-do run } */ -/* { dg-options "-mpaired-single -ffinite-math-only" } */ +/* { dg-options "-mpaired-single -ffinite-math-only forbid_cpu=octeon.*" } */ /* Test MIPS paired-single builtin functions */ #include diff --git a/gcc/testsuite/gcc.target/mips/mips-ps-7.c b/gcc/testsuite/gcc.target/mips/mips-ps-7.c index 3b4e5308598..29e29aa1050 100644 --- a/gcc/testsuite/gcc.target/mips/mips-ps-7.c +++ b/gcc/testsuite/gcc.target/mips/mips-ps-7.c @@ -1,6 +1,6 @@ /* mips-ps-5.c with -mgp32 instead of -mgp64. */ /* { dg-do compile } */ -/* { dg-options "-mgp32 -mpaired-single -ftree-vectorize" } */ +/* { dg-options "-mgp32 -mpaired-single -ftree-vectorize forbid_cpu=octeon.*" } */ /* { dg-skip-if "requires vectorization" { *-*-* } { "-O0" "-Os" } { "" } } */ extern float a[] __attribute__ ((aligned (8))); diff --git a/gcc/testsuite/gcc.target/mips/mips-ps-type-2.c b/gcc/testsuite/gcc.target/mips/mips-ps-type-2.c index a4dfbaea645..6aba81507e7 100644 --- a/gcc/testsuite/gcc.target/mips/mips-ps-type-2.c +++ b/gcc/testsuite/gcc.target/mips/mips-ps-type-2.c @@ -1,7 +1,7 @@ /* Test v2sf calculations. The nmadd and nmsub patterns need -ffinite-math-only. */ /* { dg-do compile } */ -/* { dg-options "(HAS_MADDPS) -mgp32 -mpaired-single -ffinite-math-only" } */ +/* { dg-options "(HAS_MADDPS) -mgp32 -mpaired-single -ffinite-math-only forbid_cpu=octeon.*" } */ /* { dg-skip-if "nmadd and nmsub need combine" { *-*-* } { "-O0" } { "" } } */ /* { dg-final { scan-assembler "\tcvt.ps.s\t" } } */ /* { dg-final { scan-assembler "\tmov.ps\t" } } */ diff --git a/gcc/testsuite/gcc.target/mips/mips-ps-type.c b/gcc/testsuite/gcc.target/mips/mips-ps-type.c index c36dc25c9d9..454ffc34957 100644 --- a/gcc/testsuite/gcc.target/mips/mips-ps-type.c +++ b/gcc/testsuite/gcc.target/mips/mips-ps-type.c @@ -1,7 +1,7 @@ /* Test v2sf calculations. The nmadd and nmsub patterns need -ffinite-math-only. */ /* { dg-do compile } */ -/* { dg-options "-mpaired-single -mgp64 -ffinite-math-only" } */ +/* { dg-options "-mpaired-single -mgp64 -ffinite-math-only forbid_cpu=octeon.*" } */ /* { dg-skip-if "nmadd and nmsub need combine" { *-*-* } { "-O0" } { "" } } */ /* { dg-final { scan-assembler "\tcvt.ps.s\t" } } */ /* { dg-final { scan-assembler "\tmov.ps\t" } } */ diff --git a/gcc/testsuite/gcc.target/mips/mips16-attributes-6.c b/gcc/testsuite/gcc.target/mips/mips16-attributes-6.c index 99bdf8c3ef6..12f3ad0fee1 100644 --- a/gcc/testsuite/gcc.target/mips/mips16-attributes-6.c +++ b/gcc/testsuite/gcc.target/mips/mips16-attributes-6.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mips16 addressing=absolute -mips3d" } */ +/* { dg-options "-mips16 addressing=absolute -mips3d forbid_cpu=octeon.*" } */ static inline NOMIPS16 float i1 (float f) -- 2.11.4.GIT