| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-march=rv64gcv_zvfhmin -mabi=lp64d -O3 -mrvv-vector-bits=zvl" } */ |
| 3 |
|
| 4 |
#include <stdint-gcc.h> |
| 5 |
|
| 6 |
typedef int8_t vnx4qi __attribute__((vector_size (4))); |
| 7 |
typedef int16_t vnx2hi __attribute__((vector_size (4))); |
| 8 |
typedef uint8_t vnx4uqi __attribute__((vector_size (4))); |
| 9 |
typedef uint16_t vnx2uhi __attribute__((vector_size (4))); |
| 10 |
|
| 11 |
typedef _Float16 vnx2hf __attribute__((vector_size (4))); |
| 12 |
|
| 13 |
#define MASK_4 0, 5, 2, 7 |
| 14 |
#define MASK_2 0, 3 |
| 15 |
|
| 16 |
void __attribute__ ((noipa)) |
| 17 |
merge0 (vnx4qi x, vnx4qi y, vnx4qi *out) |
| 18 |
{ |
| 19 |
vnx4qi v = __builtin_shufflevector ((vnx4qi) x, (vnx4qi) y, MASK_4); |
| 20 |
*(vnx4qi*)out = v; |
| 21 |
} |
| 22 |
|
| 23 |
void __attribute__ ((noipa)) |
| 24 |
merge1 (vnx4uqi x, vnx4uqi y, vnx4uqi *out) |
| 25 |
{ |
| 26 |
vnx4uqi v = __builtin_shufflevector ((vnx4uqi) x, (vnx4uqi) y, MASK_4); |
| 27 |
*(vnx4uqi*)out = v; |
| 28 |
} |
| 29 |
|
| 30 |
void __attribute__ ((noipa)) |
| 31 |
merge2 (vnx2hi x, vnx2hi y, vnx2hi *out) |
| 32 |
{ |
| 33 |
vnx2hi v = __builtin_shufflevector ((vnx2hi) x, (vnx2hi) y, MASK_2); |
| 34 |
*(vnx2hi*)out = v; |
| 35 |
} |
| 36 |
|
| 37 |
void __attribute__ ((noipa)) |
| 38 |
merge3 (vnx2uhi x, vnx2uhi y, vnx2uhi *out) |
| 39 |
{ |
| 40 |
vnx2uhi v = __builtin_shufflevector ((vnx2uhi) x, (vnx2uhi) y, MASK_2); |
| 41 |
*(vnx2uhi*)out = v; |
| 42 |
} |
| 43 |
|
| 44 |
void __attribute__ ((noipa)) |
| 45 |
merge6 (vnx2hf x, vnx2hf y, vnx2hf *out) |
| 46 |
{ |
| 47 |
vnx2hf v = __builtin_shufflevector ((vnx2hf) x, (vnx2hf) y, MASK_2); |
| 48 |
*(vnx2hf*)out = v; |
| 49 |
} |
| 50 |
|
| 51 |
/* { dg-final { scan-assembler-times {\tvmerge.vvm} 5 } } */ |