[Linuxppc-users] 256 bit aligned variables

Pat Haugen pthaugen at linux.vnet.ibm.com
Sat Jun 24 02:28:07 AEST 2017


On 06/22/2017 08:07 PM, Steve Munroe wrote:
>> On ppc (cross-compiling with: /opt/at10.0/bin/powerpc64le-linux-gnu-gcc
>> -I. -g -O -mcpu=powerpc64le -mvsx -c main.c -o main.o), I've got:
>>      outVar256 = inVar256;
>>    1c:    40 00 40 39     li      r10,64
>>    20:    98 56 89 7d     lxvd2x  vs12,r9,r10
>>    24:    10 00 40 39     li      r10,16
>>    28:    50 00 00 39     li      r8,80
>>    2c:    98 46 09 7c     lxvd2x  vs0,r9,r8
>>    30:    98 4f 80 7d     stxvd2x vs12,0,r9
>>    34:    98 57 09 7c     stxvd2x vs0,r9,r10
>>    38:    98 4e 80 7d     lxvd2x  vs12,0,r9
>>    3c:    98 56 09 7c     lxvd2x  vs0,r9,r10
>>    40:    20 00 40 39     li      r10,32
>>    44:    98 57 89 7d     stxvd2x vs12,r9,r10
>>    48:    30 00 40 39     li      r10,48
>>    4c:    98 57 09 7c     stxvd2x vs0,r9,r10
>>
> Again think RISC not CISC. The compiler broke the 256-bit vector into pairs
> of 128-bit vector operations.
> 

Except that it also introduced a temp...

temp256 = inVar256;
outVar256 = temp256;

So we get twice the number of moves as necessary. Probably a compiler
issue, but another argument for not trying to operate on 256-bit vectors
on PowerPC.


-Pat



More information about the Linuxppc-users mailing list