]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
mips.exp: Minor formatting.
authorRichard Sandiford <rsandifo@redhat.com>
Mon, 18 Apr 2005 20:34:36 +0000 (20:34 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Mon, 18 Apr 2005 20:34:36 +0000 (20:34 +0000)
* gcc.target/mips/mips.exp: Minor formatting.  Call setup_mips_tests.
(setup_mips_tests, dg-mips-options): New procedures.
* gcc.target/mips/asm-1.c, gcc.target/mips/fix-vr4130-1.c,
* gcc.target/mips/fix-vr4130-2.c, gcc.target/mips/fix-vr4130-3.c
* gcc.target/mips/fix-vr4130-4.c, gcc.target/mips/mips-3d-1.c,
* gcc.target/mips/mips-3d-2.c, gcc.target/mips/mips-3d-3.c,
* gcc.target/mips/mips-3d-4.c, gcc.target/mips/mips-3d-5.c,
* gcc.target/mips/mips-3d-6.c, gcc.target/mips/mips-3d-7.c,
* gcc.target/mips/mips-3d-8.c, gcc.target/mips/mips-3d-9.c,
* gcc.target/mips/mips-3d-2.c, gcc.target/mips/mips-3d-3.c,
* gcc.target/mips/mips-ps-1.c, gcc.target/mips/mips-ps-2.c,
* gcc.target/mips/mips-ps-3.c, gcc.target/mips/mips-ps-4.c,
* gcc.target/mips/mips-ps-type.c, gcc.target/mips/sb1-1.c: Use
dg-mips-options instead of dg-options.  Remove now-redundant
preprocessor guards.
* gcc.dg/mips-args-1.c, gcc.dg/mips-args-2.c, gcc.dg/mips-args-3.c,
* gcc.dg/mips-movcc-1.c, gcc.dg/mips-movcc-2.c, gcc.dg/mips-movcc-3.c,
* gcc.dg/mips-nmadd-1.c, gcc.dg/mips-nmadd-2.c, gcc.dg/mips-rsqrt-1.c,
* gcc.dg/mips-rsqrt-2.c, gcc.dg/mips-rsqrt-3.c, gcc.dg/vr-mult-1.c,
* gcc.dg/vr-mult-2.c: Delete.
* gcc.target/mips/args-1.c, gcc.target/mips/args-2.c,
* gcc.target/mips/args-3.c, gcc.target/mips/movcc-1.c,
* gcc.target/mips/movcc-2.c, gcc.target/mips/movcc-3.c,
* gcc.target/mips/nmadd-1.c, gcc.target/mips/nmadd-2.c,
* gcc.target/mips/rsqrt-1.c, gcc.target/mips/rsqrt-2.c,
* gcc.target/mips/rsqrt-3.c, gcc.target/mips/vr-mult-1.c,
* gcc.target/mips/vr-mult-2.c: New tests, based on the old gcc.dg ones.

From-SVN: r98345

39 files changed:
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/mips-movcc-1.c [deleted file]
gcc/testsuite/gcc.dg/mips-movcc-2.c [deleted file]
gcc/testsuite/gcc.dg/vr-mult-1.c [deleted file]
gcc/testsuite/gcc.dg/vr-mult-2.c [deleted file]
gcc/testsuite/gcc.target/mips/args-1.c [moved from gcc/testsuite/gcc.dg/mips-args-1.c with 95% similarity]
gcc/testsuite/gcc.target/mips/args-2.c [moved from gcc/testsuite/gcc.dg/mips-args-2.c with 87% similarity]
gcc/testsuite/gcc.target/mips/args-3.c [moved from gcc/testsuite/gcc.dg/mips-args-3.c with 95% similarity]
gcc/testsuite/gcc.target/mips/asm-1.c
gcc/testsuite/gcc.target/mips/fix-vr4130-1.c
gcc/testsuite/gcc.target/mips/fix-vr4130-2.c
gcc/testsuite/gcc.target/mips/fix-vr4130-3.c
gcc/testsuite/gcc.target/mips/fix-vr4130-4.c
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-type.c
gcc/testsuite/gcc.target/mips/mips.exp
gcc/testsuite/gcc.target/mips/movcc-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/mips/movcc-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/mips/movcc-3.c [moved from gcc/testsuite/gcc.dg/mips-movcc-3.c with 69% similarity]
gcc/testsuite/gcc.target/mips/nmadd-1.c [moved from gcc/testsuite/gcc.dg/mips-nmadd-1.c with 70% similarity]
gcc/testsuite/gcc.target/mips/nmadd-2.c [moved from gcc/testsuite/gcc.dg/mips-nmadd-2.c with 69% similarity]
gcc/testsuite/gcc.target/mips/rsqrt-1.c [moved from gcc/testsuite/gcc.dg/mips-rsqrt-1.c with 56% similarity]
gcc/testsuite/gcc.target/mips/rsqrt-2.c [moved from gcc/testsuite/gcc.dg/mips-rsqrt-2.c with 56% similarity]
gcc/testsuite/gcc.target/mips/rsqrt-3.c [moved from gcc/testsuite/gcc.dg/mips-rsqrt-3.c with 81% similarity]
gcc/testsuite/gcc.target/mips/sb1-1.c
gcc/testsuite/gcc.target/mips/vr-mult-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/mips/vr-mult-2.c [new file with mode: 0644]

index 8ca1eb0beadd95d3ba1f9ce5dbd5b6e31b0bb828..28dfc14202846e01e26fb51a71461fcb623cd930 100644 (file)
@@ -1,3 +1,33 @@
+2005-04-18  Richard Sandiford  <rsandifo@redhat.com>
+
+       * gcc.target/mips/mips.exp: Minor formatting.  Call setup_mips_tests.
+       (setup_mips_tests, dg-mips-options): New procedures.
+       * gcc.target/mips/asm-1.c, gcc.target/mips/fix-vr4130-1.c,
+       * gcc.target/mips/fix-vr4130-2.c, gcc.target/mips/fix-vr4130-3.c
+       * gcc.target/mips/fix-vr4130-4.c, gcc.target/mips/mips-3d-1.c,
+       * gcc.target/mips/mips-3d-2.c, gcc.target/mips/mips-3d-3.c,
+       * gcc.target/mips/mips-3d-4.c, gcc.target/mips/mips-3d-5.c,
+       * gcc.target/mips/mips-3d-6.c, gcc.target/mips/mips-3d-7.c,
+       * gcc.target/mips/mips-3d-8.c, gcc.target/mips/mips-3d-9.c,
+       * gcc.target/mips/mips-3d-2.c, gcc.target/mips/mips-3d-3.c,
+       * gcc.target/mips/mips-ps-1.c, gcc.target/mips/mips-ps-2.c,
+       * gcc.target/mips/mips-ps-3.c, gcc.target/mips/mips-ps-4.c,
+       * gcc.target/mips/mips-ps-type.c, gcc.target/mips/sb1-1.c: Use
+       dg-mips-options instead of dg-options.  Remove now-redundant
+       preprocessor guards.
+       * gcc.dg/mips-args-1.c, gcc.dg/mips-args-2.c, gcc.dg/mips-args-3.c,
+       * gcc.dg/mips-movcc-1.c, gcc.dg/mips-movcc-2.c, gcc.dg/mips-movcc-3.c,
+       * gcc.dg/mips-nmadd-1.c, gcc.dg/mips-nmadd-2.c, gcc.dg/mips-rsqrt-1.c,
+       * gcc.dg/mips-rsqrt-2.c, gcc.dg/mips-rsqrt-3.c, gcc.dg/vr-mult-1.c,
+       * gcc.dg/vr-mult-2.c: Delete.
+       * gcc.target/mips/args-1.c, gcc.target/mips/args-2.c,
+       * gcc.target/mips/args-3.c, gcc.target/mips/movcc-1.c,
+       * gcc.target/mips/movcc-2.c, gcc.target/mips/movcc-3.c,
+       * gcc.target/mips/nmadd-1.c, gcc.target/mips/nmadd-2.c,
+       * gcc.target/mips/rsqrt-1.c, gcc.target/mips/rsqrt-2.c,
+       * gcc.target/mips/rsqrt-3.c, gcc.target/mips/vr-mult-1.c,
+       * gcc.target/mips/vr-mult-2.c: New tests, based on the old gcc.dg ones.
+
 2005-04-18  Laurent GUERBY  <laurent@guerby.net>
 
        * ada/acats/run_all.sh: Use sync when executable not present.
diff --git a/gcc/testsuite/gcc.dg/mips-movcc-1.c b/gcc/testsuite/gcc.dg/mips-movcc-1.c
deleted file mode 100644 (file)
index 70a7dc7..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/* { dg-do compile { target "mips*-*-*" } } */
-/* { dg-options "-O2 -mips4" } */
-/* { dg-final { scan-assembler "movz" } } */
-/* { dg-final { scan-assembler "movn" } } */
-/* { dg-final { scan-assembler "movt" } } */
-
-void ext_int (int);
-
-#if __mips < 4
-asm ("# movz movn");
-#else
-int
-sub1 (int i, int j, int k)
-{
-  ext_int (k ? i : j);
-}
-
-int
-sub2 (int i, int j, long l)
-{
-  ext_int (!l ? i : j);
-}
-#endif
-
-#if __mips < 4 || __mips_soft_float
-asm ("# movt");
-#else
-int
-sub3 (int i, int j, float f)
-{
-  ext_int (f ? i : j);
-}
-#endif
diff --git a/gcc/testsuite/gcc.dg/mips-movcc-2.c b/gcc/testsuite/gcc.dg/mips-movcc-2.c
deleted file mode 100644 (file)
index 22d58e9..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/* { dg-do compile { target "mips*-*-*" } } */
-/* { dg-options "-O2 -mips4" } */
-/* { dg-final { scan-assembler "movz" } } */
-/* { dg-final { scan-assembler "movn" } } */
-/* { dg-final { scan-assembler "movf" } } */
-
-void ext_long (long);
-
-#if __mips < 4
-asm ("# movz movn");
-#else
-long
-sub4 (long i, long j, long k)
-{
-  ext_long (k ? i : j);
-}
-
-long
-sub5 (long i, long j, int k)
-{
-  ext_long (!k ? i : j);
-}
-#endif
-
-#if __mips < 4 || __mips_soft_float
-asm ("# movf");
-#else
-long
-sub6 (long i, long j, float f)
-{
-  ext_long (!f ? i : j);
-}
-#endif
diff --git a/gcc/testsuite/gcc.dg/vr-mult-1.c b/gcc/testsuite/gcc.dg/vr-mult-1.c
deleted file mode 100644 (file)
index a208067..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Make sure that mul/addu is preferred over mtlo/macc on targets that
-   support both.  */
-/* { dg-do compile { target mips*-*-* } } */
-/* { dg-options "-O2" } */
-#if defined (_MIPS_ARCH_VR5400) || defined (_MIPS_ARCH_VR5500)
-int f (int a, int b, int c) { return a + b * c; }
-#else
-void f () { asm volatile ("mul/addu"); }
-#endif
-/* { dg-final { scan-assembler "mul.*addu" } } */
diff --git a/gcc/testsuite/gcc.dg/vr-mult-2.c b/gcc/testsuite/gcc.dg/vr-mult-2.c
deleted file mode 100644 (file)
index 4a3ad98..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Make sure that mul/subu is preferred over mtlo/msac on targets that
-   support both.  */
-/* { dg-do compile { target mips*-*-* } } */
-/* { dg-options "-O2" } */
-#if defined (_MIPS_ARCH_VR5400) || defined (_MIPS_ARCH_VR5500)
-int f (int a, int b, int c) { return a - b * c; }
-#else
-void f () { asm volatile ("mul/subu"); }
-#endif
-/* { dg-final { scan-assembler "mul.*subu" } } */
similarity index 95%
rename from gcc/testsuite/gcc.dg/mips-args-1.c
rename to gcc/testsuite/gcc.target/mips/args-1.c
index 891843ec7fa1d0aedbb8f5988bf42e4dff6cbed7..56def9488a347c083a706b0fd06e1b68ae665ac1 100644 (file)
@@ -1,6 +1,6 @@
 /* Check that certain preprocessor macros are defined, and do some
    consistency checks.  */
-/* { dg-do compile { target mips*-*-* } } */
+/* { dg-do compile } */
 
 const char *compiled_for = _MIPS_ARCH;
 const char *optimized_for = _MIPS_TUNE;
similarity index 87%
rename from gcc/testsuite/gcc.dg/mips-args-2.c
rename to gcc/testsuite/gcc.target/mips/args-2.c
index c34751c1c512fba827ba13436f22065431b13363..192756525f8b4578709e261f43aa3e8db4d154fa 100644 (file)
@@ -1,5 +1,5 @@
 /* Check the _MIPSEB and _MIPSEL macros are accurate.  */
-/* { dg-do run { target mips*-*-* } } */
+/* { dg-do run } */
 extern void abort (void);
 extern void exit (int);
 
similarity index 95%
rename from gcc/testsuite/gcc.dg/mips-args-3.c
rename to gcc/testsuite/gcc.target/mips/args-3.c
index e1fde8646dfc3e10786edf5f33bee369bedb00d4..e91816f08066e1fccfc5276d2a98a56c7ba3dd3d 100644 (file)
@@ -1,6 +1,6 @@
 /* __mips, and related defines, guarantee that certain assembly
    instructions can be used.  Check a few examples.  */
-/* { dg-do run { target mips*-*-* } } */
+/* { dg-do run } */
 extern void abort (void);
 extern void exit (int);
 
index 008290572d3060857c08d40a8b4ee40cc2c833b1..aed5b8cb285cee4808f489e2db2ff41009e98e44 100644 (file)
@@ -1,8 +1,7 @@
 /* PR target/17565.  GCC used to put the asm into the delay slot
    of the call.  */
 /* { dg-do assemble } */
-/* { dg-options "-O" } */
-#ifndef __mips16
+/* { dg-mips-options "-O -mno-mips16" } */
 int foo (int n)
 {
   register int k asm ("$16") = n;
@@ -13,4 +12,3 @@ int foo (int n)
     }
   return k;
 }
-#endif
index d6d2a5ad7f32d226c53fececf8cbbc0a49f8f71e..1ddf547f702902c8cc00701e03d934ca3b1c5a04 100644 (file)
@@ -1,9 +1,4 @@
-/* { dg-do compile { target mips*-*-* } } */
-/* { dg-skip-if "" { mips-sgi-irix* } { "-mabi=32" } { "" } } */
-/* { dg-options "-mfix-vr4130 -march=vr4130" } */
-#if _MIPS_ARCH_VR4130 && !__mips16
+/* { dg-do compile } */
+/* { dg-mips-options "-march=vr4130 -mfix-vr4130" } */
 int foo (void) { int r; asm ("# foo" : "=h" (r)); return r; }
-#else
-asm ("#\tmacchi\t");
-#endif
 /* { dg-final { scan-assembler "\tmacchi\t" } } */
index dcb48998425db321608e0356d5e140c00b3cc3de..633eae691e667f20f4aae4766224310095ddbf36 100644 (file)
@@ -1,9 +1,4 @@
-/* { dg-do compile { target mips*-*-* } } */
-/* { dg-skip-if "" { mips-sgi-irix* } { "-mabi=32" } { "" } } */
-/* { dg-options "-mfix-vr4130 -march=vr4130" } */
-#if _MIPS_ARCH_VR4130 && !__mips16
+/* { dg-do compile } */
+/* { dg-mips-options "-march=vr4130 -mfix-vr4130" } */
 int foo (void) { int r; asm ("# foo" : "=l" (r)); return r; }
-#else
-asm ("#\tmacc\t");
-#endif
 /* { dg-final { scan-assembler "\tmacc\t" } } */
index ff258bab897b8a726d101ebe8d159dbbb7d1ad11..58f07b576bb1cbf01925dbed00e4af52afea9555 100644 (file)
@@ -1,9 +1,4 @@
-/* { dg-do compile { target mips*-*-* } } */
-/* { dg-skip-if "" { mips-sgi-irix* } { "-mabi=32" } { "" } } */
-/* { dg-options "-mfix-vr4130 -march=vr4130" } */
-#if _MIPS_ARCH_VR4130 && !__mips16 && __mips64
+/* { dg-do compile } */
+/* { dg-mips-options "-march=vr4130 -mgp64 -mfix-vr4130" } */
 long long foo (void) { long long r; asm ("# foo" : "=h" (r)); return r; }
-#else
-asm ("#\tdmacchi\t");
-#endif
 /* { dg-final { scan-assembler "\tdmacchi\t" } } */
index acb2d0807f3a434a6a9dc0ef808bb61867e206bb..64752a8dcfe804649808eff0a5a484a5a1878c8e 100644 (file)
@@ -1,9 +1,4 @@
-/* { dg-do compile { target mips*-*-* } } */
-/* { dg-skip-if "" { mips-sgi-irix* } { "-mabi=32" } { "" } } */
-/* { dg-options "-mfix-vr4130 -march=vr4130" } */
-#if _MIPS_ARCH_VR4130 && !__mips16 && __mips64
+/* { dg-do compile } */
+/* { dg-mips-options "-march=vr4130 -mgp64 -mfix-vr4130" } */
 long long foo (void) { long long r; asm ("# foo" : "=l" (r)); return r; }
-#else
-asm ("#\tdmacc\t");
-#endif
 /* { dg-final { scan-assembler "\tdmacc\t" } } */
index c351d8c63a5d1713243d0f2127f365b8395f568e..765bc49108491093a1ab985238f9f4b04110be14 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run { target mipsisa64*-*-* } } */
-/* { dg-options "-mips64 -O2 -mips3d -mhard-float -mfp64" } */
+/* { dg-mips-options "-mips64 -O2 -mips3d -mhard-float -mgp64" } */
 
 /* Test MIPS-3D builtin functions */
 #include <stdlib.h>
index e34022c7a4956ba6334a0a1ebfc08e357f6d623a..fc70fa2de073fad9eab4743e4fec7410775487f6 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run { target mipsisa64*-*-* } } */
-/* { dg-options "-mips64 -O2 -mips3d -mhard-float -mfp64" } */
+/* { dg-mips-options "-mips64 -O2 -mips3d -mhard-float -mgp64" } */
 
 /* Test MIPS-3D branch-if-any-two builtin functions */
 #include <stdlib.h>
index 7044fc952f0e8bdec358478c332e130557d381ec..81d6c25f93c20ac30a87366a745fa6cb419d444c 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run { target mipsisa64*-*-* } } */
-/* { dg-options "-mips64 -O2 -mips3d -mhard-float -mfp64" } */
+/* { dg-mips-options "-mips64 -O2 -mips3d -mhard-float -mgp64" } */
 
 /* Test MIPS-3D absolute compare builtin functions */
 #include <stdlib.h>
index 9723047ff834690ce8e92f1f4fe167824c8bb505..b2b6bfe14d52817db57cc3007a84d1747a9ed702 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run { target mipsisa64*-*-* } } */
-/* { dg-options "-mips64 -O2 -mips3d -mhard-float -mfp64" } */
+/* { dg-mips-options "-mips64 -O2 -mips3d -mhard-float -mgp64" } */
 
 /* Test MIPS-3D branch-if-any-four builtin functions */
 #include <stdlib.h>
index bd4c857037d815e2e2800a7cb20ef3283331d387..7dc6d28e0eae67ec049c8d78531cbe28c8a17359 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run { target mipsisa64*-*-* } } */
-/* { dg-options "-mips64 -O2 -mips3d -mhard-float -mfp64" } */
+/* { dg-mips-options "-mips64 -O2 -mips3d -mhard-float -mgp64" } */
 
 /* Test MIPS-3D absolute-compare & branch-if-any-four builtin functions */
 #include <stdlib.h>
index 0b54ef1fecbbffffa5e3087ae333a6da0ecad6d4..5a7622dd0e896a241c4d73a8109ad75943a52073 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run { target mipsisa64*-*-* } } */
-/* { dg-options "-mips64 -O2 -mips3d -mhard-float -mfp64" } */
+/* { dg-mips-options "-mips64 -O2 -mips3d -mhard-float -mgp64" } */
 
 /* Test MIPS-3D absolute compare (floats) builtin functions */
 #include <stdlib.h>
index 1d9a481ef6592d890989c3a4ed03de385259ab53..3a512f4a1136a1b486bc868ac36d77d7068135d9 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run { target mipsisa64*-*-* } } */
-/* { dg-options "-mips64 -O2 -mips3d -mhard-float -mfp64" } */
+/* { dg-mips-options "-mips64 -O2 -mips3d -mhard-float -mgp64" } */
 
 /* Test MIPS-3D absolute compare (doubles) builtin functions */
 #include <stdlib.h>
index 955c2664f904b8d8590ef643e7d947a2283d05a6..601e5ff30a4820997020f13a85e6c5168d17e841 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run { target mipsisa64*-*-* } } */
-/* { dg-options "-mips64 -O2 -mips3d -mhard-float -mfp64" } */
+/* { dg-mips-options "-mips64 -O2 -mips3d -mhard-float -mgp64" } */
 
 /* Test MIPS-3D absolute compare and conditional move builtin functions */
 #include <stdlib.h>
index 23a1f48f0fba8c1a1634abafd4e2f77c92461964..11d863f352d4d68c3907ae21062db88339d9c5b6 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run { target mipsisa64*-*-* } } */
-/* { dg-options "-mips64 -O2 -mips3d -mhard-float -mfp64" } */
+/* { dg-mips-options "-mips64 -O2 -mips3d -mhard-float -mgp64" } */
 
 /* Matrix Multiplications */
 #include <stdlib.h>
index 78f5384aeffd6045cf9c031ab6b2c42f8e3f9a35..1723933839f6d0d51f84d745c8e958b7c1482678 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run { target mipsisa64*-*-* } } */
-/* { dg-options "-mips64 -O2 -mpaired-single -mhard-float -mfp64" } */
+/* { dg-mips-options "-mips64 -O2 -mpaired-single -mhard-float -mgp64" } */
 
 /* Test v2sf calculations */
 #include <stdlib.h>
index ef639e612031da2d290d637d2289046f31d8dcf5..178bb910d8c40921764edf891135af875f70c9e3 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run { target mipsisa64*-*-* } } */
-/* { dg-options "-mips64 -O2 -mpaired-single -mhard-float -mfp64" } */
+/* { dg-mips-options "-mips64 -O2 -mpaired-single -mhard-float -mgp64" } */
 
 /* Test MIPS paired-single builtin functions */
 #include <stdlib.h>
index e4f4db2bdd765830436bb8b165e641dd22bd709d..8d29cc9b6be9805be5930f63a3a73382ec4e4bd1 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run { target mipsisa64*-*-* } } */
-/* { dg-options "-mips64 -O2 -mpaired-single -mhard-float -mfp64" } */
+/* { dg-mips-options "-mips64 -O2 -mpaired-single -mhard-float -mgp64" } */
 
 /* Test MIPS paired-single conditional move */
 #include <stdlib.h>
index 9e0677e7dfa2964fcc2f88981afdaad1a8504d7d..41c39dcaa22836c9abb1a5236842565187a92a99 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run { target mipsisa64*-*-* } } */
-/* { dg-options "-mips64 -O2 -mpaired-single -mhard-float -mfp64" } */
+/* { dg-mips-options "-mips64 -O2 -mpaired-single -mhard-float -mgp64" } */
 
 /* Test MIPS paired-single comparisons */
 #include <stdlib.h>
index b4d9a7b208547bb72f3c0739feef20d4c82d1985..cd5566fcbfa3e378999473e8900cf762eb877f81 100644 (file)
@@ -1,6 +1,6 @@
 /* Test v2sf calculations */
-/* { dg-do compile { target mipsisa64*-*-* } } */ 
-/* { dg-options "-mips64 -O2 -mpaired-single -mhard-float -mfp64" } */ 
+/* { dg-do compile } */ 
+/* { dg-mips-options "-mips64 -O2 -mpaired-single -mhard-float -mgp64" } */
 /* { dg-final { scan-assembler "cvt.ps.s" } } */ 
 /* { dg-final { scan-assembler "mov.ps" } } */ 
 /* { dg-final { scan-assembler "ldc1" } } */ 
index 56d1f4dbdb029d16175743a0c76f5179f1c5e471..4600cab0eb67e748ba68e65c2d869314d08fa54f 100644 (file)
 # GCC testsuite that uses the `dg.exp' driver.
 
 # Exit immediately if this isn't a MIPS target.
-if ![istarget mips*-*-*] then {
+if ![istarget mips*-*-*] {
   return
 }
 
 # Load support procs.
 load_lib gcc-dg.exp
 
-# If a testcase doesn't have special options, use these.
-global DEFAULT_CFLAGS
-if ![info exists DEFAULT_CFLAGS] then {
-    set DEFAULT_CFLAGS " -ansi -pedantic-errors"
+# Find out which target is selected by the default compiler flags.
+# Also remember which aspects of the target are forced on the command
+# line (as opposed to being overridable defaults).
+#
+#    $mips_isa:                 the ISA level specified by __mips
+#    $mips_arch:        the architecture specified by _MIPS_ARCH
+#    $mips_mips16:      true if MIPS16 mode is selected
+#    $mips_mips64:      true if 64-bit output is selected
+#    $mips_float:       "hard" or "soft"
+#
+#    $mips_forced_isa:  true if the command line uses -march=* or -mips*
+#    $mips_forced_abi:  true if the command line uses -mabi=* or -mgp*
+#    $mips_forced_float: true if the command line uses -mhard/soft-float
+proc setup_mips_tests {} {
+    global mips_isa
+    global mips_arch
+    global mips_mips16
+    global mips_mips64
+    global mips_float
+
+    global mips_forced_isa
+    global mips_forced_abi
+    global mips_forced_float
+
+    global compiler_flags
+    global tool
+
+    set src dummy[pid].c
+    set f [open $src "w"]
+    puts $f {
+       int isa = __mips;
+       const char *arch = _MIPS_ARCH;
+       #ifdef __mips16
+       int mips16 = 1;
+       #endif
+       #ifdef __mips64
+       int mips64 = 1;
+       #endif
+       #ifdef __mips_hard_float
+       const char *float = "hard";
+       #else
+       const char *float = "soft";
+       #endif
+    }
+    close $f
+    set output [${tool}_target_compile $src "" preprocess ""]
+    file delete $src
+
+    regexp {isa = ([^;]*)} $output dummy mips_isa
+    regexp {arch = "([^"]*)} $output dummy mips_arch
+    set mips_mips16 [regexp {mips16 = 1} $output]
+    set mips_mips64 [regexp {mips64 = 1} $output]
+    regexp {float = "([^"]*)} $output dummy mips_float
+
+    set mips_forced_isa [regexp -- {(-mips|-march)} $compiler_flags]
+    set mips_forced_abi [regexp -- {(-mgp|-mabi)} $compiler_flags]
+    set mips_forced_float [regexp -- {-m(hard|soft)-float} $compiler_flags]
 }
 
-# Initialize `dg'.
-dg-init
+# Like dg-options, but treats certain MIPS-specific options specially:
+#
+#    -mgp32
+#      Force 32-bit code.  Skip the test if the multilib flags force
+#      a 64-bit ABI.
+#
+#    -mgp64
+#      Force 64-bit code.  Also force a 64-bit target architecture
+#      if the other flags don't do so.  Skip the test if the multilib
+#      flags force a 32-bit ABI or a 32-bit architecture.
+#
+#    -mno-mips16
+#      Skip the test for MIPS16 targets.
+#
+#    -march=*
+#    -mips*
+#      Select the target architecture.  Skip the test for MIPS16 targets
+#      or if the multilib flags force a different architecture.
+#
+#    -msoft-float
+#    -mhard-float
+#      Select the given floating-point mode.  Skip the test if the
+#      multilib flags force a different selection.
+proc dg-mips-options {args} {
+    upvar dg-extra-tool-flags extra_tool_flags
+    upvar dg-do-what do_what
 
-# Main loop.
-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
-       "" $DEFAULT_CFLAGS
+    global mips_isa
+    global mips_arch
+    global mips_mips16
+    global mips_mips64
+    global mips_float
 
-# All done.
+    global mips_forced_isa
+    global mips_forced_abi
+    global mips_forced_float
+
+    set flags [lindex $args 1]
+    set matches 1
+
+    # First handle the -mgp* options.  Add an architecture option if necessary.
+    foreach flag $flags {
+       if {$flag == "-mgp32" && $mips_mips64} {
+           if {$mips_forced_abi} {
+               set matches 0
+           } else {
+               append flags " -mabi=32"
+           }
+       } elseif {$flag == "-mgp64" && !$mips_mips64} {
+           if {$mips_forced_abi} {
+               set matches 0
+           } else {
+               append flags " -mabi=o64"
+               if {[lsearch -regexp $flags {^(-mips|-march)}] < 0} {
+                   append flags " -mips3"
+               }
+           }
+       }
+    }
+    # Handle the other options.
+    foreach flag $flags {
+       if {$flag == "-mno-mips16"} {
+           if {$mips_mips16} {
+               set matches 0
+           }
+       } elseif {[regexp -- {^-march=(.*)} $flag dummy arch]} {
+           if {$mips_mips16 || ($arch != $mips_arch && $mips_forced_isa)} {
+               set matches 0
+           }
+       } elseif {[regexp -- {^-mips(.*)} $flag dummy isa] && $isa != 16} {
+           if {$mips_mips16 || ($isa != $mips_isa && $mips_forced_isa)} {
+               set matches 0
+           }
+       } elseif {[regexp -- {^-m(hard|soft)-float} $flag dummy float]} {
+           if {$mips_float != $float && $mips_forced_float} {
+               set matches 0
+           }
+       }
+    }
+    if {$matches} {
+       set extra_tool_flags $flags
+    } else {
+       set do_what [list [lindex $do_what 0] "N" "P"]
+    }
+}
+
+setup_mips_tests
+
+dg-init
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c]] "" ""
 dg-finish
diff --git a/gcc/testsuite/gcc.target/mips/movcc-1.c b/gcc/testsuite/gcc.target/mips/movcc-1.c
new file mode 100644 (file)
index 0000000..30a0aa7
--- /dev/null
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-mips-options "-O2 -mips4" } */
+/* { dg-final { scan-assembler "movz" } } */
+/* { dg-final { scan-assembler "movn" } } */
+
+void ext_int (int);
+
+int
+sub1 (int i, int j, int k)
+{
+  ext_int (k ? i : j);
+}
+
+int
+sub2 (int i, int j, long l)
+{
+  ext_int (!l ? i : j);
+}
diff --git a/gcc/testsuite/gcc.target/mips/movcc-2.c b/gcc/testsuite/gcc.target/mips/movcc-2.c
new file mode 100644 (file)
index 0000000..57c2c50
--- /dev/null
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-mips-options "-O2 -mips4" } */
+/* { dg-final { scan-assembler "movz" } } */
+/* { dg-final { scan-assembler "movn" } } */
+
+void ext_long (long);
+
+long
+sub4 (long i, long j, long k)
+{
+  ext_long (k ? i : j);
+}
+
+long
+sub5 (long i, long j, int k)
+{
+  ext_long (!k ? i : j);
+}
similarity index 69%
rename from gcc/testsuite/gcc.dg/mips-movcc-3.c
rename to gcc/testsuite/gcc.target/mips/movcc-3.c
index 3a3a43be15d2c522191175e74d77d74fc91b3b01..ad439f9229388d5d635f1de17172cf2f1e715f11 100644 (file)
@@ -1,5 +1,7 @@
-/* { dg-do compile { target "mips*-*-*" } } */
-/* { dg-options "-O2 -mips4" } */
+/* { dg-do compile } */
+/* { dg-mips-options "-O2 -mips4 -mhard-float" } */
+/* { dg-final { scan-assembler "movt" } } */
+/* { dg-final { scan-assembler "movf" } } */
 /* { dg-final { scan-assembler "movz.s" } } */
 /* { dg-final { scan-assembler "movn.s" } } */
 /* { dg-final { scan-assembler "movt.s" } } */
@@ -7,12 +9,23 @@
 /* { dg-final { scan-assembler "movn.d" } } */
 /* { dg-final { scan-assembler "movf.d" } } */
 
-#if __mips < 4 || __mips_soft_float
-asm ("# movz.s movn.s movt.s movz.d movn.d movf.d");
-#else
+void ext_int (int);
+void ext_long (long);
 void ext_float (float);
 void ext_double (double);
 
+int
+sub3 (int i, int j, float f)
+{
+  ext_int (f ? i : j);
+}
+
+long
+sub6 (long i, long j, float f)
+{
+  ext_long (!f ? i : j);
+}
+
 float
 sub7 (float f, float g, int i)
 {
@@ -48,4 +61,3 @@ subc (double f, double g, double h)
 {
   ext_double (!h ? f : g);
 }
-#endif
similarity index 70%
rename from gcc/testsuite/gcc.dg/mips-nmadd-1.c
rename to gcc/testsuite/gcc.target/mips/nmadd-1.c
index 1bf7895f2a8c76ab388fce932c33c09b1430498a..e027b07d6d7ec7688c4e92d50ccf0d864184f36b 100644 (file)
@@ -1,13 +1,10 @@
-/* { dg-do compile { target "mips*-*-*" } } */
-/* { dg-options "-O2 -ffast-math -mips4" } */
+/* { dg-do compile } */
+/* { dg-mips-options "-O2 -ffast-math -mips4 -mhard-float" } */
 /* { dg-final { scan-assembler "nmadd.s" } } */
 /* { dg-final { scan-assembler "nmadd.d" } } */
 /* { dg-final { scan-assembler "nmsub.s" } } */
 /* { dg-final { scan-assembler "nmsub.d" } } */
 
-#if (__mips != 4 && __mips != 64) || __mips_soft_float
-asm ("# nmadd.s nmadd.d nmsub.s nmsub.d");
-#else
 float
 sub1 (float f, float g, float h)
 {
@@ -31,4 +28,3 @@ sub4 (double f, double g, double h)
 {
   return -((f * g) - h);
 }
-#endif
similarity index 69%
rename from gcc/testsuite/gcc.dg/mips-nmadd-2.c
rename to gcc/testsuite/gcc.target/mips/nmadd-2.c
index 20b83bd21ae44bc3b7259647a25a1aad5cc34146..522407a5119bed9053b64f4ff2c605c85b121f48 100644 (file)
@@ -1,13 +1,10 @@
-/* { dg-do compile { target "mips*-*-*" } } */
-/* { dg-options "-O2 -fno-fast-math -mips4" } */
+/* { dg-do compile } */
+/* { dg-mips-options "-O2 -fno-fast-math -mips4 -mhard-float" } */
 /* { dg-final { scan-assembler "nmadd.s" } } */
 /* { dg-final { scan-assembler "nmadd.d" } } */
 /* { dg-final { scan-assembler "nmsub.s" } } */
 /* { dg-final { scan-assembler "nmsub.d" } } */
 
-#if (__mips != 4 && __mips != 64) || __mips_soft_float
-asm ("# nmadd.s nmadd.d nmsub.s nmsub.d");
-#else
 float
 sub1 (float f, float g, float h)
 {
@@ -31,4 +28,3 @@ sub4 (double f, double g, double h)
 {
   return -((f * g) - h);
 }
-#endif
similarity index 56%
rename from gcc/testsuite/gcc.dg/mips-rsqrt-1.c
rename to gcc/testsuite/gcc.target/mips/rsqrt-1.c
index b228ddba2963868ba4833a6a9460606a40a81f4c..34e712422f4f76b885be120c30096824c1b3d080 100644 (file)
@@ -1,11 +1,8 @@
-/* { dg-do compile { target "mips*-*-*" } } */
-/* { dg-options "-O2 -ffast-math -mips4" } */
+/* { dg-do compile } */
+/* { dg-mips-options "-O2 -ffast-math -mips4 -mhard-float" } */
 /* { dg-final { scan-assembler "rsqrt.d" } } */
 /* { dg-final { scan-assembler "rsqrt.s" } } */
 
-#if (__mips != 4 && __mips != 64) || __mips_soft_float
-asm ("# rsqrt.d rsqrt.s");
-#else
 extern double sqrt(double);
 extern float sqrtf(float);
 
@@ -18,4 +15,3 @@ float bar(float x)
 {
   return 1.0f/sqrtf(x);
 }
-#endif
similarity index 56%
rename from gcc/testsuite/gcc.dg/mips-rsqrt-2.c
rename to gcc/testsuite/gcc.target/mips/rsqrt-2.c
index a4cddcd0a0d8a3608c1a0b23bb7ce17ecc98d8b0..4bc3e7f134b55ca5259d966c6e58e7290d578f94 100644 (file)
@@ -1,11 +1,8 @@
-/* { dg-do compile { target "mips*-*-*" } } */
-/* { dg-options "-O2 -ffast-math -mips4" } */
+/* { dg-do compile } */
+/* { dg-mips-options "-O2 -ffast-math -mips4 -mhard-float" } */
 /* { dg-final { scan-assembler "rsqrt.d" } } */
 /* { dg-final { scan-assembler "rsqrt.s" } } */
 
-#if (__mips != 4 && __mips != 64) || __mips_soft_float
-asm ("# rsqrt.d rsqrt.s");
-#else
 extern double sqrt(double);
 extern float sqrtf(float);
 
@@ -18,4 +15,3 @@ float bar(float x)
 {
   return sqrtf(1.0f/x);
 }
-#endif
similarity index 81%
rename from gcc/testsuite/gcc.dg/mips-rsqrt-3.c
rename to gcc/testsuite/gcc.target/mips/rsqrt-3.c
index 870a5c9aa6a820e6aaae2ffb6a81294f8291819e..76cee835eb6d17ba6387c04c910bb419396c99fd 100644 (file)
@@ -1,5 +1,5 @@
-/* { dg-do compile { target "mips*-*-*" } } */
-/* { dg-options "-O2 -mips4" } */
+/* { dg-do compile } */
+/* { dg-mips-options "-O2 -mips4 -mhard-float" } */
 /* { dg-final { scan-assembler-not "rsqrt.d" } } */
 /* { dg-final { scan-assembler-not "rsqrt.s" } } */
 
@@ -25,4 +25,3 @@ float barf(float x)
 {
   return sqrtf(1.0f/x);
 }
-
index b6d671b7756f90542d4a118dcb815f80f53c855f..c9de3a8dbbb31dea9debcee3a05ce48809d18788 100644 (file)
@@ -1,6 +1,6 @@
 /* Test SB-1 v2sf extensions.  */
-/* { dg-do compile { target mipsisa64*-*-* } } */ 
-/* { dg-options "-march=sb1 -O2 -mpaired-single -mhard-float -mfp64 -ffast-math" } */ 
+/* { dg-do compile } */ 
+/* { dg-mips-options "-march=sb1 -O2 -mpaired-single -mhard-float -mgp64 -ffast-math" } */ 
 /* { dg-final { scan-assembler "div.ps" } } */ 
 /* { dg-final { scan-assembler "recip.ps" } } */ 
 /* { dg-final { scan-assembler "sqrt.ps" } } */ 
diff --git a/gcc/testsuite/gcc.target/mips/vr-mult-1.c b/gcc/testsuite/gcc.target/mips/vr-mult-1.c
new file mode 100644 (file)
index 0000000..47d6391
--- /dev/null
@@ -0,0 +1,7 @@
+/* Make sure that mul/addu is preferred over mtlo/macc and that mul/subu
+   is preferred over mtlo/msac.  */
+/* { dg-do compile } */
+/* { dg-mips-options "-O2 -march=vr5400" } */
+int f1 (int a, int b, int c) { return a + b * c; }
+int f2 (int a, int b, int c) { return a - b * c; }
+/* { dg-final { scan-assembler "\tmul\t.*\tmul\t" } } */
diff --git a/gcc/testsuite/gcc.target/mips/vr-mult-2.c b/gcc/testsuite/gcc.target/mips/vr-mult-2.c
new file mode 100644 (file)
index 0000000..9112ed0
--- /dev/null
@@ -0,0 +1,7 @@
+/* Make sure that mul/addu is preferred over mtlo/macc and that mul/subu
+   is preferred over mtlo/msac.  */
+/* { dg-do compile } */
+/* { dg-mips-options "-O2 -march=vr5500" } */
+int f1 (int a, int b, int c) { return a + b * c; }
+int f2 (int a, int b, int c) { return a - b * c; }
+/* { dg-final { scan-assembler "\tmul\t.*\tmul\t" } } */