+2013-09-11 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * config/arm/arm.md (arm_shiftsi3): New alternative l/l/M.
+
2013-09-11 Richard Biener <rguenther@suse.de>
* tree-data-ref.c (dump_rdg_vertex, debug_rdg_vertex,
)
(define_insn "*arm_shiftsi3"
- [(set (match_operand:SI 0 "s_register_operand" "=l,r,r")
+ [(set (match_operand:SI 0 "s_register_operand" "=l,l,r,r")
(match_operator:SI 3 "shift_operator"
- [(match_operand:SI 1 "s_register_operand" "0,r,r")
- (match_operand:SI 2 "reg_or_int_operand" "l,M,r")]))]
+ [(match_operand:SI 1 "s_register_operand" "0,l,r,r")
+ (match_operand:SI 2 "reg_or_int_operand" "l,M,M,r")]))]
"TARGET_32BIT"
"* return arm_output_shift(operands, 0);"
[(set_attr "predicable" "yes")
- (set_attr "arch" "t2,*,*")
- (set_attr "predicable_short_it" "yes,no,no")
+ (set_attr "arch" "t2,t2,*,*")
+ (set_attr "predicable_short_it" "yes,yes,no,no")
(set_attr "length" "4")
(set_attr "shift" "1")
- (set_attr "type" "alu_shift_reg,alu_shift_imm,alu_shift_reg")]
+ (set_attr "type" "alu_shift_reg,alu_shift_imm,alu_shift_imm,alu_shift_reg")]
)
(define_insn "*shiftsi3_compare"
--- /dev/null
+/* Check that Thumb 16-bit shifts by immediate can be if-converted. */
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_thumb2_ok } */
+/* { dg-options "-O2 -mthumb" } */
+
+int
+foo (int a, int b)
+{
+ if (a != b)
+ a = a << 1;
+ else
+ a = a >> 1;
+
+ return a + b;
+}
+
+/* { dg-final { scan-assembler "lslne" } } */
+/* { dg-final { scan-assembler "asreq" } } */