thumb2.md (thumb2_cbz): Correct computation of length attribute.
authorMark Mitchell <mark@codesourcery.com>
Fri, 10 Jul 2009 23:16:31 +0000 (23:16 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Fri, 10 Jul 2009 23:16:31 +0000 (23:16 +0000)
* config/arm/thumb2.md (thumb2_cbz): Correct computation of length
attribute.
(thumb2_cbnz): Likewise.

From-SVN: r149501

gcc/ChangeLog
gcc/config/arm/thumb2.md

index bff4bd7..50c7a1c 100644 (file)
@@ -1,3 +1,9 @@
+2009-07-10  Mark Mitchell  <mark@codesourcery.com>
+
+       * config/arm/thumb2.md (thumb2_cbz): Correct computation of length
+       attribute.
+       (thumb2_cbnz): Likewise.
+
 2009-07-10  David Daney  <ddaney@caviumnetworks.com>
 
        PR target/39079
index 0c5c2db..884d58c 100644 (file)
    (clobber (reg:CC CC_REGNUM))]
   "TARGET_THUMB2"
   "*
-  if (get_attr_length (insn) == 2 && which_alternative == 0)
+  if (get_attr_length (insn) == 2)
     return \"cbz\\t%0, %l1\";
   else
     return \"cmp\\t%0, #0\;beq\\t%l1\";
   [(set (attr "length") 
         (if_then_else
            (and (ge (minus (match_dup 1) (pc)) (const_int 2))
-                (le (minus (match_dup 1) (pc)) (const_int 128)))
+                (le (minus (match_dup 1) (pc)) (const_int 128))
+                (eq (symbol_ref ("which_alternative")) (const_int 0)))
            (const_int 2)
            (const_int 8)))]
 )
    (clobber (reg:CC CC_REGNUM))]
   "TARGET_THUMB2"
   "*
-  if (get_attr_length (insn) == 2 && which_alternative == 0)
+  if (get_attr_length (insn) == 2)
     return \"cbnz\\t%0, %l1\";
   else
     return \"cmp\\t%0, #0\;bne\\t%l1\";
   [(set (attr "length") 
         (if_then_else
            (and (ge (minus (match_dup 1) (pc)) (const_int 2))
-                (le (minus (match_dup 1) (pc)) (const_int 128)))
+                (le (minus (match_dup 1) (pc)) (const_int 128))
+                (eq (symbol_ref ("which_alternative")) (const_int 0)))
            (const_int 2)
            (const_int 8)))]
 )