public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Uros Bizjak <ubizjak@gmail.com>
To: Richard Biener <rguenther@suse.de>
Cc: Hongtao Liu <hongtao.liu@intel.com>,
	 "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	Richard Sandiford <richard.sandiford@arm.com>
Subject: Re: [PATCH][RFC] Add x86 subadd SLP pattern
Date: Fri, 25 Jun 2021 09:55:27 +0200	[thread overview]
Message-ID: <CAFULd4Y0+j_t6CwvZ0aN_0hZ_xOHBrurJGJjDXCi3k=ECqWGKA@mail.gmail.com> (raw)
In-Reply-To: <nycvar.YFH.7.76.2106250847510.9200@zhemvz.fhfr.qr>

On Fri, Jun 25, 2021 at 8:48 AM Richard Biener <rguenther@suse.de> wrote:
>
> On Thu, 24 Jun 2021, Uros Bizjak wrote:
>
> > On Thu, Jun 24, 2021 at 1:07 PM Richard Biener <rguenther@suse.de> wrote:
> >
> > > This addds SLP pattern recognition for the SSE3/AVX [v]addsubp{ds} v0, v1
> > > instructions which compute { v0[0] - v1[0], v0[1], + v1[1], ... }
> > > thus subtract, add alternating on lanes, starting with subtract.
> > >
> > > It adds a corresponding optab and direct internal function,
> > > vec_addsub$a3 and renames the existing i386 backend patterns to
> > > the new canonical name.
> > >
> > > The SLP pattern matches the exact alternating lane sequence rather
> > > than trying to be clever and anticipating incoming permutes - we
> > > could permute the two input vectors to the needed lane alternation,
> > > do the addsub and then permute the result vector back but that's
> > > only profitable in case the two input or the output permute will
> > > vanish - something Tamars refactoring of SLP pattern recog should
> > > make possible.
> >
> > Using the attached patch, I was also able to generate addsub for the
> > following testcase:
> >
> > float x[2], y[2], z[2];
> >
> > void foo ()
> > {
> >   x[0] = y[0] - z[0];
> >   x[1] = y[1] + z[1];
> > }
> >
> >        vmovq   y(%rip), %xmm0
> >        vmovq   z(%rip), %xmm1
> >        vaddsubps       %xmm1, %xmm0, %xmm0
> >        vmovlps %xmm0, x(%rip)
> >        ret
>
> Nice.  But I suppose it can be merged with the other now single
> pattern?

Actually, MMX_WITH_SSE V2SF modes do not support memory operands (they
operate on V2SF subreg of V4SF SSE registers), so a new mode attribute
would be needed to instantiate register operand in case of V2SF.

Uros.
>
> Richard.

  reply	other threads:[~2021-06-25  7:55 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-17  9:44 Richard Biener
2021-06-17  9:54 ` Uros Bizjak
2021-06-17 10:00   ` Richard Biener
2021-06-17 10:09     ` Uros Bizjak
2021-06-17  9:59 ` Uros Bizjak
2021-06-17 10:43   ` Richard Biener
2021-06-17 13:47     ` Richard Biener
2021-06-22  9:42     ` Richard Sandiford
2021-06-22 10:17       ` Uros Bizjak
2021-06-22 10:34         ` Richard Biener
2021-06-22 10:49           ` Uros Bizjak
2021-06-24 11:07             ` Richard Biener
2021-06-24 14:25               ` Uros Bizjak
2021-06-25  6:48                 ` Richard Biener
2021-06-25  7:55                   ` Uros Bizjak [this message]
2021-06-17 10:24 ` Tamar Christina

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='CAFULd4Y0+j_t6CwvZ0aN_0hZ_xOHBrurJGJjDXCi3k=ECqWGKA@mail.gmail.com' \
    --to=ubizjak@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hongtao.liu@intel.com \
    --cc=rguenther@suse.de \
    --cc=richard.sandiford@arm.com \
    /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).