aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4>2006-07-14 22:16:51 +0000
committerpbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4>2006-07-14 22:16:51 +0000
commit429ce9c353f1b1d8eeeee2bb57a0c9e6628c42a9 (patch)
tree3648391832993d6e09c88bc9087e89054f03b5ad
parentb2518f6c6d1ae32b844fd8aea548f97a967752e3 (diff)
2006-07-14 Paul Brook <paul@codesourcery.com>
gcc/ * config/arm/thumb2.mb (thumb2_cbz, thumb2_cbnz): New insns. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/csl/sourcerygxx-4_1@115455 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--ChangeLog.csl5
-rw-r--r--gcc/config/arm/thumb2.md44
2 files changed, 49 insertions, 0 deletions
diff --git a/ChangeLog.csl b/ChangeLog.csl
index fd5ba735e02..5576c9dbcfa 100644
--- a/ChangeLog.csl
+++ b/ChangeLog.csl
@@ -1,3 +1,8 @@
+2006-07-14 Paul Brook <paul@codesourcery.com>
+
+ gcc/
+ * config/arm/thumb2.mb (thumb2_cbz, thumb2_cbnz): New insns.
+
2006-07-14 Mark Shinwell <shinwell@codesourcery.com>
gcc/
diff --git a/gcc/config/arm/thumb2.md b/gcc/config/arm/thumb2.md
index 873cad1a8f0..2e201f55554 100644
--- a/gcc/config/arm/thumb2.md
+++ b/gcc/config/arm/thumb2.md
@@ -1141,3 +1141,47 @@
"udiv%?\t%0, %1, %2"
[(set_attr "predicable" "yes")]
)
+
+(define_insn "*thumb2_cbz"
+ [(set (pc) (if_then_else
+ (eq (match_operand:SI 0 "s_register_operand" "l,?r")
+ (const_int 0))
+ (label_ref (match_operand 1 "" ""))
+ (pc)))
+ (clobber (reg:CC CC_REGNUM))]
+ "TARGET_THUMB2"
+ "*
+ if (get_attr_length (insn) == 2 && which_alternative == 0)
+ 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)))
+ (const_int 2)
+ (const_int 8)))]
+)
+
+(define_insn "*thumb2_cbnz"
+ [(set (pc) (if_then_else
+ (ne (match_operand:SI 0 "s_register_operand" "l,?r")
+ (const_int 0))
+ (label_ref (match_operand 1 "" ""))
+ (pc)))
+ (clobber (reg:CC CC_REGNUM))]
+ "TARGET_THUMB2"
+ "*
+ if (get_attr_length (insn) == 2 && which_alternative == 0)
+ 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)))
+ (const_int 2)
+ (const_int 8)))]
+)