| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -msse4.1" } */ |
| 3 |
|
| 4 |
typedef unsigned int v4si __attribute__((vector_size(16))); |
| 5 |
typedef float v4sf __attribute__((vector_size(16))); |
| 6 |
|
| 7 |
v4si foo_1(v4si x, v4si y) { return (v4si){x[0],y[3],x[2],x[3]}; } |
| 8 |
v4si foo_2(v4si x, v4si y) { return (v4si){y[0],x[2],y[2],y[3]}; } |
| 9 |
v4si foo_3(v4si x, v4si y) { return (v4si){x[3],y[1],y[2],y[3]}; } |
| 10 |
|
| 11 |
v4sf bar_1(v4sf x, v4sf y) { return (v4sf){y[0],x[3],y[2],y[3]}; } |
| 12 |
v4sf bar_2(v4sf x, v4sf y) { return (v4sf){x[0],y[2],x[2],x[3]}; } |
| 13 |
v4sf bar_3(v4sf x, v4sf y) { return (v4sf){y[3],x[1],x[2],x[3]}; } |
| 14 |
|
| 15 |
/* { dg-final { scan-assembler-times "\tv?insertps\t" 6 } } */ |
| 16 |
/* { dg-final { scan-assembler-not "pshufd" } } */ |
| 17 |
/* { dg-final { scan-assembler-not "pblendw" } } */ |
| 18 |
/* { dg-final { scan-assembler-not "shufps" } } */ |
| 19 |
/* { dg-final { scan-assembler-not "blendps" } } */ |