octeon-bbit-2.c: Restructure loops so that no code duplication is required.
authorRichard Sandiford <rdsandiford@googlemail.com>
Mon, 10 Dec 2012 20:22:48 +0000 (20:22 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Mon, 10 Dec 2012 20:22:48 +0000 (20:22 +0000)
gcc/testsuite/
* gcc.target/mips/octeon-bbit-2.c: Restructure loops so that no
code duplication is required.  Allow BNE to appear.

From-SVN: r194370

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/mips/octeon-bbit-2.c

index efbf048b8776fe79adaa822c38a4ad9fe833bf01..ab9459980a82f974fe306bd154fe748b37047c4a 100644 (file)
@@ -1,3 +1,8 @@
+2012-12-10  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       * gcc.target/mips/octeon-bbit-2.c: Restructure loops so that no
+       code duplication is required.  Allow BNE to appear.
+
 2012-12-10  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * gcc.target/mips/ext-2.c: Require -mlong64.
index 9bd8dce107ae00d93360d0e13c53903f0a8d8265..7e78d70e77fc0c2a388a91aa23677343d6665d13 100644 (file)
@@ -4,22 +4,21 @@
 /* { dg-final { scan-assembler "\tbbit\[01\]\t" } } */
 /* { dg-final { scan-assembler-not "\tbbit\[01\]l\t" } } */
 /* { dg-final { scan-assembler "\tbnel\t" } } */
-/* { dg-final { scan-assembler-not "\tbne\t" } } */
 
 NOMIPS16 int
-f (int n, int i)
+f (int *a, int *b)
 {
-  int s = 0;
-  for (; i & 1; i++)
-    s += i;
-  return s;
+  do
+    if (__builtin_expect (*a & 1, 1))
+      *a = 0;
+  while (++a < b);
 }
 
 NOMIPS16 int
-g (int n, int i)
+g (int *a, int *b)
 {
-  int s = 0;
-  for (i = 0; i < n; i++)
-    s += i;
-  return s;
+  do
+    if (__builtin_expect (*a == 3, 1))
+      *a = 0;
+  while (++a < b);
 }