public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Andrew Stubbs <ams@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc/devel/omp/gcc-12] amdgcn: Add vector integer negate insn
Date: Wed, 12 Oct 2022 10:46:19 +0000 (GMT)	[thread overview]
Message-ID: <20221012104619.4CD273895FD7@sourceware.org> (raw)

https://gcc.gnu.org/g:a199fcd8bb00be552c49ea2ddc6510f6e383c3b7

commit a199fcd8bb00be552c49ea2ddc6510f6e383c3b7
Author: Andrew Stubbs <ams@codesourcery.com>
Date:   Thu Sep 22 12:48:30 2022 +0100

    amdgcn: Add vector integer negate insn
    
    Another example of the vectorizer needing explicit insns where the scalar
    expander just works.
    
    gcc/ChangeLog:
    
            * config/gcn/gcn-valu.md (neg<mode>2): New define_expand.

Diff:
---
 gcc/ChangeLog.omp          |  7 +++++++
 gcc/config/gcn/gcn-valu.md | 13 +++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/gcc/ChangeLog.omp b/gcc/ChangeLog.omp
index c388c4833f5..7dcc2202072 100644
--- a/gcc/ChangeLog.omp
+++ b/gcc/ChangeLog.omp
@@ -1,3 +1,10 @@
+2022-10-12  Andrew Stubbs  <ams@codesourcery.com>
+
+	Backport from mainline:
+	2022-10-11  Andrew Stubbs  <ams@codesourcery.com>
+
+	* config/gcn/gcn-valu.md (neg<mode>2): New define_expand.
+
 2022-10-12  Andrew Stubbs  <ams@codesourcery.com>
 
 	Backport from mainline:
diff --git a/gcc/config/gcn/gcn-valu.md b/gcc/config/gcn/gcn-valu.md
index 3e7434a02a8..9691ff480ce 100644
--- a/gcc/config/gcn/gcn-valu.md
+++ b/gcc/config/gcn/gcn-valu.md
@@ -2393,6 +2393,19 @@
   [(set_attr "type" "vop2,ds")
    (set_attr "length" "8,8")])
 
+;; }}}
+;; {{{ Int unops
+
+(define_expand "neg<mode>2"
+  [(match_operand:V_INT 0 "register_operand")
+   (match_operand:V_INT 1 "register_operand")]
+  ""
+  {
+    emit_insn (gen_sub<mode>3 (operands[0], gcn_vec_constant (<MODE>mode, 0),
+			       operands[1]));
+    DONE;
+  })
+
 ;; }}}
 ;; {{{ FP binops - special cases

                 reply	other threads:[~2022-10-12 10:46 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=20221012104619.4CD273895FD7@sourceware.org \
    --to=ams@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).