Debian Codegraph @

gcc/testsuite/gcc.target/aarch64/sve2/dupq_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 svint8_t fixed_uint8_t __attribute__((arm_sve_vector_bits(256)));
9 typedef svuint16_t fixed_uint16_t __attribute__((arm_sve_vector_bits(256)));
10 typedef svint32_t fixed_int32_t __attribute__((arm_sve_vector_bits(256)));
11 typedef svuint64_t fixed_uint64_t __attribute__((arm_sve_vector_bits(256)));
12
13 /*
14 ** f1:
15 ** trn1 z0\.d, z0\.d, z0\.d
16 ** ret
17 */
18 [[gnu::noipa]] fixed_uint64_t
19 f1 (fixed_uint64_t z0)
20 {
21 return __builtin_shufflevector (z0, z0, 0, 0, 2, 2);
22 }
23
24 /*
25 ** f2:
26 ** trn2 z0\.d, z0\.d, z0\.d
27 ** ret
28 */
29 [[gnu::noipa]] fixed_uint64_t
30 f2 (fixed_uint64_t z0)
31 {
32 return __builtin_shufflevector (z0, z0, 1, 1, 3, 3);
33 }
34
35 /*
36 ** f3:
37 ** dupq z0\.s, z0\.s\[0\]
38 ** ret
39 */
40 [[gnu::noipa]] fixed_int32_t
41 f3 (fixed_int32_t z0)
42 {
43 return __builtin_shufflevector (z0, z0, 0, 0, 0, 0, 4, 4, 4, 4);
44 }
45
46 /*
47 ** f4:
48 ** dupq z0\.s, z0\.s\[1\]
49 ** ret
50 */
51 [[gnu::noipa]] fixed_int32_t
52 f4 (fixed_int32_t z0)
53 {
54 return __builtin_shufflevector (z0, z0, 1, 1, 1, 1, 5, 5, 5, 5);
55 }
56
57 /*
58 ** f5:
59 ** dupq z0\.s, z0\.s\[2\]
60 ** ret
61 */
62 [[gnu::noipa]] fixed_int32_t
63 f5 (fixed_int32_t z0)
64 {
65 return __builtin_shufflevector (z0, z0, 2, 2, 2, 2, 6, 6, 6, 6);
66 }
67
68 /*
69 ** f6:
70 ** dupq z0\.s, z0\.s\[3\]
71 ** ret
72 */
73 [[gnu::noipa]] fixed_int32_t
74 f6 (fixed_int32_t z0)
75 {
76 return __builtin_shufflevector (z0, z0, 3, 3, 3, 3, 7, 7, 7, 7);
77 }
78
79 /*
80 ** f7:
81 ** dupq z0\.h, z0\.h\[0\]
82 ** ret
83 */
84 [[gnu::noipa]] fixed_uint16_t
85 f7 (fixed_uint16_t z0)
86 {
87 return __builtin_shufflevector (z0, z0,
88 0, 0, 0, 0, 0, 0, 0, 0,
89 8, 8, 8, 8, 8, 8, 8, 8);
90 }
91
92
93 /*
94 ** f8:
95 ** dupq z0\.h, z0\.h\[5\]
96 ** ret
97 */
98 [[gnu::noipa]] fixed_uint16_t
99 f8 (fixed_uint16_t z0)
100 {
101 return __builtin_shufflevector (z0, z0,
102 5, 5, 5, 5, 5, 5, 5, 5,
103 13, 13, 13, 13, 13, 13, 13, 13);
104 }
105
106 /*
107 ** f9:
108 ** dupq z0\.h, z0\.h\[7\]
109 ** ret
110 */
111 [[gnu::noipa]] fixed_uint16_t
112 f9 (fixed_uint16_t z0)
113 {
114 return __builtin_shufflevector (z0, z0,
115 7, 7, 7, 7, 7, 7, 7, 7,
116 15, 15, 15, 15, 15, 15, 15, 15);
117 }
118
119 /*
120 ** f10:
121 ** dupq z0\.b, z0\.b\[0\]
122 ** ret
123 */
124 [[gnu::noipa]] fixed_uint8_t
125 f10 (fixed_uint8_t z0)
126 {
127 return __builtin_shufflevector (z0, z0,
128 0, 0, 0, 0, 0, 0, 0, 0,
129 0, 0, 0, 0, 0, 0, 0, 0,
130 16, 16, 16, 16, 16, 16, 16, 16,
131 16, 16, 16, 16, 16, 16, 16, 16);
132 }
133
134 /*
135 ** f11:
136 ** dupq z0\.b, z0\.b\[13\]
137 ** ret
138 */
139 [[gnu::noipa]] fixed_uint8_t
140 f11 (fixed_uint8_t z0)
141 {
142 return __builtin_shufflevector (z0, z0,
143 13, 13, 13, 13, 13, 13, 13, 13,
144 13, 13, 13, 13, 13, 13, 13, 13,
145 29, 29, 29, 29, 29, 29, 29, 29,
146 29, 29, 29, 29, 29, 29, 29, 29);
147 }
148
149 /*
150 ** f12:
151 ** dupq z0\.b, z0\.b\[15\]
152 ** ret
153 */
154 [[gnu::noipa]] fixed_uint8_t
155 f12 (fixed_uint8_t z0)
156 {
157 return __builtin_shufflevector (z0, z0,
158 15, 15, 15, 15, 15, 15, 15, 15,
159 15, 15, 15, 15, 15, 15, 15, 15,
160 31, 31, 31, 31, 31, 31, 31, 31,
161 31, 31, 31, 31, 31, 31, 31, 31);
162 }