| 1 |
/* PR target/101021 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-O2 -mavx" } */ |
| 4 |
/* { dg-final { scan-assembler-not "vpshufb" } } */ |
| 5 |
|
| 6 |
typedef char S; |
| 7 |
typedef S V __attribute__((vector_size(16 * sizeof(S)))); |
| 8 |
|
| 9 |
V t1 (V x) |
| 10 |
{ |
| 11 |
return __builtin_shuffle (x, (V) { 8,9,10,11,12,13,14,15, 0,1,2,3,4,5,6,7 }); |
| 12 |
} |
| 13 |
|
| 14 |
/* { dg-final { scan-assembler "vpalignr" } } */ |
| 15 |
|
| 16 |
V t2 (V x) |
| 17 |
{ |
| 18 |
return __builtin_shuffle (x, (V) { 0,1,2,3, 4,5,6,7, 4,5,6,7, 12,13,14,15 }); |
| 19 |
} |
| 20 |
|
| 21 |
/* { dg-final { scan-assembler "vpshufd" } } */ |
| 22 |
|
| 23 |
V t3 (V x) |
| 24 |
{ |
| 25 |
return __builtin_shuffle (x, (V) { 0,1, 2,3, 2,3, 6,7, 8,9,10,11,12,13,14,15 }); |
| 26 |
} |
| 27 |
|
| 28 |
/* { dg-final { scan-assembler "vpshuflw" } } */ |
| 29 |
|
| 30 |
V t4 (V x) |
| 31 |
{ |
| 32 |
return __builtin_shuffle (x, (V) { 0,1,2,3,4,5,6,7, 8,9, 10,11, 10,11, 14,15 }); |
| 33 |
} |
| 34 |
|
| 35 |
/* { dg-final { scan-assembler "vpshufhw" } } */ |