]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[AArch64] Fully support rotate on logical operations.
authorRichard Earnshaw <rearnsha@arm.com>
Wed, 23 Apr 2014 17:00:40 +0000 (17:00 +0000)
committerMarcus Shawcroft <mshawcroft@gcc.gnu.org>
Wed, 23 Apr 2014 17:00:40 +0000 (17:00 +0000)
From-SVN: r209711

gcc/ChangeLog
gcc/config/aarch64/aarch64.c
gcc/config/aarch64/aarch64.md

index 021427b3ac5bd3f4842dafc7f02b459b19774ecb..724fa3b85891920c48be6c6a4f0331e39926d759 100644 (file)
@@ -1,3 +1,9 @@
+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-04-23  James Greenhalgh  <james.greenhalgh@arm.com>
 
        * config/arm/arm.c (arm_cortex_a57_tune): Initialize all fields.
index 277c0875032a191c02e6d2b0a060b882a1706769..496d1b8f041c6a85cc075b6a5ff22c04c1e8c6e0 100644 (file)
@@ -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);
 
index 98c46d13bf422b31f5f868e5b4ba9a1c972a8510..1c017e7d6b6236b922e4a89f9a6d601ab6c6104e 100644 (file)
   [(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")))]