| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-additional-options "-mvsx" } */ |
| 3 |
/* { dg-require-effective-target vect_int } */ |
| 4 |
/* { dg-require-effective-target powerpc_vsx } */ |
| 5 |
|
| 6 |
/* Verify we do cost the required vec_perm. */ |
| 7 |
|
| 8 |
int |
| 9 |
foo (int *a, int *b, int len) |
| 10 |
{ |
| 11 |
int i; |
| 12 |
int *a1 = a; |
| 13 |
int *a0 = a1 - 4; |
| 14 |
for (i = 0; i < len; i++) |
| 15 |
{ |
| 16 |
*b = *a0 + *a1; |
| 17 |
b--; |
| 18 |
a0++; |
| 19 |
a1++; |
| 20 |
} |
| 21 |
return 0; |
| 22 |
} |
| 23 |
|
| 24 |
/* The reason why it doesn't check the exact count is that |
| 25 |
we can get more than 1 vec_perm when it's compiled with |
| 26 |
partial vector capability like Power10 (retrying for |
| 27 |
the epilogue) or it's complied without unaligned vector |
| 28 |
memory access support (realign). */ |
| 29 |
/* { dg-final { scan-tree-dump {\mvec_perm\M} "vect" } } */ |