Debian Codegraph @

gcc/testsuite/gcc.target/aarch64/sve/acle/asm/cntd.c

raw
1 /* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */
2
3 #include "test_sve_acle.h"
4
5 /*
6 ** cntd_1:
7 ** cntd x0
8 ** ret
9 */
10 PROTO (cntd_1, uint64_t, ()) { return svcntd (); }
11
12 /*
13 ** cntd_2:
14 ** cntw x0
15 ** ret
16 */
17 PROTO (cntd_2, uint64_t, ()) { return svcntd () * 2; }
18
19 /*
20 ** cntd_3:
21 ** cntd x0, all, mul #3
22 ** ret
23 */
24 PROTO (cntd_3, uint64_t, ()) { return svcntd () * 3; }
25
26 /*
27 ** cntd_4:
28 ** cnth x0
29 ** ret
30 */
31 PROTO (cntd_4, uint64_t, ()) { return svcntd () * 4; }
32
33 /*
34 ** cntd_8:
35 ** cntb x0
36 ** ret
37 */
38 PROTO (cntd_8, uint64_t, ()) { return svcntd () * 8; }
39
40 /*
41 ** cntd_15:
42 ** cntd x0, all, mul #15
43 ** ret
44 */
45 PROTO (cntd_15, uint64_t, ()) { return svcntd () * 15; }
46
47 /*
48 ** cntd_16:
49 ** cntb x0, all, mul #2
50 ** ret
51 */
52 PROTO (cntd_16, uint64_t, ()) { return svcntd () * 16; }
53
54 /* Other sequences would be OK. */
55 /*
56 ** cntd_17:
57 ** rdvl (x[0-9]+), #17
58 ** asr x0, \1, 3
59 ** ret
60 */
61 PROTO (cntd_17, uint64_t, ()) { return svcntd () * 17; }
62
63 /*
64 ** cntd_32:
65 ** cntb x0, all, mul #4
66 ** ret
67 */
68 PROTO (cntd_32, uint64_t, ()) { return svcntd () * 32; }
69
70 /*
71 ** cntd_64:
72 ** cntb x0, all, mul #8
73 ** ret
74 */
75 PROTO (cntd_64, uint64_t, ()) { return svcntd () * 64; }
76
77 /*
78 ** cntd_128:
79 ** cntb x0, all, mul #16
80 ** ret
81 */
82 PROTO (cntd_128, uint64_t, ()) { return svcntd () * 128; }
83
84 /*
85 ** cntd_m1:
86 ** cntd (x[0-9]+)
87 ** neg x0, \1
88 ** ret
89 */
90 PROTO (cntd_m1, uint64_t, ()) { return -svcntd (); }
91
92 /*
93 ** cntd_m13:
94 ** cntd (x[0-9]+), all, mul #13
95 ** neg x0, \1
96 ** ret
97 */
98 PROTO (cntd_m13, uint64_t, ()) { return -svcntd () * 13; }
99
100 /*
101 ** cntd_m15:
102 ** cntd (x[0-9]+), all, mul #15
103 ** neg x0, \1
104 ** ret
105 */
106 PROTO (cntd_m15, uint64_t, ()) { return -svcntd () * 15; }
107
108 /*
109 ** cntd_m16:
110 ** rdvl x0, #-2
111 ** ret
112 */
113 PROTO (cntd_m16, uint64_t, ()) { return -svcntd () * 16; }
114
115 /* Other sequences would be OK. */
116 /*
117 ** cntd_m17:
118 ** rdvl (x[0-9]+), #-17
119 ** asr x0, \1, 3
120 ** ret
121 */
122 PROTO (cntd_m17, uint64_t, ()) { return -svcntd () * 17; }
123
124 /*
125 ** incd_1:
126 ** incd x0
127 ** ret
128 */
129 PROTO (incd_1, uint64_t, (uint64_t x0)) { return x0 + svcntd (); }
130
131 /*
132 ** incd_2:
133 ** incw x0
134 ** ret
135 */
136 PROTO (incd_2, uint64_t, (uint64_t x0)) { return x0 + svcntd () * 2; }
137
138 /*
139 ** incd_3:
140 ** incd x0, all, mul #3
141 ** ret
142 */
143 PROTO (incd_3, uint64_t, (uint64_t x0)) { return x0 + svcntd () * 3; }
144
145 /*
146 ** incd_4:
147 ** inch x0
148 ** ret
149 */
150 PROTO (incd_4, uint64_t, (uint64_t x0)) { return x0 + svcntd () * 4; }
151
152 /*
153 ** incd_7:
154 ** incd x0, all, mul #7
155 ** ret
156 */
157 PROTO (incd_7, uint64_t, (uint64_t x0)) { return x0 + svcntd () * 7; }
158
159 /*
160 ** incd_8:
161 ** incb x0
162 ** ret
163 */
164 PROTO (incd_8, uint64_t, (uint64_t x0)) { return x0 + svcntd () * 8; }
165
166 /*
167 ** incd_9:
168 ** incd x0, all, mul #9
169 ** ret
170 */
171 PROTO (incd_9, uint64_t, (uint64_t x0)) { return x0 + svcntd () * 9; }
172
173 /*
174 ** incd_15:
175 ** incd x0, all, mul #15
176 ** ret
177 */
178 PROTO (incd_15, uint64_t, (uint64_t x0)) { return x0 + svcntd () * 15; }
179
180 /*
181 ** incd_16:
182 ** incb x0, all, mul #2
183 ** ret
184 */
185 PROTO (incd_16, uint64_t, (uint64_t x0)) { return x0 + svcntd () * 16; }
186
187 /*
188 ** incd_18:
189 ** incw x0, all, mul #9
190 ** ret
191 */
192 PROTO (incd_18, uint64_t, (uint64_t x0)) { return x0 + svcntd () * 18; }
193
194 /*
195 ** incd_30:
196 ** incw x0, all, mul #15
197 ** ret
198 */
199 PROTO (incd_30, uint64_t, (uint64_t x0)) { return x0 + svcntd () * 30; }
200
201 /*
202 ** decd_1:
203 ** decd x0
204 ** ret
205 */
206 PROTO (decd_1, uint64_t, (uint64_t x0)) { return x0 - svcntd (); }
207
208 /*
209 ** decd_2:
210 ** decw x0
211 ** ret
212 */
213 PROTO (decd_2, uint64_t, (uint64_t x0)) { return x0 - svcntd () * 2; }
214
215 /*
216 ** decd_3:
217 ** decd x0, all, mul #3
218 ** ret
219 */
220 PROTO (decd_3, uint64_t, (uint64_t x0)) { return x0 - svcntd () * 3; }
221
222 /*
223 ** decd_4:
224 ** dech x0
225 ** ret
226 */
227 PROTO (decd_4, uint64_t, (uint64_t x0)) { return x0 - svcntd () * 4; }
228
229 /*
230 ** decd_7:
231 ** decd x0, all, mul #7
232 ** ret
233 */
234 PROTO (decd_7, uint64_t, (uint64_t x0)) { return x0 - svcntd () * 7; }
235
236 /*
237 ** decd_8:
238 ** decb x0
239 ** ret
240 */
241 PROTO (decd_8, uint64_t, (uint64_t x0)) { return x0 - svcntd () * 8; }
242
243 /*
244 ** decd_9:
245 ** decd x0, all, mul #9
246 ** ret
247 */
248 PROTO (decd_9, uint64_t, (uint64_t x0)) { return x0 - svcntd () * 9; }
249
250 /*
251 ** decd_15:
252 ** decd x0, all, mul #15
253 ** ret
254 */
255 PROTO (decd_15, uint64_t, (uint64_t x0)) { return x0 - svcntd () * 15; }
256
257 /*
258 ** decd_16:
259 ** decb x0, all, mul #2
260 ** ret
261 */
262 PROTO (decd_16, uint64_t, (uint64_t x0)) { return x0 - svcntd () * 16; }
263
264 /*
265 ** decd_18:
266 ** decw x0, all, mul #9
267 ** ret
268 */
269 PROTO (decd_18, uint64_t, (uint64_t x0)) { return x0 - svcntd () * 18; }
270
271 /*
272 ** decd_30:
273 ** decw x0, all, mul #15
274 ** ret
275 */
276 PROTO (decd_30, uint64_t, (uint64_t x0)) { return x0 - svcntd () * 30; }