From: Adam Nemet Date: Wed, 8 Oct 2008 21:05:43 +0000 (+0000) Subject: octeon-exts-2.c: Compile it with -meb. X-Git-Tag: releases/gcc-4.4.0~2117 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9d92695c19c6d3082e6cc91db95e7263b06fd83c;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 031441e40bc1..3991d9681c9a 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 ac8d0ca5c7ad..fd01f12181d5 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 a87c5fb45db9..7847cf9411b2 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 000000000000..31251e74763b --- /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; +}