Debian Codegraph @

gcc/testsuite/gcc.target/aarch64/sve2/uzpq_1.c

raw
1 /* { dg-options "-O2 -msve-vector-bits=256" } */
2 /* { dg-final { check-function-bodies "**" "" "" } } */
3
4 #include <arm_sve.h>
5
6 #pragma GCC target "+sve2p1"
7
8 typedef svuint8_t fixed_uint8_t __attribute__((arm_sve_vector_bits(256)));
9 typedef svbfloat16_t fixed_bfloat16_t __attribute__((arm_sve_vector_bits(256)));
10 typedef svfloat32_t fixed_float32_t __attribute__((arm_sve_vector_bits(256)));
11 typedef svint64_t fixed_int64_t __attribute__((arm_sve_vector_bits(256)));
12
13 /*
14 ** f1:
15 ** trn1 z0\.d, z0\.d, z1\.d
16 ** ret
17 */
18 [[gnu::noipa]] fixed_int64_t
19 f1 (fixed_int64_t z0, fixed_int64_t z1)
20 {
21 return __builtin_shufflevector (z0, z1, 0, 4, 2, 6);
22 }
23
24 /*
25 ** f2:
26 ** trn2 z0\.d, z0\.d, z1\.d
27 ** ret
28 */
29 [[gnu::noipa]] fixed_int64_t
30 f2 (fixed_int64_t z0, fixed_int64_t z1)
31 {
32 return __builtin_shufflevector (z0, z1, 1, 5, 3, 7);
33 }
34
35 /*
36 ** f3:
37 ** uzpq1 z0\.s, z0\.s, z1\.s
38 ** ret
39 */
40 [[gnu::noipa]] fixed_float32_t
41 f3 (fixed_float32_t z0, fixed_float32_t z1)
42 {
43 return __builtin_shufflevector (z0, z1, 0, 2, 8, 10, 4, 6, 12, 14);
44 }
45
46 /*
47 ** f4:
48 ** uzpq2 z0\.s, z0\.s, z1\.s
49 ** ret
50 */
51 [[gnu::noipa]] fixed_float32_t
52 f4 (fixed_float32_t z0, fixed_float32_t z1)
53 {
54 return __builtin_shufflevector (z0, z1, 1, 3, 9, 11, 5, 7, 13, 15);
55 }
56
57 /*
58 ** f5:
59 ** uzpq1 z0\.h, z0\.h, z1\.h
60 ** ret
61 */
62 [[gnu::noipa]] fixed_bfloat16_t
63 f5 (fixed_bfloat16_t z0, fixed_bfloat16_t z1)
64 {
65 return __builtin_shufflevector (z0, z1,
66 0, 2, 4, 6, 16, 18, 20, 22,
67 8, 10, 12, 14, 24, 26, 28, 30);
68 }
69
70 /*
71 ** f6:
72 ** uzpq2 z0\.h, z0\.h, z1\.h
73 ** ret
74 */
75 [[gnu::noipa]] fixed_bfloat16_t
76 f6 (fixed_bfloat16_t z0, fixed_bfloat16_t z1)
77 {
78 return __builtin_shufflevector (z0, z1,
79 1, 3, 5, 7, 17, 19, 21, 23,
80 9, 11, 13, 15, 25, 27, 29, 31);
81 }
82
83 /*
84 ** f7:
85 ** uzpq1 z0\.b, z0\.b, z1\.b
86 ** ret
87 */
88 [[gnu::noipa]] fixed_uint8_t
89 f7 (fixed_uint8_t z0, fixed_uint8_t z1)
90 {
91 return __builtin_shufflevector (z0, z1,
92 0, 2, 4, 6, 8, 10, 12, 14,
93 32, 34, 36, 38, 40, 42, 44, 46,
94 16, 18, 20, 22, 24, 26, 28, 30,
95 48, 50, 52, 54, 56, 58, 60, 62);
96 }
97
98 /*
99 ** f8:
100 ** uzpq2 z0\.b, z0\.b, z1\.b
101 ** ret
102 */
103 [[gnu::noipa]] fixed_uint8_t
104 f8 (fixed_uint8_t z0, fixed_uint8_t z1)
105 {
106 return __builtin_shufflevector (z0, z1,
107 1, 3, 5, 7, 9, 11, 13, 15,
108 33, 35, 37, 39, 41, 43, 45, 47,
109 17, 19, 21, 23, 25, 27, 29, 31,
110 49, 51, 53, 55, 57, 59, 61, 63);
111 }