| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -msse4.2 -mno-avx -fno-tree-slp-vectorize" } */ |
| 3 |
|
| 4 |
void foo (int * __restrict a, int * __restrict b, int *c, int s) |
| 5 |
{ |
| 6 |
if (s >= 2) |
| 7 |
for (int i = 0; i < 1024; ++i) |
| 8 |
{ |
| 9 |
a[s*i+0] = c[4*i+0]; |
| 10 |
a[s*i+1] = c[4*i+1]; |
| 11 |
b[s*i+0] = c[4*i+2]; |
| 12 |
b[s*i+1] = c[4*i+3]; |
| 13 |
} |
| 14 |
} |
| 15 |
|
| 16 |
/* Vectorization factor two, two two-element stores to a using movq |
| 17 |
and two two-element stores to b via pextrq/movhps of the high part. */ |
| 18 |
/* { dg-final { scan-assembler-times "movq\[\t ]+%xmm\[0-9]" 2 } } */ |
| 19 |
/* { dg-final { scan-assembler-times "pextrq" 2 { target { ! ia32 } } } } */ |
| 20 |
/* { dg-final { scan-assembler-times "movhps" 2 { target { ia32 } } } } */ |