From: "Kewen.Lin" <linkw@linux.ibm.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
David Edelsohn <dje.gcc@gmail.com>,
Peter Bergner <bergner@linux.ibm.com>
Subject: Re: [PATCH] rs6000: Fix vector_set_var_p9 by considering BE [PR108807]
Date: Tue, 4 Apr 2023 13:19:47 +0800 [thread overview]
Message-ID: <f6e7cc20-2185-5e91-635a-eb9bc97583d2@linux.ibm.com> (raw)
In-Reply-To: <20230403114406.GA25951@gate.crashing.org>
Hi Segher,
Thanks for the review!
on 2023/4/3 19:44, Segher Boessenkool wrote:
> Hi!
>
> On Fri, Feb 17, 2023 at 05:55:04PM +0800, Kewen.Lin wrote:
>> As PR108807 exposes, the current handling in function
>> rs6000_expand_vector_set_var_p9 doesn't take care of big
>> endianness. Currently the function is to rotate the
>> target vector by moving element to-be-set to element 0,
>> set element 0 with the given val, then rotate back. To
>> get the permutation control vector for the rotation, it
>> makes use of lvsr and lvsl, but the element ordering is
>> different for BE and LE (like element 0 is the most
>> significant one on BE while the least significant one on
>> LE), this patch is to add consideration for BE and make
>> sure permutation control vectors for rotations are expected.
>
>> --- a/gcc/config/rs6000/rs6000.cc
>> +++ b/gcc/config/rs6000/rs6000.cc
>> @@ -7235,22 +7235,26 @@ rs6000_expand_vector_set_var_p9 (rtx target, rtx val, rtx idx)
>>
>> machine_mode shift_mode;
>> rtx (*gen_ashl)(rtx, rtx, rtx);
>> - rtx (*gen_lvsl)(rtx, rtx);
>> - rtx (*gen_lvsr)(rtx, rtx);
>> + rtx (*gen_pcvr1)(rtx, rtx);
>> + rtx (*gen_pcvr2)(rtx, rtx);
>
> Space before "(" btw, you can fix that at the same time? :-)
>
Good catch, fixed.
> What does "pcvr" mean? You could put that in a short comment?
>
>> + /* Generate one permutation control vector used for rotating the element
>
> Ah. Yeah just "/* Permutation control vector */" for the above one
> prevents all mysteries :-)
One comment line added for gen_* function pointers.
>
> Patch looks good. Thanks!
>
Pushed as r13-6994-gd634e6088f139e, thanks!
BR,
Kewen
prev parent reply other threads:[~2023-04-04 5:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-17 9:55 Kewen.Lin
2023-03-20 6:35 ` PING^1 " Kewen.Lin
2023-04-03 11:44 ` Segher Boessenkool
2023-04-04 5:19 ` Kewen.Lin [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=f6e7cc20-2185-5e91-635a-eb9bc97583d2@linux.ibm.com \
--to=linkw@linux.ibm.com \
--cc=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).