[Linuxppc-users] 256 bit aligned variables

Frederic DUMOULIN frederic.dumoulin at mipsology.com
Thu Jun 22 16:19:15 AEST 2017


Hi,

I'd like to manage 256 bit aligned variables.
So I use gcc's vector_size attribute like in the following example:

typedef long long  uint256_t __attribute__ ((vector_size (8 * sizeof 
(uint32_t))));
int main (void)
{
     volatile uint256_t inVar256, outVar256;
     outVar256 = inVar256;
}

On x86_64, I use -mavx so gcc generates AVX instructions.
Disassembling the object file, I've got:
     outVar256 = inVar256;
   13:    c5 fd 6f 45 b0           vmovdqa -0x50(%rbp),%ymm0
   18:    c5 fd 7f 45 d0           vmovdqa %ymm0,-0x30(%rbp)

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

I'm new on ppc and not familiar with ppc instructions but it doesn't 
seem to be SIMD instructions.
How can I generate 256 bit aligned instructions ?

For more details, the goal is to drive a PCIe board and to generate 256 
bit aligned memcpy from host memory to PCIe bus.

Thanks,
Fred



More information about the Linuxppc-users mailing list