[ARC] Add simple shift/rotate ops.
authorClaudiu Zissulescu <claziss@synopsys.com>
Wed, 28 Sep 2016 13:26:32 +0000 (15:26 +0200)
committerClaudiu Zissulescu <claziss@gcc.gnu.org>
Wed, 28 Sep 2016 13:26:32 +0000 (15:26 +0200)
2016-09-29  Claudiu Zissulescu  <claziss@synopsys.com>

* config/arc/arc.md (*rotrsi3_cnt1): New pattern,
(*ashlsi2_cnt1, *lshrsi3_cnt1, *ashrsi3_cnt1): Likewise.

From-SVN: r240576

gcc/ChangeLog
gcc/config/arc/arc.md

index e1e8bc385cb14a1651f46e9dfa3cad4df8849fa4..51afcec073755d3aaecc2a0d8416b5ecdab97af1 100644 (file)
@@ -1,3 +1,8 @@
+2016-09-29  Claudiu Zissulescu  <claziss@synopsys.com>
+
+       * config/arc/arc.md (*rotrsi3_cnt1): New pattern.
+       (*ashlsi2_cnt1, *lshrsi3_cnt1, *ashrsi3_cnt1): Likewise.
+
 2016-09-28  Nathan Sidwell  <nathan@acm.org>
 
        * gimple-pretty-print.c (dump_gimple_call_args): Simplify "' "
index ac7346bc0a6dd6650912c959bb83a8de9d03036f..715da315d7632975542fa635c3532688d63d2269 100644 (file)
                   (zero_extract:SI (match_dup 1) (match_dup 5) (match_dup 7)))])
    (match_dup 1)])
 
+(define_insn "*rotrsi3_cnt1"
+  [(set (match_operand:SI 0 "dest_reg_operand"             "=w")
+       (rotatert:SI (match_operand:SI 1 "register_operand" "c")
+                    (const_int 1)))]
+  ""
+  "ror %0,%1%&"
+  [(set_attr "type" "shift")
+   (set_attr "predicable" "no")
+   (set_attr "length" "4")])
+
+(define_insn "*ashlsi2_cnt1"
+  [(set (match_operand:SI 0 "dest_reg_operand"           "=Rcqq,w")
+       (ashift:SI (match_operand:SI 1 "register_operand" "Rcqq,c")
+                  (const_int 1)))]
+  ""
+  "asl%? %0,%1%&"
+  [(set_attr "type" "shift")
+   (set_attr "iscompact" "maybe,false")
+   (set_attr "predicable" "no,no")])
+
+(define_insn "*lshrsi3_cnt1"
+  [(set (match_operand:SI 0 "dest_reg_operand"             "=Rcqq,w")
+       (lshiftrt:SI (match_operand:SI 1 "register_operand" "Rcqq,c")
+                    (const_int 1)))]
+  ""
+  "lsr%? %0,%1%&"
+  [(set_attr "type" "shift")
+   (set_attr "iscompact" "maybe,false")
+   (set_attr "predicable" "no,no")])
+
+(define_insn "*ashrsi3_cnt1"
+  [(set (match_operand:SI 0 "dest_reg_operand"             "=Rcqq,w")
+       (ashiftrt:SI (match_operand:SI 1 "register_operand" "Rcqq,c")
+                    (const_int 1)))]
+  ""
+  "asr%? %0,%1%&"
+  [(set_attr "type" "shift")
+   (set_attr "iscompact" "maybe,false")
+   (set_attr "predicable" "no,no")])
+
 ;; include the arc-FPX instructions
 (include "fpx.md")