From: Richard Earnshaw Date: Wed, 23 Apr 2014 17:00:40 +0000 (+0000) Subject: [AArch64] Fully support rotate on logical operations. X-Git-Tag: releases/gcc-5.1.0~7969 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=57b77d46b6a45f8d7ef8fd82cfddfa1aafce8cab;p=thirdparty%2Fgcc.git [AArch64] Fully support rotate on logical operations. From-SVN: r209711 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 021427b3ac5b..724fa3b85891 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-04-23 Richard Earnshaw + + * aarch64.md (_rol3): New pattern. + (_rolsi3_uxtw): Likewise. + * aarch64.c (aarch64_strip_shift): Handle ROTATE and ROTATERT. + 2014-04-23 James Greenhalgh * config/arm/arm.c (arm_cortex_a57_tune): Initialize all fields. diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 277c0875032a..496d1b8f041c 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -4471,9 +4471,13 @@ aarch64_strip_shift (rtx x) { 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); diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index 98c46d13bf42..1c017e7d6b62 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -2565,7 +2565,18 @@ [(set_attr "type" "logic_shift_imm")] ) -;; zero_extend version of above +(define_insn "*_rol3" + [(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_" "n")) + (match_operand:GPI 3 "register_operand" "r")))] + "" + "\\t%0, %3, %1, ror ( - %2)" + [(set_attr "type" "logic_shift_imm")] +) + +;; zero_extend versions of above (define_insn "*_si3_uxtw" [(set (match_operand:DI 0 "register_operand" "=r") (zero_extend:DI @@ -2578,6 +2589,18 @@ [(set_attr "type" "logic_shift_imm")] ) +(define_insn "*_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"))))] + "" + "\\t%w0, %w3, %w1, ror (32 - %2)" + [(set_attr "type" "logic_shift_imm")] +) + (define_insn "one_cmpl2" [(set (match_operand:GPI 0 "register_operand" "=r") (not:GPI (match_operand:GPI 1 "register_operand" "r")))]