This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: testsuite cleanup for -mflip-mips16
- From: Sandra Loosemore <sandra at codesourcery dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Nigel Stephens <nigel at mips dot com>, David Ung <davidu at mips dot com>, Richard Sandiford <richard at codesourcery dot com>
- Date: Fri, 31 Aug 2007 22:57:58 -0400
- Subject: PATCH: testsuite cleanup for -mflip-mips16
This patch is a follow-up to the one to add function attributes to
select between mips16 and nomips16 mode on a per-function basis, and the
-mflip-mips16 option to test mixed-mode compilation in the same file.
If you run the gcc testsuite with -mflip-mips16, though, you'll get
failures on a lot of tests that specifically depend on either mips16 or
non-mips16 behavior. This patch addresses that by tweaking things to
use the explicit function attributes instead of the -mips16 or
-mno-mips16 command-line options, or testing the __mips16 preprocessor
symbol.
-Sandra
2007-08-31 Sandra Loosemore <sandra@codesourcery.com>
David Ung <davidu@mips.com>
Nigel Stephens <nigel@mips.com>
gcc/testsuite/
* gcc.c-torture/compile/mipscop-1.c: Add nomips16 attributes.
* gcc.c-torture/compile/mipscop-2.c: Likewise.
* gcc.c-torture/compile/mipscop-3.c: Likewise.
* gcc.c-torture/compile/mipscop-4.c: Likewise.
* gcc.dg/torture/mips-hilo-1.c: Likewise.
* gcc.dg/torture/mips-hilo-2.c: Likewise.
* gcc.dg/torture/pr19683-1.c: Likewise.
* gcc.target/mips/madd-3.c: Likewise.
* gcc.target/mips/maddu-3.c: Likewise.
* gcc.target/mips/msub-3.c: Likewise.
* gcc.target/mips/msubu-3.c: Likewise.
* gcc.target/mips/asm-1.c: Likewise.
* gcc.target/mips/branch-1.c: Likewise.
* gcc.target/mips/ins-1.c: Likewise.
* gcc.target/mips/near-far-3.c: Likewise.
* gcc.target/mips/near-far-4.c: Likewise.
* gcc.target/mips/smartmips-lwxs.c: Likewise.
* gcc.target/mips/smartmips-ror-1.c: Likewise.
* gcc.target/mips/smartmips-ror-2.c: Likewise.
* gcc.target/mips/smartmips-ror-3.c: Likewise.
* gcc.target/mips/smartmips-ror-4.c: Likewise.
* gcc.target/mips/dspr2-MULT.c: Likewise.
* gcc.target/mips/dspr2-MULTU.c: Likewise.
* gcc.target/mips/mips32-dsp-run.c: Likewise.
* gcc.target/mips/mips32-dspr2-type.c: Likewise.
* gcc.target/mips/code-readable-1.c: Add mips16 attributes.
* gcc.target/mips/code-readable-2.c: Likewise.
* gcc.target/mips/code-readable-3.c: Likewise.
Index: gcc/testsuite/gcc.c-torture/compile/mipscop-1.c
===================================================================
*** gcc/testsuite/gcc.c-torture/compile/mipscop-1.c (revision 128000)
--- gcc/testsuite/gcc.c-torture/compile/mipscop-1.c (working copy)
***************
*** 1,9 ****
/* { dg-do compile { target mips*-*-* } } */
- #ifndef __mips16
register unsigned int cp0count asm ("$c0r1");
! int
main (int argc, char *argv[])
{
unsigned int d;
--- 1,8 ----
/* { dg-do compile { target mips*-*-* } } */
register unsigned int cp0count asm ("$c0r1");
! int __attribute__ ((nomips16))
main (int argc, char *argv[])
{
unsigned int d;
*************** main (int argc, char *argv[])
*** 11,14 ****
d = cp0count + 3;
printf ("%d\n", d);
}
- #endif
--- 10,12 ----
Index: gcc/testsuite/gcc.c-torture/compile/mipscop-2.c
===================================================================
*** gcc/testsuite/gcc.c-torture/compile/mipscop-2.c (revision 128000)
--- gcc/testsuite/gcc.c-torture/compile/mipscop-2.c (working copy)
***************
*** 1,11 ****
/* { dg-do compile { target mips*-*-* } } */
- #ifndef __mips16
register unsigned int c3r1 asm ("$c3r1");
extern unsigned int b, c;
! void
foo ()
{
unsigned int a, d;
--- 1,10 ----
/* { dg-do compile { target mips*-*-* } } */
register unsigned int c3r1 asm ("$c3r1");
extern unsigned int b, c;
! void __attribute__ ((nomips16))
foo ()
{
unsigned int a, d;
*************** foo ()
*** 17,20 ****
d = c3r1;
printf ("%d\n", d);
}
- #endif
--- 16,18 ----
Index: gcc/testsuite/gcc.c-torture/compile/mipscop-3.c
===================================================================
*** gcc/testsuite/gcc.c-torture/compile/mipscop-3.c (revision 128000)
--- gcc/testsuite/gcc.c-torture/compile/mipscop-3.c (working copy)
***************
*** 1,11 ****
/* { dg-do compile { target mips*-*-* } } */
- #ifndef __mips16
register unsigned int c3r1 asm ("$c3r1"), c3r2 asm ("$c3r2");
extern unsigned int b, c;
! void
foo ()
{
unsigned int a, d;
--- 1,10 ----
/* { dg-do compile { target mips*-*-* } } */
register unsigned int c3r1 asm ("$c3r1"), c3r2 asm ("$c3r2");
extern unsigned int b, c;
! void __attribute__ ((nomips16))
foo ()
{
unsigned int a, d;
*************** foo ()
*** 17,20 ****
d = c3r1;
printf ("%d\n", d);
}
- #endif
--- 16,18 ----
Index: gcc/testsuite/gcc.c-torture/compile/mipscop-4.c
===================================================================
*** gcc/testsuite/gcc.c-torture/compile/mipscop-4.c (revision 128000)
--- gcc/testsuite/gcc.c-torture/compile/mipscop-4.c (working copy)
***************
*** 1,11 ****
/* { dg-do compile { target mips*-*-* } } */
- #ifndef __mips16
register unsigned long c3r1 asm ("$c3r1"), c3r2 asm ("$c3r2");
extern unsigned long b, c;
! void
foo ()
{
unsigned long a, d;
--- 1,10 ----
/* { dg-do compile { target mips*-*-* } } */
register unsigned long c3r1 asm ("$c3r1"), c3r2 asm ("$c3r2");
extern unsigned long b, c;
! void __attribute__ ((nomips16))
foo ()
{
unsigned long a, d;
*************** foo ()
*** 17,20 ****
d = c3r1;
printf ("%d\n", d);
}
! #endif
--- 16,19 ----
d = c3r1;
printf ("%d\n", d);
}
!
Index: gcc/testsuite/gcc.dg/torture/mips-hilo-1.c
===================================================================
*** gcc/testsuite/gcc.dg/torture/mips-hilo-1.c (revision 128000)
--- gcc/testsuite/gcc.dg/torture/mips-hilo-1.c (working copy)
***************
*** 6,15 ****
extern void abort (void);
extern void exit (int);
- #if !defined(__mips16)
-
#define DECLARE(TYPE) \
! TYPE __attribute__ ((noinline)) \
f1##TYPE (TYPE x1, TYPE x2, TYPE x3) \
{ \
TYPE t1, t2; \
--- 6,13 ----
extern void abort (void);
extern void exit (int);
#define DECLARE(TYPE) \
! TYPE __attribute__ ((noinline)) __attribute__ ((nomips16)) \
f1##TYPE (TYPE x1, TYPE x2, TYPE x3) \
{ \
TYPE t1, t2; \
*************** extern void exit (int);
*** 19,25 ****
return t1 + t2; \
} \
\
! TYPE __attribute__ ((noinline)) \
f2##TYPE (TYPE x1, TYPE x2, TYPE x3) \
{ \
TYPE t1, t2; \
--- 17,23 ----
return t1 + t2; \
} \
\
! TYPE __attribute__ ((noinline)) __attribute__ ((nomips16)) \
f2##TYPE (TYPE x1, TYPE x2, TYPE x3) \
{ \
TYPE t1, t2; \
*************** main ()
*** 73,78 ****
#endif
exit (0);
}
- #else
- int main () { exit (0); }
- #endif
--- 71,73 ----
Index: gcc/testsuite/gcc.dg/torture/mips-hilo-2.c
===================================================================
*** gcc/testsuite/gcc.dg/torture/mips-hilo-2.c (revision 128000)
--- gcc/testsuite/gcc.dg/torture/mips-hilo-2.c (working copy)
***************
*** 5,14 ****
extern void abort (void);
extern void exit (int);
- #if !defined(__mips16)
unsigned int g;
! unsigned long long f (unsigned int x)
{
union { unsigned long long ll; unsigned int parts[2]; } u;
--- 5,13 ----
extern void abort (void);
extern void exit (int);
unsigned int g;
! unsigned __attribute__ ((nomips16)) long long f (unsigned int x)
{
union { unsigned long long ll; unsigned int parts[2]; } u;
*************** unsigned long long f (unsigned int x)
*** 17,23 ****
return u.ll;
}
! int main ()
{
union { unsigned long long ll; unsigned int parts[2]; } u;
--- 16,22 ----
return u.ll;
}
! int __attribute__ ((nomips16)) main ()
{
union { unsigned long long ll; unsigned int parts[2]; } u;
*************** int main ()
*** 26,31 ****
abort ();
exit (0);
}
- #else
- int main () { exit (0); }
- #endif
--- 25,27 ----
Index: gcc/testsuite/gcc.dg/torture/pr19683-1.c
===================================================================
*** gcc/testsuite/gcc.dg/torture/pr19683-1.c (revision 128000)
--- gcc/testsuite/gcc.dg/torture/pr19683-1.c (working copy)
***************
*** 6,12 ****
extern void abort (void);
extern void exit (int);
- #ifndef __mips16
#define REPEAT10(X, Y) \
X(Y##0); X(Y##1); X(Y##2); X(Y##3); X(Y##4); \
X(Y##5); X(Y##6); X(Y##7); X(Y##8); X(Y##9)
--- 6,11 ----
*************** extern void exit (int);
*** 17,23 ****
union u { unsigned long long ll; unsigned int i[2]; };
! unsigned int
foo (volatile unsigned int *ptr)
{
union u u;
--- 16,22 ----
union u { unsigned long long ll; unsigned int i[2]; };
! unsigned int __attribute__ ((nomips16))
foo (volatile unsigned int *ptr)
{
union u u;
*************** foo (volatile unsigned int *ptr)
*** 30,36 ****
return result;
}
! int
main (void)
{
unsigned int array[] = { 1000 * 1000 * 1000 };
--- 29,35 ----
return result;
}
! int __attribute__ ((nomips16))
main (void)
{
unsigned int array[] = { 1000 * 1000 * 1000 };
*************** main (void)
*** 41,50 ****
abort ();
exit (0);
}
- #else
- int
- main (void)
- {
- exit (0);
- }
- #endif
--- 40,42 ----
Index: gcc/testsuite/gcc.target/mips/madd-3.c
===================================================================
*** gcc/testsuite/gcc.target/mips/madd-3.c (revision 128000)
--- gcc/testsuite/gcc.target/mips/madd-3.c (working copy)
***************
*** 2,20 ****
/* { dg-mips-options "-O2 -mips32 -mgp32" } */
/* { dg-final { scan-assembler-times "\tmadd\t" 3 } } */
! long long
f1 (int x, int y, long long z)
{
return (long long) x * y + z;
}
! long long
f2 (int x, int y, long long z)
{
return z + (long long) y * x;
}
! long long
f3 (int x, int y, long long z)
{
long long t = (long long) x * y;
--- 2,22 ----
/* { dg-mips-options "-O2 -mips32 -mgp32" } */
/* { dg-final { scan-assembler-times "\tmadd\t" 3 } } */
! #define NOMIPS16 __attribute__ ((nomips16))
!
! NOMIPS16 long long
f1 (int x, int y, long long z)
{
return (long long) x * y + z;
}
! NOMIPS16 long long
f2 (int x, int y, long long z)
{
return z + (long long) y * x;
}
! NOMIPS16 long long
f3 (int x, int y, long long z)
{
long long t = (long long) x * y;
Index: gcc/testsuite/gcc.target/mips/maddu-3.c
===================================================================
*** gcc/testsuite/gcc.target/mips/maddu-3.c (revision 128000)
--- gcc/testsuite/gcc.target/mips/maddu-3.c (working copy)
***************
*** 2,23 ****
/* { dg-mips-options "-O2 -mips32 -mgp32" } */
/* { dg-final { scan-assembler-times "\tmaddu\t" 3 } } */
typedef unsigned int ui;
typedef unsigned long long ull;
! ull
f1 (ui x, ui y, ull z)
{
return (ull) x * y + z;
}
! ull
f2 (ui x, ui y, ull z)
{
return z + (ull) y * x;
}
! ull
f3 (ui x, ui y, ull z)
{
ull t = (ull) x * y;
--- 2,25 ----
/* { dg-mips-options "-O2 -mips32 -mgp32" } */
/* { dg-final { scan-assembler-times "\tmaddu\t" 3 } } */
+ #define NOMIPS16 __attribute__ ((nomips16))
+
typedef unsigned int ui;
typedef unsigned long long ull;
! NOMIPS16 ull
f1 (ui x, ui y, ull z)
{
return (ull) x * y + z;
}
! NOMIPS16 ull
f2 (ui x, ui y, ull z)
{
return z + (ull) y * x;
}
! NOMIPS16 ull
f3 (ui x, ui y, ull z)
{
ull t = (ull) x * y;
Index: gcc/testsuite/gcc.target/mips/msub-3.c
===================================================================
*** gcc/testsuite/gcc.target/mips/msub-3.c (revision 128000)
--- gcc/testsuite/gcc.target/mips/msub-3.c (working copy)
***************
*** 2,14 ****
/* { dg-mips-options "-O2 -mips32 -mgp32" } */
/* { dg-final { scan-assembler-times "\tmsub\t" 2 } } */
! long long
f1 (int x, int y, long long z)
{
return z - (long long) y * x;
}
! long long
f2 (int x, int y, long long z)
{
long long t = (long long) x * y;
--- 2,16 ----
/* { dg-mips-options "-O2 -mips32 -mgp32" } */
/* { dg-final { scan-assembler-times "\tmsub\t" 2 } } */
! #define NOMIPS16 __attribute__ ((nomips16))
!
! NOMIPS16 long long
f1 (int x, int y, long long z)
{
return z - (long long) y * x;
}
! NOMIPS16 long long
f2 (int x, int y, long long z)
{
long long t = (long long) x * y;
Index: gcc/testsuite/gcc.target/mips/msubu-3.c
===================================================================
*** gcc/testsuite/gcc.target/mips/msubu-3.c (revision 128000)
--- gcc/testsuite/gcc.target/mips/msubu-3.c (working copy)
***************
*** 2,17 ****
/* { dg-mips-options "-O2 -mips32 -mgp32" } */
/* { dg-final { scan-assembler-times "\tmsubu\t" 2 } } */
typedef unsigned int ui;
typedef unsigned long long ull;
! ull
f1 (ui x, ui y, ull z)
{
return z - (ull) y * x;
}
! ull
f2 (ui x, ui y, ull z)
{
ull t = (ull) x * y;
--- 2,19 ----
/* { dg-mips-options "-O2 -mips32 -mgp32" } */
/* { dg-final { scan-assembler-times "\tmsubu\t" 2 } } */
+ #define NOMIPS16 __attribute__ ((nomips16))
+
typedef unsigned int ui;
typedef unsigned long long ull;
! NOMIPS16 ull
f1 (ui x, ui y, ull z)
{
return z - (ull) y * x;
}
! NOMIPS16 ull
f2 (ui x, ui y, ull z)
{
ull t = (ull) x * y;
Index: gcc/testsuite/gcc.target/mips/asm-1.c
===================================================================
*** gcc/testsuite/gcc.target/mips/asm-1.c (revision 128000)
--- gcc/testsuite/gcc.target/mips/asm-1.c (working copy)
***************
*** 1,8 ****
/* PR target/17565. GCC used to put the asm into the delay slot
of the call. */
/* { dg-do assemble } */
! /* { dg-mips-options "-O -mno-mips16" } */
! int foo (int n)
{
register int k asm ("$16") = n;
if (k > 0)
--- 1,11 ----
/* PR target/17565. GCC used to put the asm into the delay slot
of the call. */
/* { dg-do assemble } */
! /* { dg-mips-options "-O" } */
!
! #define NOMIPS16 __attribute__ ((nomips16))
!
! NOMIPS16 int foo (int n)
{
register int k asm ("$16") = n;
if (k > 0)
Index: gcc/testsuite/gcc.target/mips/branch-1.c
===================================================================
*** gcc/testsuite/gcc.target/mips/branch-1.c (revision 128000)
--- gcc/testsuite/gcc.target/mips/branch-1.c (working copy)
***************
*** 1,11 ****
/* We should implement these "if" statements using an "andi" instruction
followed by a branch on zero. */
! /* { dg-mips-options "-O2 -mno-mips16" } */
void bar (void);
! void f1 (int x) { if (x & 4) bar (); }
! void f2 (int x) { if ((x >> 2) & 1) bar (); }
! void f3 (unsigned int x) { if (x & 0x10) bar (); }
! void f4 (unsigned int x) { if ((x >> 4) & 1) bar (); }
/* { dg-final { scan-assembler "\tandi\t.*\tandi\t.*\tandi\t.*\tandi\t" } } */
/* { dg-final { scan-assembler-not "\tsrl\t" } } */
/* { dg-final { scan-assembler-not "\tsra\t" } } */
--- 1,14 ----
/* We should implement these "if" statements using an "andi" instruction
followed by a branch on zero. */
! /* { dg-mips-options "-O2" } */
!
! #define NOMIPS16 __attribute__ ((nomips16))
!
void bar (void);
! NOMIPS16 void f1 (int x) { if (x & 4) bar (); }
! NOMIPS16 void f2 (int x) { if ((x >> 2) & 1) bar (); }
! NOMIPS16 void f3 (unsigned int x) { if (x & 0x10) bar (); }
! NOMIPS16 void f4 (unsigned int x) { if ((x >> 4) & 1) bar (); }
/* { dg-final { scan-assembler "\tandi\t.*\tandi\t.*\tandi\t.*\tandi\t" } } */
/* { dg-final { scan-assembler-not "\tsrl\t" } } */
/* { dg-final { scan-assembler-not "\tsra\t" } } */
Index: gcc/testsuite/gcc.target/mips/ins-1.c
===================================================================
*** gcc/testsuite/gcc.target/mips/ins-1.c (revision 128000)
--- gcc/testsuite/gcc.target/mips/ins-1.c (working copy)
***************
*** 1,7 ****
/* { dg-do compile } */
! /* { dg-mips-options "-O -march=mips32r2 -mno-mips16" } */
/* { dg-final { scan-assembler "\tins\t" } } */
struct
{
unsigned int i : 2;
--- 1,9 ----
/* { dg-do compile } */
! /* { dg-mips-options "-O -march=mips32r2" } */
/* { dg-final { scan-assembler "\tins\t" } } */
+ #define NOMIPS16 __attribute__ ((nomips16))
+
struct
{
unsigned int i : 2;
*************** struct
*** 9,15 ****
unsigned int k : 4;
} s;
! void
foo (void)
{
s.j = 1;
--- 11,17 ----
unsigned int k : 4;
} s;
! NOMIPS16 void
foo (void)
{
s.j = 1;
Index: gcc/testsuite/gcc.target/mips/near-far-3.c
===================================================================
*** gcc/testsuite/gcc.target/mips/near-far-3.c (revision 128000)
--- gcc/testsuite/gcc.target/mips/near-far-3.c (working copy)
***************
*** 1,16 ****
/* { dg-do compile } */
! /* { dg-mips-options "-mlong-calls -O2 -mno-mips16" } */
/* { dg-require-effective-target nonpic } */
! extern int long_call_func () __attribute__((long_call));
! extern int far_func () __attribute__((far));
! extern int near_func () __attribute__((near));
! extern int normal_func ();
! int test1 () { return long_call_func (); }
! int test2 () { return far_func (); }
! int test3 () { return near_func (); }
! int test4 () { return normal_func (); }
/* { dg-final { scan-assembler-not "\tj\tlong_call_func\n" } } */
/* { dg-final { scan-assembler-not "\tj\tfar_func\n" } } */
--- 1,18 ----
/* { dg-do compile } */
! /* { dg-mips-options "-mlong-calls -O2" } */
/* { dg-require-effective-target nonpic } */
! #define NOMIPS16 __attribute__ ((nomips16))
! NOMIPS16 extern int long_call_func () __attribute__((long_call));
! NOMIPS16 extern int far_func () __attribute__((far));
! NOMIPS16 extern int near_func () __attribute__((near));
! NOMIPS16 extern int normal_func ();
!
! NOMIPS16 int test1 () { return long_call_func (); }
! NOMIPS16 int test2 () { return far_func (); }
! NOMIPS16 int test3 () { return near_func (); }
! NOMIPS16 int test4 () { return normal_func (); }
/* { dg-final { scan-assembler-not "\tj\tlong_call_func\n" } } */
/* { dg-final { scan-assembler-not "\tj\tfar_func\n" } } */
Index: gcc/testsuite/gcc.target/mips/near-far-4.c
===================================================================
*** gcc/testsuite/gcc.target/mips/near-far-4.c (revision 128000)
--- gcc/testsuite/gcc.target/mips/near-far-4.c (working copy)
***************
*** 1,16 ****
/* { dg-do compile } */
! /* { dg-mips-options "-mno-long-calls -O2 -mno-mips16" } */
/* { dg-require-effective-target nonpic } */
! extern int long_call_func () __attribute__((long_call));
! extern int far_func () __attribute__((far));
! extern int near_func () __attribute__((near));
! extern int normal_func ();
! int test1 () { return long_call_func (); }
! int test2 () { return far_func (); }
! int test3 () { return near_func (); }
! int test4 () { return normal_func (); }
/* { dg-final { scan-assembler-not "\tj\tlong_call_func\n" } } */
/* { dg-final { scan-assembler-not "\tj\tfar_func\n" } } */
--- 1,18 ----
/* { dg-do compile } */
! /* { dg-mips-options "-mno-long-calls -O2" } */
/* { dg-require-effective-target nonpic } */
! #define NOMIPS16 __attribute__ ((nomips16))
! NOMIPS16 extern int long_call_func () __attribute__((long_call));
! NOMIPS16 extern int far_func () __attribute__((far));
! NOMIPS16 extern int near_func () __attribute__((near));
! NOMIPS16 extern int normal_func ();
!
! NOMIPS16 int test1 () { return long_call_func (); }
! NOMIPS16 int test2 () { return far_func (); }
! NOMIPS16 int test3 () { return near_func (); }
! NOMIPS16 int test4 () { return normal_func (); }
/* { dg-final { scan-assembler-not "\tj\tlong_call_func\n" } } */
/* { dg-final { scan-assembler-not "\tj\tfar_func\n" } } */
Index: gcc/testsuite/gcc.target/mips/smartmips-lwxs.c
===================================================================
*** gcc/testsuite/gcc.target/mips/smartmips-lwxs.c (revision 128000)
--- gcc/testsuite/gcc.target/mips/smartmips-lwxs.c (working copy)
***************
*** 1,7 ****
/* { dg-do compile } */
! /* { dg-mips-options "-O -msmartmips -mno-mips16" } */
! int scaled_indexed_word_load (int a[], int b)
{
return a[b];
}
--- 1,9 ----
/* { dg-do compile } */
! /* { dg-mips-options "-O -msmartmips" } */
! #define NOMIPS16 __attribute__ ((nomips16))
!
! NOMIPS16 int scaled_indexed_word_load (int a[], int b)
{
return a[b];
}
Index: gcc/testsuite/gcc.target/mips/smartmips-ror-1.c
===================================================================
*** gcc/testsuite/gcc.target/mips/smartmips-ror-1.c (revision 128000)
--- gcc/testsuite/gcc.target/mips/smartmips-ror-1.c (working copy)
***************
*** 1,7 ****
/* { dg-do compile } */
! /* { dg-mips-options "-O -msmartmips -mno-mips16" } */
! int rotate_left (unsigned a, unsigned s)
{
return (a << s) | (a >> (32 - s));
}
--- 1,9 ----
/* { dg-do compile } */
! /* { dg-mips-options "-O -msmartmips" } */
! #define NOMIPS16 __attribute__ ((nomips16))
!
! NOMIPS16 int rotate_left (unsigned a, unsigned s)
{
return (a << s) | (a >> (32 - s));
}
Index: gcc/testsuite/gcc.target/mips/smartmips-ror-2.c
===================================================================
*** gcc/testsuite/gcc.target/mips/smartmips-ror-2.c (revision 128000)
--- gcc/testsuite/gcc.target/mips/smartmips-ror-2.c (working copy)
***************
*** 1,7 ****
/* { dg-do compile } */
! /* { dg-mips-options "-O -msmartmips -mno-mips16" } */
! int rotate_right (unsigned a, unsigned s)
{
return (a >> s) | (a << (32 - s));
}
--- 1,9 ----
/* { dg-do compile } */
! /* { dg-mips-options "-O -msmartmips" } */
! #define NOMIPS16 __attribute__ ((nomips16))
!
! NOMIPS16 int rotate_right (unsigned a, unsigned s)
{
return (a >> s) | (a << (32 - s));
}
Index: gcc/testsuite/gcc.target/mips/smartmips-ror-3.c
===================================================================
*** gcc/testsuite/gcc.target/mips/smartmips-ror-3.c (revision 128000)
--- gcc/testsuite/gcc.target/mips/smartmips-ror-3.c (working copy)
***************
*** 1,9 ****
/* { dg-do compile } */
! /* { dg-mips-options "-O -msmartmips -mno-mips16" } */
#define S 13
! int rotate_left_constant (unsigned a)
{
return (a << S) | (a >> (32 - S));
}
--- 1,11 ----
/* { dg-do compile } */
! /* { dg-mips-options "-O -msmartmips" } */
!
! #define NOMIPS16 __attribute__ ((nomips16))
#define S 13
! NOMIPS16 int rotate_left_constant (unsigned a)
{
return (a << S) | (a >> (32 - S));
}
Index: gcc/testsuite/gcc.target/mips/smartmips-ror-4.c
===================================================================
*** gcc/testsuite/gcc.target/mips/smartmips-ror-4.c (revision 128000)
--- gcc/testsuite/gcc.target/mips/smartmips-ror-4.c (working copy)
***************
*** 1,9 ****
/* { dg-do compile } */
! /* { dg-mips-options "-O -msmartmips -mno-mips16" } */
#define S 13
! int rotate_right_constant (unsigned a)
{
return (a >> S) | (a << (32 - S));
}
--- 1,11 ----
/* { dg-do compile } */
! /* { dg-mips-options "-O -msmartmips" } */
!
! #define NOMIPS16 __attribute__ ((nomips16))
#define S 13
! NOMIPS16 int rotate_right_constant (unsigned a)
{
return (a >> S) | (a << (32 - S));
}
Index: gcc/testsuite/gcc.target/mips/dspr2-MULT.c
===================================================================
*** gcc/testsuite/gcc.target/mips/dspr2-MULT.c (revision 128000)
--- gcc/testsuite/gcc.target/mips/dspr2-MULT.c (working copy)
***************
*** 7,17 ****
/* { dg-final { scan-assembler "ac2" } } */
/* { dg-final { scan-assembler "ac3" } } */
typedef long long a64;
a64 a[4];
int b[4], c[4];
! void test ()
{
a[0] = (a64) b[0] * c[0];
a[1] = (a64) b[1] * c[1];
--- 7,19 ----
/* { dg-final { scan-assembler "ac2" } } */
/* { dg-final { scan-assembler "ac3" } } */
+ #define NOMIPS16 __attribute__ ((nomips16))
+
typedef long long a64;
a64 a[4];
int b[4], c[4];
! NOMIPS16 void test ()
{
a[0] = (a64) b[0] * c[0];
a[1] = (a64) b[1] * c[1];
Index: gcc/testsuite/gcc.target/mips/dspr2-MULTU.c
===================================================================
*** gcc/testsuite/gcc.target/mips/dspr2-MULTU.c (revision 128000)
--- gcc/testsuite/gcc.target/mips/dspr2-MULTU.c (working copy)
***************
*** 7,17 ****
/* { dg-final { scan-assembler "ac2" } } */
/* { dg-final { scan-assembler "ac3" } } */
typedef long long a64;
a64 a[4];
unsigned int b[4], c[4];
! void test ()
{
a[0] = (a64) b[0] * c[0];
a[1] = (a64) b[1] * c[1];
--- 7,19 ----
/* { dg-final { scan-assembler "ac2" } } */
/* { dg-final { scan-assembler "ac3" } } */
+ #define NOMIPS16 __attribute__ ((nomips16))
+
typedef long long a64;
a64 a[4];
unsigned int b[4], c[4];
! NOMIPS16 void test ()
{
a[0] = (a64) b[0] * c[0];
a[1] = (a64) b[1] * c[1];
Index: gcc/testsuite/gcc.target/mips/mips32-dsp-run.c
===================================================================
*** gcc/testsuite/gcc.target/mips/mips32-dsp-run.c (revision 128000)
--- gcc/testsuite/gcc.target/mips/mips32-dsp-run.c (working copy)
***************
*** 2,7 ****
--- 2,9 ----
/* { dg-do run { target mipsisa32r2*-*-* } } */
/* { dg-mips-options "-march=mips32r2 -mdsp -O2" } */
+ #define NOMIPS16 __attribute__ ((nomips16))
+
#include <stdlib.h>
#include <stdio.h>
*************** typedef int q31;
*** 12,18 ****
typedef int i32;
typedef long long a64;
! void test_MIPS_DSP (void);
char array[100];
int little_endian;
--- 14,20 ----
typedef int i32;
typedef long long a64;
! NOMIPS16 void test_MIPS_DSP (void);
char array[100];
int little_endian;
*************** int main ()
*** 33,59 ****
exit (0);
}
! v2q15 add_v2q15 (v2q15 a, v2q15 b)
{
return __builtin_mips_addq_ph (a, b);
}
! v4i8 add_v4i8 (v4i8 a, v4i8 b)
{
return __builtin_mips_addu_qb (a, b);
}
! v2q15 sub_v2q15 (v2q15 a, v2q15 b)
{
return __builtin_mips_subq_ph (a, b);
}
! v4i8 sub_v4i8 (v4i8 a, v4i8 b)
{
return __builtin_mips_subu_qb (a, b);
}
! void test_MIPS_DSP ()
{
v4i8 v4i8_a,v4i8_b,v4i8_c,v4i8_r,v4i8_s;
v2q15 v2q15_a,v2q15_b,v2q15_c,v2q15_r,v2q15_s;
--- 35,61 ----
exit (0);
}
! NOMIPS16 v2q15 add_v2q15 (v2q15 a, v2q15 b)
{
return __builtin_mips_addq_ph (a, b);
}
! NOMIPS16 v4i8 add_v4i8 (v4i8 a, v4i8 b)
{
return __builtin_mips_addu_qb (a, b);
}
! NOMIPS16 v2q15 sub_v2q15 (v2q15 a, v2q15 b)
{
return __builtin_mips_subq_ph (a, b);
}
! NOMIPS16 v4i8 sub_v4i8 (v4i8 a, v4i8 b)
{
return __builtin_mips_subu_qb (a, b);
}
! NOMIPS16 void test_MIPS_DSP ()
{
v4i8 v4i8_a,v4i8_b,v4i8_c,v4i8_r,v4i8_s;
v2q15 v2q15_a,v2q15_b,v2q15_c,v2q15_r,v2q15_s;
Index: gcc/testsuite/gcc.target/mips/mips32-dspr2-type.c
===================================================================
*** gcc/testsuite/gcc.target/mips/mips32-dspr2-type.c (revision 128000)
--- gcc/testsuite/gcc.target/mips/mips32-dspr2-type.c (working copy)
***************
*** 3,11 ****
/* { dg-mips-options "-march=mips32r2 -mdspr2" } */
/* { dg-final { scan-assembler "\tmul.ph\t" } } */
typedef short v2hi __attribute__ ((vector_size(4)));
! v2hi mul_v2hi (v2hi a, v2hi b)
{
return a * b;
}
--- 3,13 ----
/* { dg-mips-options "-march=mips32r2 -mdspr2" } */
/* { dg-final { scan-assembler "\tmul.ph\t" } } */
+ #define NOMIPS16 __attribute__ ((nomips16))
+
typedef short v2hi __attribute__ ((vector_size(4)));
! NOMIPS16 v2hi mul_v2hi (v2hi a, v2hi b)
{
return a * b;
}
Index: gcc/testsuite/gcc.target/mips/code-readable-1.c
===================================================================
*** gcc/testsuite/gcc.target/mips/code-readable-1.c (revision 128000)
--- gcc/testsuite/gcc.target/mips/code-readable-1.c (working copy)
***************
*** 1,6 ****
! /* { dg-mips-options "-mips16 -mcode-readable=yes -mgp32" } */
! int
foo (int i)
{
switch (i)
--- 1,8 ----
! /* { dg-mips-options "-mcode-readable=yes -mgp32" } */
! #define MIPS16 __attribute__ ((mips16))
!
! MIPS16 int
foo (int i)
{
switch (i)
*************** foo (int i)
*** 18,24 ****
extern int k[];
! int *
bar (void)
{
return k;
--- 20,26 ----
extern int k[];
! MIPS16 int *
bar (void)
{
return k;
Index: gcc/testsuite/gcc.target/mips/code-readable-2.c
===================================================================
*** gcc/testsuite/gcc.target/mips/code-readable-2.c (revision 128000)
--- gcc/testsuite/gcc.target/mips/code-readable-2.c (working copy)
***************
*** 1,6 ****
! /* { dg-mips-options "-mips16 -mcode-readable=pcrel -mgp32" } */
! int
foo (int i)
{
switch (i)
--- 1,8 ----
! /* { dg-mips-options "-mcode-readable=pcrel -mgp32" } */
! #define MIPS16 __attribute__ ((mips16))
!
! MIPS16 int
foo (int i)
{
switch (i)
*************** foo (int i)
*** 18,24 ****
extern int k[];
! int *
bar (void)
{
return k;
--- 20,26 ----
extern int k[];
! MIPS16 int *
bar (void)
{
return k;
Index: gcc/testsuite/gcc.target/mips/code-readable-3.c
===================================================================
*** gcc/testsuite/gcc.target/mips/code-readable-3.c (revision 128000)
--- gcc/testsuite/gcc.target/mips/code-readable-3.c (working copy)
***************
*** 1,6 ****
! /* { dg-mips-options "-mips16 -mcode-readable=no -mgp32" } */
! int
foo (int i)
{
switch (i)
--- 1,8 ----
! /* { dg-mips-options "-mcode-readable=no -mgp32" } */
! #define MIPS16 __attribute__ ((mips16))
!
! MIPS16 int
foo (int i)
{
switch (i)
*************** foo (int i)
*** 18,24 ****
extern int k[];
! int *
bar (void)
{
return k;
--- 20,26 ----
extern int k[];
! MIPS16 int *
bar (void)
{
return k;