This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, rs6000] Fix rs6000_expand_vector_set for little endian


On Thu, Oct 31, 2013 at 9:45 PM, Bill Schmidt
<wschmidt@linux.vnet.ibm.com> wrote:
> Hi,
>
> Brooks Moses reported a bug with code that sets a single element of a
> vector to a given value and the rest of the vector to zero.  This is
> implemented in rs6000_expand_vector_set, which uses a vperm instruction
> to place the nonzero value.  As usual, we need to adjust the permute
> control vector and swap the order of the input operands.  I added a test
> case based on the bug report.
>
> Bootstrapped and tested on powerpc64{,le}-unknown-linux-gnu with no
> regressions.  The new test now passes for both endiannesses.  Is this ok
> for trunk?
>
> Thanks,
> Bill
>
>
> gcc:
>
> 2013-10-31  Bill Schmidt  <wschmidt@vnet.linux.ibm.com>
>
>         * config/rs6000/rs6000.c (rs6000_expand_vector_set): Adjust for
>         little endian.

This is okay.

> +  if (!BYTES_BIG_ENDIAN)

But negating the expression and reversing the branches seems superfluous.

Thanks, David


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]