| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-require-effective-target vect_float } */ |
| 3 |
/* { dg-additional-options "-fdisable-tree-cunrolli" } */ |
| 4 |
|
| 5 |
struct vector |
| 6 |
{ |
| 7 |
vector() : x(0), y(0), z(0) { } |
| 8 |
float x,y,z; |
| 9 |
}; |
| 10 |
|
| 11 |
struct Foo |
| 12 |
{ |
| 13 |
int dummy; |
| 14 |
/* Misaligned access. */ |
| 15 |
vector array_of_vectors[4]; |
| 16 |
}; |
| 17 |
|
| 18 |
Foo foo; |
| 19 |
|
| 20 |
int main() { } |
| 21 |
|
| 22 |
/* On older powerpc hardware (POWER7 and earlier), the default flag |
| 23 |
-mno-allow-movmisalign prevents vectorization. On POWER8 and later, |
| 24 |
when vect_hw_misalign is true, vectorization occurs. For other |
| 25 |
targets, ! vect_no_align is a sufficient test. */ |
| 26 |
|
| 27 |
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { { { ! vect_no_align } && { ! powerpc*-*-* } } || { powerpc*-*-* && vect_hw_misalign } } } } } */ |
| 28 |
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { { { ! vect_no_align } && { ! powerpc*-*-* } } || { powerpc*-*-* && vect_hw_misalign } } } } } */ |
| 29 |
|
| 30 |
|