[Patch, AArch64] Fix shuffle for big-endian.

Tejas Belagod tbelagod@arm.com
Tue Mar 25 17:24:00 GMT 2014


Richard Henderson wrote:
> On 02/21/2014 08:30 AM, Tejas Belagod wrote:
>> +      /* If two vectors, we end up with a wierd mixed-endian mode on NEON.  */
>> +      if (BYTES_BIG_ENDIAN)
>> +	{
>> +	  if (!d->one_vector_p && d->perm[i] & nunits)
>> +	    {
>> +	      /* Extract the offset.  */
>> +	      elt = d->perm[i] & (nunits - 1);
>> +	      /* Reverse the top half.  */
>> +	      elt = nunits - 1 - elt;
>> +	      /* Offset it by the bottom half.  */
>> +	      elt += nunits;
>> +	    }
>> +	  else
>> +	    elt = nunits - 1 - d->perm[i];
>> +	}
> 
> Isn't this just
> 
>   elt = d->perm[i] ^ (nunits - 1);
> 
> all the time?  I.e. invert the index within the word,
> but leave the word index (nunits) unchanged.
> 

Yes, I think that works. Thanks!

Tejas.



More information about the Gcc-patches mailing list