summaryrefslogtreecommitdiff
path: root/gcc/config/arm/thumb2.md
diff options
context:
space:
mode:
authorcarrot <carrot@138bc75d-0d04-0410-961f-82ee72b054a4>2010-05-25 01:08:35 +0000
committercarrot <carrot@138bc75d-0d04-0410-961f-82ee72b054a4>2010-05-25 01:08:35 +0000
commit34f82fe112fa551031e3c1cede36b7b8743690c1 (patch)
tree22a4cdbe68f2eb4f61e68371ab01ca7225d7d338 /gcc/config/arm/thumb2.md
parent732b98d74df9e043d3d197da8feab0dd2aac8564 (diff)
downloadgcc-34f82fe112fa551031e3c1cede36b7b8743690c1.tar.gz
* config/arm/thumb2.md (thumb2_tlobits_cbranch): Add constraint to
tst instruction and a new alternative. * config/arm/constraints.md (Pu): New constraint. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159806 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/arm/thumb2.md')
-rw-r--r--gcc/config/arm/thumb2.md26
1 files changed, 19 insertions, 7 deletions
diff --git a/gcc/config/arm/thumb2.md b/gcc/config/arm/thumb2.md
index e97715ff595..30291b30e21 100644
--- a/gcc/config/arm/thumb2.md
+++ b/gcc/config/arm/thumb2.md
@@ -1460,13 +1460,14 @@
[(set (pc)
(if_then_else
(match_operator 0 "equality_operator"
- [(zero_extract:SI (match_operand:SI 1 "s_register_operand" "l,?h")
- (match_operand:SI 2 "const_int_operand" "i,i")
+ [(zero_extract:SI (match_operand:SI 1 "s_register_operand" "l,h,h")
+ (match_operand:SI 2 "const_int_operand" "i,Pu,i")
(const_int 0))
(const_int 0)])
(label_ref (match_operand 3 "" ""))
(pc)))
- (clobber (match_scratch:SI 4 "=l,X"))]
+ (clobber (match_scratch:SI 4 "=l,X,r"))
+ (clobber (reg:CC CC_REGNUM))]
"TARGET_THUMB2"
"*
{
@@ -1487,11 +1488,22 @@
}
else
{
- rtx op[2];
- op[0] = operands[1];
- op[1] = GEN_INT ((1 << INTVAL (operands[2])) - 1);
+ rtx op[3];
+
+ if (which_alternative == 1)
+ {
+ op[0] = operands[1];
+ op[1] = GEN_INT ((1 << INTVAL (operands[2])) - 1);
+ output_asm_insn (\"tst\\t%0, %1\", op);
+ }
+ else
+ {
+ op[0] = operands[4];
+ op[1] = operands[1];
+ op[2] = GEN_INT (32 - INTVAL (operands[2]));
+ output_asm_insn (\"lsls\\t%0, %1, %2\", op);
+ }
- output_asm_insn (\"tst\\t%0, %1\", op);
switch (get_attr_length (insn))
{
case 6: return \"b%d0\\t%l3\";