public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Edelsohn <dje.gcc@gmail.com>
To: "Paul A. Clarke" <pc@us.ibm.com>
Cc: Segher Boessenkool <segher@kernel.crashing.org>,
	GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] rs6000: Add Power10 optimization for _mm_blendv*
Date: Fri, 7 Jan 2022 15:50:52 -0500	[thread overview]
Message-ID: <CAGWvnyksg_smk-A=dB+BqLCdTRUiDTYz3LNzNC9CJ-V0ouPaFA@mail.gmail.com> (raw)
In-Reply-To: <YdijTTbkmr4F/ZVj@li-24c3614c-2adc-11b2-a85c-85f334518bdb.ibm.com>

On Fri, Jan 7, 2022 at 3:32 PM Paul A. Clarke <pc@us.ibm.com> wrote:
>
> On Fri, Jan 07, 2022 at 02:15:22PM -0500, David Edelsohn wrote:
> > > Power10 ISA added `xxblendv*` instructions which are realized in the
> > > `vec_blendv` instrinsic.
> > >
> > > Use `vec_blendv` for `_mm_blendv_epi8`, `_mm_blendv_ps`, and
> > > `_mm_blendv_pd` compatibility intrinsics, when `_ARCH_PWR10`.
> > >
> > > Also, copy a test from i386 for testing `_mm_blendv_ps`.
> > > This should have come with commit ed04cf6d73e233c74c4e55c27f1cbd89ae4710e8,
> > > but was inadvertently omitted.
> > >
> > > 2021-10-20  Paul A. Clarke  <pc@us.ibm.com>
> > >
> > > gcc
> > > * config/rs6000/smmintrin.h (_mm_blendv_epi8): Use vec_blendv
> > > when _ARCH_PWR10.
> > > (_mm_blendv_ps): Likewise.
> > > (_mm_blendv_pd): Likewise.
> > >
> > > gcc/testsuite
> > > * gcc.target/powerpc/sse4_1-blendvps.c: Copy from gcc.target/i386,
> > > adjust dg directives to suit.
> > > ---
> > > Tested on Power10 powerpc64le-linux (compiled with and without
> > > `-mcpu=power10`).
> > >
> > > OK for trunk?
> >
> > This is okay modulo
> >
> > > + return (__m128i) vec_blendv ((__v16qu) __A, (__v16qu) __B, (__v16qu) __mask);
> >
> > Should the above be __v16qi like x86?
>
> That does arguably match the types involved (epi8) better.
>
> Shall I change the original implementation as well (4 lines later)?
>
> >   return (__m128i) vec_sel ((__v16qi) __A, (__v16qi) __B, __lmask);

vec_blendv supports the signed type, so it seems that the function
should use that type, unless unsigned is preferred because PowerPC
defaults to unsigned char.

I wasn't going to recommend changing the existing code because I don't
know how the signed type interacts with the other builtins.

Thanks, David

  reply	other threads:[~2022-01-07 20:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-07 19:15 David Edelsohn
2022-01-07 20:32 ` Paul A. Clarke
2022-01-07 20:50   ` David Edelsohn [this message]
2022-01-10 18:27     ` [v2 COMMITTED] " Paul A. Clarke
  -- strict thread matches above, loose matches on Subject: below --
2021-10-21  1:42 [PATCH] " Paul A. Clarke

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='CAGWvnyksg_smk-A=dB+BqLCdTRUiDTYz3LNzNC9CJ-V0ouPaFA@mail.gmail.com' \
    --to=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=pc@us.ibm.com \
    --cc=segher@kernel.crashing.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).