diff options
author | Segher Boessenkool <segher@kernel.crashing.org> | 2017-11-29 23:30:24 +0100 |
---|---|---|
committer | Segher Boessenkool <segher@gcc.gnu.org> | 2017-11-29 23:30:24 +0100 |
commit | 18b776e936e15310907e014e4e460d45d148bbf6 (patch) | |
tree | a4b9d5a275d732e4fbc2ce408ac37570452e2977 | |
parent | 561c58b4d9d0c4d17a29bc38b50fa2b4762f0afb (diff) | |
download | gcc-18b776e936e15310907e014e4e460d45d148bbf6.zip gcc-18b776e936e15310907e014e4e460d45d148bbf6.tar.gz gcc-18b776e936e15310907e014e4e460d45d148bbf6.tar.bz2 |
rs6000: Add second variant of adde
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
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.md | 10 |
2 files changed, 14 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8bc4a06..62ca3dc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index c9b35c9..12d5564 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -1915,6 +1915,16 @@ "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") |