Handle Octeon 3 not supporting MIPS paired-single instructions.
authorJoseph Myers <joseph@codesourcery.com>
Mon, 18 Jan 2016 13:30:43 +0000 (13:30 +0000)
committerJoseph Myers <jsm28@gcc.gnu.org>
Mon, 18 Jan 2016 13:30:43 +0000 (13:30 +0000)
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.

From-SVN: r232517

22 files changed:
gcc/ChangeLog
gcc/config/mips/mips.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/mips/mips-3d-1.c
gcc/testsuite/gcc.target/mips/mips-3d-2.c
gcc/testsuite/gcc.target/mips/mips-3d-3.c
gcc/testsuite/gcc.target/mips/mips-3d-4.c
gcc/testsuite/gcc.target/mips/mips-3d-5.c
gcc/testsuite/gcc.target/mips/mips-3d-6.c
gcc/testsuite/gcc.target/mips/mips-3d-7.c
gcc/testsuite/gcc.target/mips/mips-3d-8.c
gcc/testsuite/gcc.target/mips/mips-3d-9.c
gcc/testsuite/gcc.target/mips/mips-ps-1.c
gcc/testsuite/gcc.target/mips/mips-ps-2.c
gcc/testsuite/gcc.target/mips/mips-ps-3.c
gcc/testsuite/gcc.target/mips/mips-ps-4.c
gcc/testsuite/gcc.target/mips/mips-ps-5.c
gcc/testsuite/gcc.target/mips/mips-ps-6.c
gcc/testsuite/gcc.target/mips/mips-ps-7.c
gcc/testsuite/gcc.target/mips/mips-ps-type-2.c
gcc/testsuite/gcc.target/mips/mips-ps-type.c
gcc/testsuite/gcc.target/mips/mips16-attributes-6.c

index d011a4ffa9b98f797732178386d884d174ab7e30..972ddec81828b7dd70af54f9204d352bfd9a269e 100644 (file)
@@ -1,3 +1,8 @@
+2016-01-18  Joseph Myers  <joseph@codesourcery.com>
+
+       * config/mips/mips.h (ISA_HAS_PAIRED_SINGLE): Require
+       !TARGET_OCTEON.
+
 2016-01-18  Richard Biener  <rguenther@suse.de>
 
        PR middle-end/69308
index 3097a416668544672997f337246b9a2fc76c6107..803ab98e760a61c268f026ac05982bd60e0f8ddb 100644 (file)
@@ -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                             \
index 18c4f6c9e7f4c3294905e3f2f48c115e949fc084..050535f6bc6236b401b0c85dcad3aa01d036b57e 100644 (file)
@@ -1,3 +1,26 @@
+2016-01-18  Joseph Myers  <joseph@codesourcery.com>
+
+       * 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  <tom@codesourcery.com>
 
        * c-c++-common/goacc/kernels-counter-vars-function-scope.c: New test.
index f11ffc5a80f3e545a3a3e0224984c0da2d52c559..9c675130927961ad77f687447c51819dac8ad049 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-options "-mips3d" } */
+/* { dg-options "-mips3d forbid_cpu=octeon.*" } */
 
 /* Test MIPS-3D builtin functions */
 #include <stdlib.h>
index b04c3bfb5d547462c6ca937e0efc3741b2931403..4da059f9ec076175b430fb311a0684a905fe1290 100644 (file)
@@ -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 <stdlib.h>
index e4de8fb19bf2f5a0c8c41dcc7e24b523a55911ef..fcdcf24e6c0e7206eaca838b89a97c5b25e77eab 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-options "-mips3d" } */
+/* { dg-options "-mips3d forbid_cpu=octeon.*" } */
 
 /* Test MIPS-3D absolute compare builtin functions */
 #include <stdlib.h>
index 3d28d7f2c661683ee2c6fb949c9597dd44113da4..340921c586e709b2b24549fbad9ce08a71731b23 100644 (file)
@@ -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 <stdlib.h>
index a433675cab9b3814169aac3a53a01cd18394fe30..e7dbfebef639aeaf5112d6dd2b7c2c332764814e 100644 (file)
@@ -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 <stdlib.h>
index e6b44f075851b0df9ee6263fd66ef08bf4ec6936..d75faa1a91b17cf2c7ce361c90535d5b37e853b3 100644 (file)
@@ -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 <stdlib.h>
index 2531ddf8b1ae93771419a19b7e3741b14a93bb33..8e69d49b1222be74916f5fdc2482b97cfbf4cef1 100644 (file)
@@ -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 <stdlib.h>
index 1d199d7d0c0897d3e184e839eb491cb9787667e9..0ad8c482aa1fa6e374141d68d341dbb29c0ce5c2 100644 (file)
@@ -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 <stdlib.h>
index d697efdedf12e6e4b8263bc525abb9d0a65e63e4..0c30252850645d5dd421bbbfb37199ff21553441 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-options "-mips3d" } */
+/* { dg-options "-mips3d forbid_cpu=octeon.*" } */
 
 /* Matrix Multiplications */
 #include <stdlib.h>
index 73598a840bd724cf44f15001c0199ee1b0e356ef..980dd05db84f4bdb8fb9e4e179046364ea9442d4 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-options "-mpaired-single" } */
+/* { dg-options "-mpaired-single forbid_cpu=octeon.*" } */
 
 /* Test v2sf calculations */
 #include <stdlib.h>
index 52642558664fb82a062e979377c49a8d38018a15..654aa062d8031521ea50c3a25fc482a6de15555b 100644 (file)
@@ -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 <stdlib.h>
index 7e6ffd0667b0608d262548975558f7e05aca7f18..fc892a805a1c555b26124133d33d196f715a2efd 100644 (file)
@@ -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 <stdlib.h>
index 06850adb300370572a144ec53b4277b827562a82..7871e56d2b9e4ab36affa3bdf3876ab5ee7c2808 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-options "-mpaired-single" } */
+/* { dg-options "-mpaired-single forbid_cpu=octeon.*" } */
 
 /* Test MIPS paired-single comparisons */
 #include <stdlib.h>
index 077076f4736cd816f8cacf675d5da06b72485a0b..4499e54ed1eaa74be507e4921986e5378c2c6675 100644 (file)
@@ -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)));
index 5bdfe436f40a86544e1b973464f6e4f3f5750180..42c1756136faf15639937e3c86dedbe35d7a4ff8 100644 (file)
@@ -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 <stdlib.h>
index 3b4e530859893486aa02af31a4bc66fcbb15104a..29e29aa1050adada33cc18f4932bd42cd46adc93 100644 (file)
@@ -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)));
index a4dfbaea645d08ffee5a8a060b46f5e950a76778..6aba81507e7b587da1f110901b59281db3025acb 100644 (file)
@@ -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" } } */
index c36dc25c9d932a71717c0901819c3771f652e58f..454ffc349571ba5e6c9716c0647bb04d38d05f27 100644 (file)
@@ -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" } } */
index 99bdf8c3ef6103e2f4754a2a8424291b7011ce12..12f3ad0fee1042a310c4d3ae5cd118db7ab9640e 100644 (file)
@@ -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)