public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Peter Bergner <bergner@linux.ibm.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: David Edelsohn <dje.gcc@gmail.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: rs6000: Prefer assigning the MMA vector operands to altivec registers [PR105556]
Date: Tue, 10 May 2022 18:07:40 -0500	[thread overview]
Message-ID: <3a52445c-face-46eb-bc61-07f9d9cc79ca@linux.ibm.com> (raw)
In-Reply-To: <eb298c6e-64ad-fcdb-992e-730784fd98a7@linux.ibm.com>

On 5/10/22 5:46 PM, Peter Bergner wrote:
>> Out of interest, did you try using v,?wa (so just two alternatives, not
>> four)?  Or did you think it wouldresult in  measurably worse code?  Or
>> did you decide it is not such bad backend code size explosion after
>> all :-)
> 
> I have not tried that, but I will and see what happens.
> I'm slightly worried that since 'v' is part of 'wa', then saying
> '?wa' might just cancel the 'v' usage, but I'll see how it works.
> If it works and simplifies the patch, great!  I'll report back.

So using 'v','?wa' for both vector operands does give us the code we want
for this loop.  Yea!

However, looking closer, that 2 alternative version isn't quite as "optimal"
as the version with 4 alternatives 'v','v','?d','?d' and 'v','?d','v','?d'.
That's because the 2 alt version is an all or nothing thing, you either get
both 'v' operands or you potentially get both 'd'.  The 4 alt version is
more fine grained and has alternatives where one gets a 'v' for sure and the
other a 'd'.

That said, if even one operand is forced into a 'd' register, then our chances
of good performance are lost, so the fact we can get one in a 'v' probably
doesn't matter and given it's cleaner code with fewer alternatives, let's go
with 'v','?wa'.  Ok with you?

I'll kick off a bootstrap and regtest with that change.

Peter

      reply	other threads:[~2022-05-10 23:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-10 20:47 Peter Bergner
2022-05-10 22:35 ` Segher Boessenkool
2022-05-10 22:46   ` Peter Bergner
2022-05-10 23:07     ` Peter Bergner [this message]

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=3a52445c-face-46eb-bc61-07f9d9cc79ca@linux.ibm.com \
    --to=bergner@linux.ibm.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --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).