Debian Codegraph @

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

raw
1 /* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */
2
3 #include "test_sve_acle.h"
4
5 /*
6 ** cnth_1:
7 ** cnth x0
8 ** ret
9 */
10 PROTO (cnth_1, uint64_t, ()) { return svcnth (); }
11
12 /*
13 ** cnth_2:
14 ** cntb x0
15 ** ret
16 */
17 PROTO (cnth_2, uint64_t, ()) { return svcnth () * 2; }
18
19 /*
20 ** cnth_3:
21 ** cnth x0, all, mul #3
22 ** ret
23 */
24 PROTO (cnth_3, uint64_t, ()) { return svcnth () * 3; }
25
26 /*
27 ** cnth_4:
28 ** cntb x0, all, mul #2
29 ** ret
30 */
31 PROTO (cnth_4, uint64_t, ()) { return svcnth () * 4; }
32
33 /*
34 ** cnth_8:
35 ** cntb x0, all, mul #4
36 ** ret
37 */
38 PROTO (cnth_8, uint64_t, ()) { return svcnth () * 8; }
39
40 /*
41 ** cnth_15:
42 ** cnth x0, all, mul #15
43 ** ret
44 */
45 PROTO (cnth_15, uint64_t, ()) { return svcnth () * 15; }
46
47 /*
48 ** cnth_16:
49 ** cntb x0, all, mul #8
50 ** ret
51 */
52 PROTO (cnth_16, uint64_t, ()) { return svcnth () * 16; }
53
54 /* Other sequences would be OK. */
55 /*
56 ** cnth_17:
57 ** rdvl (x[0-9]+), #17
58 ** asr x0, \1, 1
59 ** ret
60 */
61 PROTO (cnth_17, uint64_t, ()) { return svcnth () * 17; }
62
63 /*
64 ** cnth_32:
65 ** cntb x0, all, mul #16
66 ** ret
67 */
68 PROTO (cnth_32, uint64_t, ()) { return svcnth () * 32; }
69
70 /*
71 ** cnth_64:
72 ** cntb (x[0-9]+)
73 ** lsl x0, \1, 5
74 ** ret
75 */
76 PROTO (cnth_64, uint64_t, ()) { return svcnth () * 64; }
77
78 /*
79 ** cnth_128:
80 ** cntb (x[0-9]+)
81 ** lsl x0, \1, 6
82 ** ret
83 */
84 PROTO (cnth_128, uint64_t, ()) { return svcnth () * 128; }
85
86 /*
87 ** cnth_m1:
88 ** cnth (x[0-9]+)
89 ** neg x0, \1
90 ** ret
91 */
92 PROTO (cnth_m1, uint64_t, ()) { return -svcnth (); }
93
94 /*
95 ** cnth_m13:
96 ** cnth (x[0-9]+), all, mul #13
97 ** neg x0, \1
98 ** ret
99 */
100 PROTO (cnth_m13, uint64_t, ()) { return -svcnth () * 13; }
101
102 /*
103 ** cnth_m15:
104 ** cnth (x[0-9]+), all, mul #15
105 ** neg x0, \1
106 ** ret
107 */
108 PROTO (cnth_m15, uint64_t, ()) { return -svcnth () * 15; }
109
110 /*
111 ** cnth_m16:
112 ** rdvl x0, #-8
113 ** ret
114 */
115 PROTO (cnth_m16, uint64_t, ()) { return -svcnth () * 16; }
116
117 /* Other sequences would be OK. */
118 /*
119 ** cnth_m17:
120 ** rdvl (x[0-9]+), #-17
121 ** asr x0, \1, 1
122 ** ret
123 */
124 PROTO (cnth_m17, uint64_t, ()) { return -svcnth () * 17; }
125
126 /*
127 ** inch_1:
128 ** inch x0
129 ** ret
130 */
131 PROTO (inch_1, uint64_t, (uint64_t x0)) { return x0 + svcnth (); }
132
133 /*
134 ** inch_2:
135 ** incb x0
136 ** ret
137 */
138 PROTO (inch_2, uint64_t, (uint64_t x0)) { return x0 + svcnth () * 2; }
139
140 /*
141 ** inch_3:
142 ** inch x0, all, mul #3
143 ** ret
144 */
145 PROTO (inch_3, uint64_t, (uint64_t x0)) { return x0 + svcnth () * 3; }
146
147 /*
148 ** inch_4:
149 ** incb x0, all, mul #2
150 ** ret
151 */
152 PROTO (inch_4, uint64_t, (uint64_t x0)) { return x0 + svcnth () * 4; }
153
154 /*
155 ** inch_7:
156 ** inch x0, all, mul #7
157 ** ret
158 */
159 PROTO (inch_7, uint64_t, (uint64_t x0)) { return x0 + svcnth () * 7; }
160
161 /*
162 ** inch_8:
163 ** incb x0, all, mul #4
164 ** ret
165 */
166 PROTO (inch_8, uint64_t, (uint64_t x0)) { return x0 + svcnth () * 8; }
167
168 /*
169 ** inch_9:
170 ** inch x0, all, mul #9
171 ** ret
172 */
173 PROTO (inch_9, uint64_t, (uint64_t x0)) { return x0 + svcnth () * 9; }
174
175 /*
176 ** inch_15:
177 ** inch x0, all, mul #15
178 ** ret
179 */
180 PROTO (inch_15, uint64_t, (uint64_t x0)) { return x0 + svcnth () * 15; }
181
182 /*
183 ** inch_16:
184 ** incb x0, all, mul #8
185 ** ret
186 */
187 PROTO (inch_16, uint64_t, (uint64_t x0)) { return x0 + svcnth () * 16; }
188
189 /*
190 ** inch_18:
191 ** incb x0, all, mul #9
192 ** ret
193 */
194 PROTO (inch_18, uint64_t, (uint64_t x0)) { return x0 + svcnth () * 18; }
195
196 /*
197 ** inch_30:
198 ** incb x0, all, mul #15
199 ** ret
200 */
201 PROTO (inch_30, uint64_t, (uint64_t x0)) { return x0 + svcnth () * 30; }
202
203 /*
204 ** dech_1:
205 ** dech x0
206 ** ret
207 */
208 PROTO (dech_1, uint64_t, (uint64_t x0)) { return x0 - svcnth (); }
209
210 /*
211 ** dech_2:
212 ** decb x0
213 ** ret
214 */
215 PROTO (dech_2, uint64_t, (uint64_t x0)) { return x0 - svcnth () * 2; }
216
217 /*
218 ** dech_3:
219 ** dech x0, all, mul #3
220 ** ret
221 */
222 PROTO (dech_3, uint64_t, (uint64_t x0)) { return x0 - svcnth () * 3; }
223
224 /*
225 ** dech_4:
226 ** decb x0, all, mul #2
227 ** ret
228 */
229 PROTO (dech_4, uint64_t, (uint64_t x0)) { return x0 - svcnth () * 4; }
230
231 /*
232 ** dech_7:
233 ** dech x0, all, mul #7
234 ** ret
235 */
236 PROTO (dech_7, uint64_t, (uint64_t x0)) { return x0 - svcnth () * 7; }
237
238 /*
239 ** dech_8:
240 ** decb x0, all, mul #4
241 ** ret
242 */
243 PROTO (dech_8, uint64_t, (uint64_t x0)) { return x0 - svcnth () * 8; }
244
245 /*
246 ** dech_9:
247 ** dech x0, all, mul #9
248 ** ret
249 */
250 PROTO (dech_9, uint64_t, (uint64_t x0)) { return x0 - svcnth () * 9; }
251
252 /*
253 ** dech_15:
254 ** dech x0, all, mul #15
255 ** ret
256 */
257 PROTO (dech_15, uint64_t, (uint64_t x0)) { return x0 - svcnth () * 15; }
258
259 /*
260 ** dech_16:
261 ** decb x0, all, mul #8
262 ** ret
263 */
264 PROTO (dech_16, uint64_t, (uint64_t x0)) { return x0 - svcnth () * 16; }
265
266 /*
267 ** dech_18:
268 ** decb x0, all, mul #9
269 ** ret
270 */
271 PROTO (dech_18, uint64_t, (uint64_t x0)) { return x0 - svcnth () * 18; }
272
273 /*
274 ** dech_30:
275 ** decb x0, all, mul #15
276 ** ret
277 */
278 PROTO (dech_30, uint64_t, (uint64_t x0)) { return x0 - svcnth () * 30; }