| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-skip-if "" { powerpc*-*-darwin* } } */ |
| 3 |
/* { dg-options "-mdejagnu-cpu=power7 -O2 -ftree-vectorize -fno-vect-cost-model -fdump-tree-vect-details" } */ |
| 4 |
/* { dg-require-effective-target powerpc_vsx } */ |
| 5 |
|
| 6 |
/* Taken from vect/vect-95.c. */ |
| 7 |
|
| 8 |
#define N 256 |
| 9 |
|
| 10 |
void bar (short *pd, short *pa, short *pb, short *pc); |
| 11 |
|
| 12 |
__attribute__ ((noinline)) int |
| 13 |
main1 (int n, short * __restrict__ pd, short * __restrict__ pa, short * __restrict__ pb, short * __restrict__ pc) |
| 14 |
{ |
| 15 |
int i; |
| 16 |
|
| 17 |
for (i = 0; i < n; i++) |
| 18 |
{ |
| 19 |
pa[i] = pb[i] * pc[i]; |
| 20 |
pd[i] = 5.0; |
| 21 |
} |
| 22 |
|
| 23 |
bar (pd,pa,pb,pc); |
| 24 |
|
| 25 |
return 0; |
| 26 |
} |
| 27 |
|
| 28 |
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ |
| 29 |
/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */ |
| 30 |
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 2 "vect" } } */ |
| 31 |
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" } } */ |