| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-march=rv64gcv_zvfh -mabi=lp64d -O3 -mrvv-vector-bits=zvl" } */ |
| 3 |
|
| 4 |
#include <stdint-gcc.h> |
| 5 |
|
| 6 |
typedef int8_t vnx8i __attribute__ ((vector_size (8))); |
| 7 |
typedef int16_t vnx4i __attribute__ ((vector_size (8))); |
| 8 |
typedef uint8_t vnx8ui __attribute__ ((vector_size (8))); |
| 9 |
typedef uint16_t vnx4ui __attribute__ ((vector_size (8))); |
| 10 |
typedef _Float16 vnx4f __attribute__ ((vector_size (8))); |
| 11 |
|
| 12 |
#define MASK_4 1, 3, 6, 7 |
| 13 |
#define MASK_8 2, 3, 5, 6, 11, 12, 13, 14 |
| 14 |
|
| 15 |
vnx8i __attribute__ ((noinline, noclone)) |
| 16 |
test_1 (vnx8i x, vnx8i y) |
| 17 |
{ |
| 18 |
return __builtin_shufflevector (x, y, MASK_8); |
| 19 |
} |
| 20 |
|
| 21 |
vnx4i __attribute__ ((noinline, noclone)) |
| 22 |
test_2 (vnx4i x, vnx4i y) |
| 23 |
{ |
| 24 |
return __builtin_shufflevector (x, y, MASK_4); |
| 25 |
} |
| 26 |
|
| 27 |
vnx8ui __attribute__ ((noinline, noclone)) |
| 28 |
test_3 (vnx8ui x, vnx8ui y) |
| 29 |
{ |
| 30 |
return __builtin_shufflevector (x, y, MASK_8); |
| 31 |
} |
| 32 |
|
| 33 |
vnx4ui __attribute__ ((noinline, noclone)) |
| 34 |
test_4 (vnx4ui x, vnx4ui y) |
| 35 |
{ |
| 36 |
return __builtin_shufflevector (x, y, MASK_4); |
| 37 |
} |
| 38 |
|
| 39 |
vnx4f __attribute__ ((noinline, noclone)) |
| 40 |
test_5 (vnx4f x, vnx4f y) |
| 41 |
{ |
| 42 |
return __builtin_shufflevector (x, y, MASK_4); |
| 43 |
} |
| 44 |
|
| 45 |
/* { dg-final { scan-assembler-times {\tvcompress\.vm} 5 } } */ |
| 46 |
/* { dg-final { scan-assembler-times {\tvslideup} 2 } } */ |