Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/autovec/vls-vlmax/compress-4.c

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