| 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 vnx16i __attribute__ ((vector_size (16))); |
| 7 |
typedef int16_t vnx8i __attribute__ ((vector_size (16))); |
| 8 |
typedef int32_t vnx4i __attribute__ ((vector_size (16))); |
| 9 |
typedef uint8_t vnx16ui __attribute__ ((vector_size (16))); |
| 10 |
typedef uint16_t vnx8ui __attribute__ ((vector_size (16))); |
| 11 |
typedef uint32_t vnx4ui __attribute__ ((vector_size (16))); |
| 12 |
typedef _Float16 vnx8f __attribute__ ((vector_size (16))); |
| 13 |
typedef float vnx4f __attribute__ ((vector_size (16))); |
| 14 |
|
| 15 |
#define MASK_4 0, 2, 5, 6 |
| 16 |
#define MASK_8 0, 1, 2, 5, 10, 11, 12, 13 |
| 17 |
#define MASK_16 1, 3, 4, 6, 7, 8, 14, 15, 20, 21, 22, 23, 24, 25, 26, 27 |
| 18 |
|
| 19 |
vnx16i __attribute__ ((noinline, noclone)) test_1 (vnx16i x, vnx16i y) |
| 20 |
{ |
| 21 |
return __builtin_shufflevector (x, y, MASK_16); |
| 22 |
} |
| 23 |
|
| 24 |
vnx8i __attribute__ ((noinline, noclone)) test_2 (vnx8i x, vnx8i y) |
| 25 |
{ |
| 26 |
return __builtin_shufflevector (x, y, MASK_8); |
| 27 |
} |
| 28 |
|
| 29 |
vnx4i __attribute__ ((noinline, noclone)) test_3 (vnx4i x, vnx4i y) |
| 30 |
{ |
| 31 |
return __builtin_shufflevector (x, y, MASK_4); |
| 32 |
} |
| 33 |
|
| 34 |
vnx16ui __attribute__ ((noinline, noclone)) test_4 (vnx16ui x, vnx16ui y) |
| 35 |
{ |
| 36 |
return __builtin_shufflevector (x, y, MASK_16); |
| 37 |
} |
| 38 |
|
| 39 |
vnx8ui __attribute__ ((noinline, noclone)) test_5 (vnx8ui x, vnx8ui y) |
| 40 |
{ |
| 41 |
return __builtin_shufflevector (x, y, MASK_8); |
| 42 |
} |
| 43 |
|
| 44 |
vnx4ui __attribute__ ((noinline, noclone)) test_6 (vnx4ui x, vnx4ui y) |
| 45 |
{ |
| 46 |
return __builtin_shufflevector (x, y, MASK_4); |
| 47 |
} |
| 48 |
|
| 49 |
vnx8f __attribute__ ((noinline, noclone)) test_7 (vnx8f x, vnx8f y) |
| 50 |
{ |
| 51 |
return __builtin_shufflevector (x, y, MASK_8); |
| 52 |
} |
| 53 |
|
| 54 |
vnx4f __attribute__ ((noinline, noclone)) test_8 (vnx4f x, vnx4f y) |
| 55 |
{ |
| 56 |
return __builtin_shufflevector (x, y, MASK_4); |
| 57 |
} |
| 58 |
|
| 59 |
/* { dg-final { scan-assembler-times {\tvcompress.vm} 8 } } */ |
| 60 |
/* { dg-final { scan-assembler-times {\tvslideup} 8 } } */ |