| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O -fdump-tree-fre1" } */ |
| 3 |
/* { dg-additional-options "--param=riscv-two-source-permutes" { target riscv*-*-* } } */ |
| 4 |
|
| 5 |
typedef int veci __attribute__ ((vector_size (4 * sizeof (int)))); |
| 6 |
typedef unsigned int vecu __attribute__ ((vector_size (4 * sizeof (unsigned int)))); |
| 7 |
|
| 8 |
void fun (veci *a, veci *b, veci *c) |
| 9 |
{ |
| 10 |
veci r1 = __builtin_shufflevector (*a, *b, 0, 5, 2, 7); |
| 11 |
vecu r2 = __builtin_convertvector (r1, vecu); |
| 12 |
vecu r3 = __builtin_shufflevector (r2, r2, 2, 3, 1, 0); |
| 13 |
*c = __builtin_convertvector (r3, veci); |
| 14 |
} |
| 15 |
|
| 16 |
/* { dg-final { scan-tree-dump "VEC_PERM_EXPR.*{ 2, 7, 5, 0 }" "fre1" } } */ |
| 17 |
/* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR" 1 "fre1" } } */ |