octeon-exts-2.c: Compile it with -meb.

* 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.

From-SVN: r140988
This commit is contained in:
Adam Nemet 2008-10-08 21:05:43 +00:00 committed by Adam Nemet
parent 88b98d1a0c
commit 9d92695c19
4 changed files with 60 additions and 2 deletions

View file

@ -1,3 +1,10 @@
2008-10-08 Adam Nemet <anemet@caviumnetworks.com>
* 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 <jakub@redhat.com>
PR target/36635

View file

@ -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" } } */

View file

@ -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

View file

@ -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;
}