| 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 vnx128i __attribute__ ((vector_size (128))); |
| 7 |
typedef int16_t vnx64i __attribute__ ((vector_size (128))); |
| 8 |
typedef int32_t vnx32i __attribute__ ((vector_size (128))); |
| 9 |
typedef int64_t vnx16i __attribute__ ((vector_size (128))); |
| 10 |
typedef uint8_t vnx128ui __attribute__ ((vector_size (128))); |
| 11 |
typedef uint16_t vnx64ui __attribute__ ((vector_size (128))); |
| 12 |
typedef uint32_t vnx32ui __attribute__ ((vector_size (128))); |
| 13 |
typedef uint64_t vnx16ui __attribute__ ((vector_size (128))); |
| 14 |
typedef _Float16 vnx64f __attribute__ ((vector_size (128))); |
| 15 |
typedef float vnx32f __attribute__ ((vector_size (128))); |
| 16 |
typedef double vnx16f __attribute__ ((vector_size (128))); |
| 17 |
|
| 18 |
#define MASK_4 0, 3, 6, 7 |
| 19 |
#define MASK_8 0, 2, 3, 4, 10, 11, 12, 13 |
| 20 |
#define MASK_16 2, 3, 4, 6, 7, 8, 9, 12, 20, 21, 22, 23, 24, 25, 26, 27 |
| 21 |
#define MASK_32 \ |
| 22 |
0, 1, 3, 4, 7, 8, 12, 13, 14, 19, 21, 22, 23, 27, 29, 31, 41, 42, 43, 44, \ |
| 23 |
45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56 |
| 24 |
#define MASK_64 \ |
| 25 |
0, 2, 3, 4, 5, 7, 11, 13, 14, 16, 17, 19, 20, 22, 23, 24, 27, 28, 30, 31, \ |
| 26 |
35, 37, 39, 40, 44, 45, 46, 53, 54, 56, 61, 63, 68, 69, 70, 71, 72, 73, \ |
| 27 |
74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, \ |
| 28 |
92, 93, 94, 95, 96, 97, 98, 99 |
| 29 |
|
| 30 |
#define MASK_128 \ |
| 31 |
1, 3, 4, 5, 6, 7, 8, 10, 12, 14, 15, 16, 17, 18, 22, 25, 28, 29, 30, 31, 36, \ |
| 32 |
37, 40, 41, 42, 43, 44, 46, 52, 54, 55, 58, 61, 62, 64, 67, 68, 69, 70, \ |
| 33 |
71, 76, 77, 78, 80, 82, 83, 84, 86, 87, 88, 91, 94, 95, 99, 102, 104, 106, \ |
| 34 |
110, 112, 115, 116, 125, 126, 127, 144, 145, 146, 147, 148, 149, 150, 151, \ |
| 35 |
152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, \ |
| 36 |
167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, \ |
| 37 |
182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, \ |
| 38 |
197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207 |
| 39 |
|
| 40 |
vnx128i __attribute__ ((noinline, noclone)) test_1 (vnx128i x, vnx128i y) |
| 41 |
{ |
| 42 |
return __builtin_shufflevector (x, y, MASK_128); |
| 43 |
} |
| 44 |
|
| 45 |
vnx64i __attribute__ ((noinline, noclone)) test_2 (vnx64i x, vnx64i y) |
| 46 |
{ |
| 47 |
return __builtin_shufflevector (x, y, MASK_64); |
| 48 |
} |
| 49 |
|
| 50 |
vnx32i __attribute__ ((noinline, noclone)) test_3 (vnx32i x, vnx32i y) |
| 51 |
{ |
| 52 |
return __builtin_shufflevector (x, y, MASK_32); |
| 53 |
} |
| 54 |
|
| 55 |
vnx16i __attribute__ ((noinline, noclone)) test_4 (vnx16i x, vnx16i y) |
| 56 |
{ |
| 57 |
return __builtin_shufflevector (x, y, MASK_16); |
| 58 |
} |
| 59 |
|
| 60 |
vnx128ui __attribute__ ((noinline, noclone)) test_5 (vnx128ui x, vnx128ui y) |
| 61 |
{ |
| 62 |
return __builtin_shufflevector (x, y, MASK_128); |
| 63 |
} |
| 64 |
|
| 65 |
vnx64ui __attribute__ ((noinline, noclone)) test_6 (vnx64ui x, vnx64ui y) |
| 66 |
{ |
| 67 |
return __builtin_shufflevector (x, y, MASK_64); |
| 68 |
} |
| 69 |
|
| 70 |
vnx32ui __attribute__ ((noinline, noclone)) test_7 (vnx32ui x, vnx32ui y) |
| 71 |
{ |
| 72 |
return __builtin_shufflevector (x, y, MASK_32); |
| 73 |
} |
| 74 |
|
| 75 |
vnx16ui __attribute__ ((noinline, noclone)) test_8 (vnx16ui x, vnx16ui y) |
| 76 |
{ |
| 77 |
return __builtin_shufflevector (x, y, MASK_16); |
| 78 |
} |
| 79 |
|
| 80 |
vnx64f __attribute__ ((noinline, noclone)) test_9 (vnx64f x, vnx64f y) |
| 81 |
{ |
| 82 |
return __builtin_shufflevector (x, y, MASK_64); |
| 83 |
} |
| 84 |
|
| 85 |
vnx32f __attribute__ ((noinline, noclone)) test_10 (vnx32f x, vnx32f y) |
| 86 |
{ |
| 87 |
return __builtin_shufflevector (x, y, MASK_32); |
| 88 |
} |
| 89 |
|
| 90 |
vnx16f __attribute__ ((noinline, noclone)) test_11 (vnx16f x, vnx16f y) |
| 91 |
{ |
| 92 |
return __builtin_shufflevector (x, y, MASK_16); |
| 93 |
} |
| 94 |
|
| 95 |
/* { dg-final { scan-assembler-times {\tvcompress.vm} 11 } } */ |