2014-05-23 Yvan Roux <yvan.roux@linaro.org>
+ Backport from trunk r209711.
+ 2014-04-23 Richard Earnshaw <rearnsha@arm.com>
+
+ * aarch64.md (<optab>_rol<mode>3): New pattern.
+ (<optab>_rolsi3_uxtw): Likewise.
+ * aarch64.c (aarch64_strip_shift): Handle ROTATE and ROTATERT.
+
+2014-05-23 Yvan Roux <yvan.roux@linaro.org>
+
Backport from trunk r209710.
2014-04-23 James Greenhalgh <james.greenhalgh@arm.com>
{
rtx op = x;
+ /* We accept both ROTATERT and ROTATE: since the RHS must be a constant
+ we can convert both to ROR during final output. */
if ((GET_CODE (op) == ASHIFT
|| GET_CODE (op) == ASHIFTRT
- || GET_CODE (op) == LSHIFTRT)
+ || GET_CODE (op) == LSHIFTRT
+ || GET_CODE (op) == ROTATERT
+ || GET_CODE (op) == ROTATE)
&& CONST_INT_P (XEXP (op, 1)))
return XEXP (op, 0);
[(set_attr "type" "logic_shift_imm")]
)
-;; zero_extend version of above
+(define_insn "*<optab>_rol<mode>3"
+ [(set (match_operand:GPI 0 "register_operand" "=r")
+ (LOGICAL:GPI (rotate:GPI
+ (match_operand:GPI 1 "register_operand" "r")
+ (match_operand:QI 2 "aarch64_shift_imm_<mode>" "n"))
+ (match_operand:GPI 3 "register_operand" "r")))]
+ ""
+ "<logical>\\t%<w>0, %<w>3, %<w>1, ror (<sizen> - %2)"
+ [(set_attr "type" "logic_shift_imm")]
+)
+
+;; zero_extend versions of above
(define_insn "*<LOGICAL:optab>_<SHIFT:optab>si3_uxtw"
[(set (match_operand:DI 0 "register_operand" "=r")
(zero_extend:DI
[(set_attr "type" "logic_shift_imm")]
)
+(define_insn "*<optab>_rolsi3_uxtw"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (zero_extend:DI
+ (LOGICAL:SI (rotate:SI
+ (match_operand:SI 1 "register_operand" "r")
+ (match_operand:QI 2 "aarch64_shift_imm_si" "n"))
+ (match_operand:SI 3 "register_operand" "r"))))]
+ ""
+ "<logical>\\t%w0, %w3, %w1, ror (32 - %2)"
+ [(set_attr "type" "logic_shift_imm")]
+)
+
(define_insn "one_cmpl<mode>2"
[(set (match_operand:GPI 0 "register_operand" "=r")
(not:GPI (match_operand:GPI 1 "register_operand" "r")))]