re PR target/14812 (ARM optimizer changes rsb/cmp to cmn, but condition codes different)
authorRichard Earnshaw <rearnsha@arm.com>
Mon, 4 Apr 2005 10:51:38 +0000 (10:51 +0000)
committerRichard Earnshaw <rearnsha@gcc.gnu.org>
Mon, 4 Apr 2005 10:51:38 +0000 (10:51 +0000)
PR target/14812
* arm.c (arm_select_cc_mode): Return CC_Zmode when comparing against
a negated value.

From-SVN: r97533

gcc/ChangeLog
gcc/config/arm/arm.c

index fe589da8458dc2bd57dccd4e344a7476cd9a210a..dd8d0b7363ae9ae3746600833767b7677b52d722 100644 (file)
@@ -1,3 +1,9 @@
+2005-04-04  Richard Earnshaw  <richard.earnshaw@arm.com>
+
+       PR target/14812
+       * arm.c (arm_select_cc_mode): Return CC_Zmode when comparing against
+       a negated value.
+
 2005-04-04  Richard Henderson  <rth@redhat.com>
            Jakub Jelinek  <jakub@redhat.com>
 
index 83c5b857ed999f796762cd880d5a6ab76fe452ae..bcf1904264b70ddd1362ccef4e9d3b6fc055c820 100644 (file)
@@ -6100,6 +6100,13 @@ arm_select_cc_mode (enum rtx_code op, rtx x, rtx y)
          || GET_CODE (x) == ROTATERT))
     return CC_SWPmode;
 
+  /* This operation is performed swapped, but since we only rely on the Z
+     flag we don't need an additional mode.  */
+  if (GET_MODE (y) == SImode && REG_P (y)
+      && GET_CODE (x) == NEG
+      && (op ==        EQ || op == NE))
+    return CC_Zmode;
+
   /* This is a special case that is used by combine to allow a
      comparison of a shifted byte load to be split into a zero-extend
      followed by a comparison of the shifted integer (only valid for