AArch64 backend support for SBC instruction.
authorIan Bolton <ian.bolton@arm.com>
Tue, 19 Mar 2013 16:23:08 +0000 (16:23 +0000)
committerIan Bolton <ibolton@gcc.gnu.org>
Tue, 19 Mar 2013 16:23:08 +0000 (16:23 +0000)
From-SVN: r196797

gcc/ChangeLog
gcc/config/aarch64/aarch64.md
gcc/testsuite/ChangeLog

index d55999e..b6ae43a 100644 (file)
@@ -1,5 +1,10 @@
 2013-03-19  Ian Bolton  <ian.bolton@arm.com>
 
+       * config/aarch64/aarch64.md (*sub<mode>3_carryin): New pattern.
+       (*subsi3_carryin_uxtw): Likewise.
+
+2013-03-19  Ian Bolton  <ian.bolton@arm.com>
+
        * config/aarch64/aarch64.md (*ror<mode>3_insn): New pattern.
        (*rorsi3_insn_uxtw): Likewise.
 
index 4358b44..c99e188 100644 (file)
    (set_attr "mode" "SI")]
 )
 
+(define_insn "*sub<mode>3_carryin"
+  [(set
+    (match_operand:GPI 0 "register_operand" "=r")
+    (minus:GPI (minus:GPI
+               (match_operand:GPI 1 "register_operand" "r")
+               (ltu:GPI (reg:CC CC_REGNUM) (const_int 0)))
+              (match_operand:GPI 2 "register_operand" "r")))]
+   ""
+   "sbc\\t%<w>0, %<w>1, %<w>2"
+  [(set_attr "v8type" "adc")
+   (set_attr "mode" "<MODE>")]
+)
+
+;; zero_extend version of the above
+(define_insn "*subsi3_carryin_uxtw"
+  [(set
+    (match_operand:DI 0 "register_operand" "=r")
+    (zero_extend:DI
+     (minus:SI (minus:SI
+               (match_operand:SI 1 "register_operand" "r")
+               (ltu:SI (reg:CC CC_REGNUM) (const_int 0)))
+              (match_operand:SI 2 "register_operand" "r"))))]
+   ""
+   "sbc\\t%w0, %w1, %w2"
+  [(set_attr "v8type" "adc")
+   (set_attr "mode" "SI")]
+)
+
 (define_insn "*sub_uxt<mode>_multp2"
   [(set (match_operand:GPI 0 "register_operand" "=rk")
        (minus:GPI (match_operand:GPI 4 "register_operand" "r")
index e198a6e..6769ff7 100644 (file)
@@ -1,5 +1,9 @@
 2013-03-19  Ian Bolton  <ian.bolton@arm.com>
 
+       * gcc.target/aarch64/sbc.c: New test.
+
+2013-03-19  Ian Bolton  <ian.bolton@arm.com>
+
        * gcc.target/aarch64/ror.c: New test.
 
 2013-03-19  Ian Bolton  <ian.bolton@arm.com>