]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
octeon-exts-2.c: Compile it with -meb.
authorAdam Nemet <anemet@caviumnetworks.com>
Wed, 8 Oct 2008 21:05:43 +0000 (21:05 +0000)
committerAdam Nemet <nemet@gcc.gnu.org>
Wed, 8 Oct 2008 21:05:43 +0000 (21:05 +0000)
* 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

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/mips/octeon-bbit-3.c
gcc/testsuite/gcc.target/mips/octeon-exts-2.c
gcc/testsuite/gcc.target/mips/octeon-exts-5.c [new file with mode: 0644]

index 031441e40bc15258701325abdc5a11654993302f..3991d9681c9ab73c930f63ab56a0f6bf7798cc30 100644 (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
index ac8d0ca5c7ad50b9a1a15fd1a9a03f0447d74836..fd01f12181d5e9f1ec72b03d03cf578b293fe41f 100644 (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" } } */
 
index a87c5fb45db92a8ce9f05d300cd76d6885cb61b6..7847cf9411b246fd82991419120d3af7f01f5dd0 100644 (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
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 (file)
index 0000000..31251e7
--- /dev/null
@@ -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;
+}