| 1 |
/* { dg-require-effective-target vect_int } */ |
| 2 |
/* { dg-require-effective-target vect_perm } */ |
| 3 |
|
| 4 |
#include "tree-vect.h" |
| 5 |
|
| 6 |
struct { |
| 7 |
int x_advance; |
| 8 |
int y_advance; |
| 9 |
} a[256]; |
| 10 |
|
| 11 |
int b, c; |
| 12 |
|
| 13 |
void __attribute__((noinline,noclone)) fn1() |
| 14 |
{ |
| 15 |
for (int i = 0; i < 256; i++) |
| 16 |
{ |
| 17 |
c -= a[i].x_advance; |
| 18 |
b -= a[i].y_advance; |
| 19 |
} |
| 20 |
} |
| 21 |
|
| 22 |
int main() |
| 23 |
{ |
| 24 |
check_vect (); |
| 25 |
|
| 26 |
for (int i = 0; i < 256; ++i) |
| 27 |
{ |
| 28 |
a[i].x_advance = i; |
| 29 |
a[i].y_advance = -i + 3; |
| 30 |
__asm__ volatile ("" : : : "memory"); |
| 31 |
} |
| 32 |
|
| 33 |
fn1(); |
| 34 |
|
| 35 |
if (c != -32640 || b != 31872) |
| 36 |
abort (); |
| 37 |
|
| 38 |
return 0; |
| 39 |
} |
| 40 |
|
| 41 |
/* { dg-final { scan-tree-dump "vectorizing stmts using SLP" "vect" } } */ |
| 42 |
/* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR" 0 "vect" } } */ |