public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Aaron Sawdey <acsawdey@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc(refs/users/acsawdey/heads/fusion-combine)] WIP for add-add fusion
Date: Tue, 26 Jan 2021 22:42:42 +0000 (GMT)	[thread overview]
Message-ID: <20210126224242.4B6C23836C6D@sourceware.org> (raw)

https://gcc.gnu.org/g:969b08c4c1aefb4c0f2244ca1efed2164b108188

commit 969b08c4c1aefb4c0f2244ca1efed2164b108188
Author: Aaron Sawdey <acsawdey@linux.ibm.com>
Date:   Mon Jan 25 21:11:52 2021 -0600

    WIP for add-add fusion

Diff:
---
 gcc/config/rs6000/genfusion.pl | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/gcc/config/rs6000/genfusion.pl b/gcc/config/rs6000/genfusion.pl
index 837af7ac123..1ea08a21a7c 100755
--- a/gcc/config/rs6000/genfusion.pl
+++ b/gcc/config/rs6000/genfusion.pl
@@ -234,6 +234,47 @@ EOF
   }
 }
 
+sub gen_addadd
+{
+
+    my ($kind, $vchr, $op, $mode, $pred, $constraint);
+  KIND: foreach $kind ('scalar','vector') {
+      if ( $kind eq 'vector' ) {
+	  $vchr = "v";
+	  $op = "vaddudm";
+	  $mode = "VM";
+	  $pred = "altivec_register_operand";
+	  $constraint = "v";
+      } else {
+	  $vchr = "";
+	  $op = "add";
+	  $mode = "GPR";
+	  $pred = "gpc_reg_operand";
+	  $constraint = "r";
+      }
+    my $insn = <<"EOF";
+;; add-add fusion pattern generated by gen_addadd
+(define_insn "*fuse_${op}_${op}"
+  [(set (match_operand:${mode} 3 "altivec_register_operand" "=&v,0,1,v")
+        (add:${mode} 
+           (add:${mode} (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") 
+                        (match_operand:VM 1 "altivec_register_operand" "%v,v,v,v")) 
+           (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))
+   (clobber (match_scratch:VM 4 "=X,X,X,r"))]
+  "(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)"
+  "@
+   vxor %3,%1,%0\;vxor %3,%3,%2
+   vxor %0,%1,%0\;vxor %0,%0,%2
+   vxor %1,%1,%0\;vxor %1,%1,%2
+   vxor %4,%1,%0\;vxor %3,%4,%2"
+  [(set_attr "type" "logical")
+   (set_attr "cost" "6")
+   (set_attr "length" "8")])
+EOF
+  }
+    
+}
+
 gen_ld_cmpi_p10();
 gen_2logical();


             reply	other threads:[~2021-01-26 22:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-26 22:42 Aaron Sawdey [this message]
2021-01-26 22:48 Aaron Sawdey
2021-01-27 18:26 Aaron Sawdey
2021-01-30 21:54 Aaron Sawdey

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=20210126224242.4B6C23836C6D@sourceware.org \
    --to=acsawdey@gcc.gnu.org \
    --cc=gcc-cvs@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).