diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 031441e40bc..3991d9681c9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2008-10-08 Adam Nemet + + * gcc.target/mips/octeon-exts-2.c: Compile it with -meb. + * gcc.target/mips/octeon-exts-5.c: New test. + * gcc.target/mips/octeon-bbit-3.c: Compile with -meb. Add + comment why this is necessary. + 2008-10-08 Jakub Jelinek PR target/36635 diff --git a/gcc/testsuite/gcc.target/mips/octeon-bbit-3.c b/gcc/testsuite/gcc.target/mips/octeon-bbit-3.c index ac8d0ca5c7a..fd01f12181d 100644 --- a/gcc/testsuite/gcc.target/mips/octeon-bbit-3.c +++ b/gcc/testsuite/gcc.target/mips/octeon-bbit-3.c @@ -1,5 +1,18 @@ /* { dg-do compile } */ -/* { dg-mips-options "-O2 -march=octeon" } */ + +/* Force big-endian because for little-endian, combine generates this: + + (if_then_else (ne (zero_extract:DI (subreg:DI (truncate:SI (reg:DI 196)) 0) + (const_int 1) + (const_int 0)) + (const_int 0)) + (label_ref 20) + (pc))) + + which does not get recognized as a valid bbit pattern. The + middle-end should be able to simplify this further. */ +/* { dg-mips-options "-O2 -march=octeon -meb" } */ + /* { dg-final { scan-assembler-times "\tbbit\[01\]\t|\tbgez\t" 2 } } */ /* { dg-final { scan-assembler-not "ext\t" } } */ diff --git a/gcc/testsuite/gcc.target/mips/octeon-exts-2.c b/gcc/testsuite/gcc.target/mips/octeon-exts-2.c index a87c5fb45db..7847cf9411b 100644 --- a/gcc/testsuite/gcc.target/mips/octeon-exts-2.c +++ b/gcc/testsuite/gcc.target/mips/octeon-exts-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-mips-options "-O -march=octeon" } */ +/* { dg-mips-options "-O -march=octeon -meb" } */ /* { dg-final { scan-assembler-times "\texts\t" 4 } } */ struct bar diff --git a/gcc/testsuite/gcc.target/mips/octeon-exts-5.c b/gcc/testsuite/gcc.target/mips/octeon-exts-5.c new file mode 100644 index 00000000000..31251e74763 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/octeon-exts-5.c @@ -0,0 +1,38 @@ +/* -mel version of octeon-exts-2.c. */ +/* { dg-do compile } */ +/* { dg-mips-options "-O -march=octeon -mel" } */ +/* { dg-final { scan-assembler-times "\texts\t" 4 } } */ + +struct bar +{ + long long d:1; + unsigned long long c:48; + long long b:14; + unsigned long long a:1; +}; + +NOMIPS16 int +f1 (struct bar *s, int a) +{ + return (int) s->b + a; +} + +NOMIPS16 char +f2 (struct bar *s) +{ + return s->d + 1; +} + +NOMIPS16 int +f3 () +{ + struct bar s; + asm ("" : "=r"(s)); + return (int) s.b + 1; +} + +NOMIPS16 long long +f4 (struct bar *s) +{ + return s->d; +}