public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: gcc-patches@gcc.gnu.org
Cc: dje.gcc@gmail.com,	Segher Boessenkool <segher@kernel.crashing.org>
Subject: [PATCH] rs6000: Add second variant of adde
Date: Wed, 29 Nov 2017 22:34:00 -0000	[thread overview]
Message-ID: <1c14d1ae7148d3b01a3441960f90089b13838607.1511994173.git.segher@kernel.crashing.org> (raw)

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.


Segher


2017-11-28  Segher Boessenkool  <segher@kernel.crashing.org>

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

---
 gcc/config/rs6000/rs6000.md | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 20b1581..7e91d54 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -1915,6 +1915,16 @@ (define_insn "*add<mode>3_carry_in_internal"
   "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")
-- 
1.8.3.1

                 reply	other threads:[~2017-11-29 22:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1c14d1ae7148d3b01a3441960f90089b13838607.1511994173.git.segher@kernel.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).