| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -Wno-psabi -mavx2 -fdump-tree-forwprop1" } */ |
| 3 |
|
| 4 |
typedef double v4df __attribute__((vector_size (32))); |
| 5 |
typedef float v8sf __attribute__((vector_size (32))); |
| 6 |
typedef float v4sf __attribute__((vector_size (16))); |
| 7 |
typedef int v4si __attribute__((vector_size (16))); |
| 8 |
typedef double v2df __attribute__((vector_size (16))); |
| 9 |
|
| 10 |
v2df |
| 11 |
foo (v4df x, double *p, v2df y) |
| 12 |
{ |
| 13 |
return (v2df) { x[3], *p }; |
| 14 |
} |
| 15 |
|
| 16 |
v4sf |
| 17 |
bar (v4si x, float *p) |
| 18 |
{ |
| 19 |
return (v4sf) { x[0], x[1], x[2], *p }; |
| 20 |
} |
| 21 |
|
| 22 |
v4sf |
| 23 |
baz (v4si x) |
| 24 |
{ |
| 25 |
return (v4sf) { x[0], x[1], 3.0f, 1.0f }; |
| 26 |
} |
| 27 |
|
| 28 |
v4sf |
| 29 |
barf (v8sf x) |
| 30 |
{ |
| 31 |
return (v4sf) { x[4], x[5], 1.0f, 2.0f }; |
| 32 |
} |
| 33 |
|
| 34 |
/* For bar we do two inserts, first zero, then convert, then insert *p. } */ |
| 35 |
/* { dg-final { scan-tree-dump-times "BIT_INSERT_EXPR" 2 "forwprop1" } } */ |
| 36 |
/* We expect all other CTORs to turn into permutes, the FP converting ones |
| 37 |
to two each with the one with constants possibly elided in the future |
| 38 |
by converting 3.0f and 1.0f "back" to integers. */ |
| 39 |
/* For foo we do nothing. */ |
| 40 |
/* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR" 3 "forwprop1" } } */ |
| 41 |
/* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR" 2 "forwprop1" { xfail *-*-* } } } */ |