| 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 vnx64i __attribute__ ((vector_size (64))); |
| 7 |
typedef int16_t vnx32i __attribute__ ((vector_size (64))); |
| 8 |
typedef int32_t vnx16i __attribute__ ((vector_size (64))); |
| 9 |
typedef int64_t vnx8i __attribute__ ((vector_size (64))); |
| 10 |
typedef uint8_t vnx64ui __attribute__ ((vector_size (64))); |
| 11 |
typedef uint16_t vnx32ui __attribute__ ((vector_size (64))); |
| 12 |
typedef uint32_t vnx16ui __attribute__ ((vector_size (64))); |
| 13 |
typedef uint64_t vnx8ui __attribute__ ((vector_size (64))); |
| 14 |
typedef _Float16 vnx32f __attribute__ ((vector_size (64))); |
| 15 |
typedef float vnx16f __attribute__ ((vector_size (64))); |
| 16 |
typedef double vnx8f __attribute__ ((vector_size (64))); |
| 17 |
|
| 18 |
#define MASK_4 0, 2, 5, 6 |
| 19 |
#define MASK_8 0, 1, 5, 7, 11, 12, 13, 14 |
| 20 |
#define MASK_16 0, 2, 3, 8, 10, 11, 12, 14, 24, 25, 26, 27, 28, 29, 30, 31 |
| 21 |
#define MASK_32 \ |
| 22 |
4, 5, 6, 7, 9, 10, 12, 14, 18, 20, 22, 23, 25, 27, 28, 29, 35, 36, 37, 38, \ |
| 23 |
39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50 |
| 24 |
#define MASK_64 \ |
| 25 |
1, 2, 3, 5, 7, 9, 10, 11, 12, 14, 15, 17, 19, 21, 22, 23, 26, 28, 30, 31, \ |
| 26 |
37, 38, 41, 46, 47, 53, 54, 55, 60, 61, 62, 63, 76, 77, 78, 79, 80, 81, \ |
| 27 |
82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, \ |
| 28 |
100, 101, 102, 103, 104, 105, 106, 107 |
| 29 |
|
| 30 |
vnx64i __attribute__ ((noinline, noclone)) test_1 (vnx64i x, vnx64i y) |
| 31 |
{ |
| 32 |
return __builtin_shufflevector (x, y, MASK_64); |
| 33 |
} |
| 34 |
|
| 35 |
vnx32i __attribute__ ((noinline, noclone)) test_2 (vnx32i x, vnx32i y) |
| 36 |
{ |
| 37 |
return __builtin_shufflevector (x, y, MASK_32); |
| 38 |
} |
| 39 |
|
| 40 |
vnx16i __attribute__ ((noinline, noclone)) test_3 (vnx16i x, vnx16i y) |
| 41 |
{ |
| 42 |
return __builtin_shufflevector (x, y, MASK_16); |
| 43 |
} |
| 44 |
|
| 45 |
vnx8i __attribute__ ((noinline, noclone)) test_4 (vnx8i x, vnx8i y) |
| 46 |
{ |
| 47 |
return __builtin_shufflevector (x, y, MASK_8); |
| 48 |
} |
| 49 |
|
| 50 |
vnx64ui __attribute__ ((noinline, noclone)) test_5 (vnx64ui x, vnx64ui y) |
| 51 |
{ |
| 52 |
return __builtin_shufflevector (x, y, MASK_64); |
| 53 |
} |
| 54 |
|
| 55 |
vnx32ui __attribute__ ((noinline, noclone)) test_6 (vnx32ui x, vnx32ui y) |
| 56 |
{ |
| 57 |
return __builtin_shufflevector (x, y, MASK_32); |
| 58 |
} |
| 59 |
|
| 60 |
vnx16ui __attribute__ ((noinline, noclone)) test_7 (vnx16ui x, vnx16ui y) |
| 61 |
{ |
| 62 |
return __builtin_shufflevector (x, y, MASK_16); |
| 63 |
} |
| 64 |
|
| 65 |
vnx8ui __attribute__ ((noinline, noclone)) test_8 (vnx8ui x, vnx8ui y) |
| 66 |
{ |
| 67 |
return __builtin_shufflevector (x, y, MASK_8); |
| 68 |
} |
| 69 |
|
| 70 |
vnx32f __attribute__ ((noinline, noclone)) test_9 (vnx32f x, vnx32f y) |
| 71 |
{ |
| 72 |
return __builtin_shufflevector (x, y, MASK_32); |
| 73 |
} |
| 74 |
|
| 75 |
vnx16f __attribute__ ((noinline, noclone)) test_10 (vnx16f x, vnx16f y) |
| 76 |
{ |
| 77 |
return __builtin_shufflevector (x, y, MASK_16); |
| 78 |
} |
| 79 |
|
| 80 |
vnx8f __attribute__ ((noinline, noclone)) test_11 (vnx8f x, vnx8f y) |
| 81 |
{ |
| 82 |
return __builtin_shufflevector (x, y, MASK_8); |
| 83 |
} |
| 84 |
|
| 85 |
/* { dg-final { scan-assembler-times {\tvcompress.vm} 11 } } */ |