This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, rs6000] Change word selector to prefered location for vec_insert builtin
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Carl Love <cel at us dot ibm dot com>
- Cc: gcc-patches at gcc dot gnu dot org, David Edelsohn <dje dot gcc at gmail dot com>, Bill Schmidt <wschmidt at linux dot vnet dot ibm dot com>
- Date: Fri, 22 Jun 2018 19:56:34 -0500
- Subject: Re: [PATCH, rs6000] Change word selector to prefered location for vec_insert builtin
- References: <1529677967.7264.8.camel@us.ibm.com>
Hi Carl,
On Fri, Jun 22, 2018 at 07:32:47AM -0700, Carl Love wrote:
> The following patch changes the word selected when extracting the word
> from the second vector to insert into the first vector by the
> vec_insert() builtin.
>
> Specifically, the test case
>
> vector float
> fn2 (float a, vector float b)
> {
> return vec_insert (a, b, 1);
> }
>
> without the patch generates the code sequence
>
> xscvdpspn vs0,vs1
> xxextractuw vs0,vs0,4
> xxinsertw vs34,vs0,8
[ For -mcpu=power9 -mlittle ]
Is this from something in the testsuite? I can't find it.
> The xscvdpspn places the extracted word into words 0 and 1 of the
> destination. The xxextractuw extracts word 1 (offset of 4 bytes)from
> the source. The patch changes the offset so that the xxexractuw will
> extract word 0 (offset 0 bytes) instead of word 1. The values are the
> same so there is no functional change. But it was decided that using
> word 0 was preferred choice.
The patch looks fine. Okay for trunk. Thanks!
Segher