| 1 |
/* { dg-require-effective-target vect_int } */ |
| 2 |
|
| 3 |
#include "tree-vect.h" |
| 4 |
|
| 5 |
int a[64]; |
| 6 |
int b[128]; |
| 7 |
|
| 8 |
void __attribute__((noinline, noclone)) |
| 9 |
foo (int s) |
| 10 |
{ |
| 11 |
int i; |
| 12 |
for (i = 0; i < 32; ++i) |
| 13 |
{ |
| 14 |
a[2*i] = b[i*s+1]; |
| 15 |
a[2*i+1] = b[i*s]; |
| 16 |
} |
| 17 |
} |
| 18 |
|
| 19 |
int main () |
| 20 |
{ |
| 21 |
int i; |
| 22 |
check_vect (); |
| 23 |
for (i = 0; i < 128; ++i) |
| 24 |
{ |
| 25 |
b[i] = i; |
| 26 |
__asm__ volatile (""); |
| 27 |
} |
| 28 |
foo (4); |
| 29 |
#pragma GCC novector |
| 30 |
for (i = 0; i < 64; ++i) |
| 31 |
if (a[i] != (4*(i/2) + (i & 1) ^ 1)) |
| 32 |
abort (); |
| 33 |
return 0; |
| 34 |
} |
| 35 |
|
| 36 |
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_perm } } } */ |