]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
rs6000: Add second variant of adde
authorSegher Boessenkool <segher@kernel.crashing.org>
Wed, 29 Nov 2017 22:30:24 +0000 (23:30 +0100)
committerSegher Boessenkool <segher@gcc.gnu.org>
Wed, 29 Nov 2017 22:30:24 +0000 (23:30 +0100)
This adds a second variant of the adde insn pattern, this one with the
CA register as the second operand.  The existing pattern has it as the
third operand.  It would be ideal if RTL was always canonicalised like
that, but it isn't (and that is not trivial), and this is a simple and
harmless patch.

* config/rs6000/rs6000.md (*add<mode>3_carry_in_internal2): New.

From-SVN: r255259

gcc/ChangeLog
gcc/config/rs6000/rs6000.md

index 8bc4a063697a7f2e74067d673fee1391800607be..62ca3dca421513e6ccfb301475f2fb4fc9400e04 100644 (file)
@@ -1,3 +1,7 @@
+2017-11-29  Segher Boessenkool  <segher@kernel.crashing.org>
+
+       * config/rs6000/rs6000.md (*add<mode>3_carry_in_internal2): New.
+
 2017-11-29  Vladimir Makarov  <vmakarov@redhat.com>
 
        PR rtl-optimization/80818
index c9b35c9104a1fdb448ef9ddfc0d044ad12ce490f..12d5564d26376d7c25c49cb779ac8cac996775c1 100644 (file)
   "adde %0,%1,%2"
   [(set_attr "type" "add")])
 
+(define_insn "*add<mode>3_carry_in_internal2"
+  [(set (match_operand:GPR 0 "gpc_reg_operand" "=r")
+       (plus:GPR (plus:GPR (match_operand:GPR 1 "gpc_reg_operand" "r")
+                           (reg:GPR CA_REGNO))
+                 (match_operand:GPR 2 "gpc_reg_operand" "r")))
+   (clobber (reg:GPR CA_REGNO))]
+  ""
+  "adde %0,%1,%2"
+  [(set_attr "type" "add")])
+
 (define_insn "add<mode>3_carry_in_0"
   [(set (match_operand:GPR 0 "gpc_reg_operand" "=r")
        (plus:GPR (match_operand:GPR 1 "gpc_reg_operand" "r")