1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mattr=+sve -force-streaming-compatible < %s | FileCheck %s
3 ; RUN: llc -mattr=+sme -force-streaming < %s | FileCheck %s
4 ; RUN: llc -force-streaming-compatible < %s | FileCheck %s --check-prefix=NONEON-NOSVE
7 target triple = "aarch64-unknown-linux-gnu"
13 define <4 x i8> @bitreverse_v4i8(<4 x i8> %op) {
14 ; CHECK-LABEL: bitreverse_v4i8:
16 ; CHECK-NEXT: ptrue p0.h, vl4
17 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
18 ; CHECK-NEXT: rbit z0.h, p0/m, z0.h
19 ; CHECK-NEXT: lsr z0.h, z0.h, #8
20 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
23 ; NONEON-NOSVE-LABEL: bitreverse_v4i8:
24 ; NONEON-NOSVE: // %bb.0:
25 ; NONEON-NOSVE-NEXT: str d0, [sp, #-16]!
26 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
27 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #6]
28 ; NONEON-NOSVE-NEXT: rbit w8, w8
29 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
30 ; NONEON-NOSVE-NEXT: strh w8, [sp, #14]
31 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #4]
32 ; NONEON-NOSVE-NEXT: rbit w8, w8
33 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
34 ; NONEON-NOSVE-NEXT: strh w8, [sp, #12]
35 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #2]
36 ; NONEON-NOSVE-NEXT: rbit w8, w8
37 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
38 ; NONEON-NOSVE-NEXT: strh w8, [sp, #10]
39 ; NONEON-NOSVE-NEXT: ldrh w8, [sp]
40 ; NONEON-NOSVE-NEXT: rbit w8, w8
41 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
42 ; NONEON-NOSVE-NEXT: strh w8, [sp, #8]
43 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #8]
44 ; NONEON-NOSVE-NEXT: add sp, sp, #16
45 ; NONEON-NOSVE-NEXT: ret
46 %res = call <4 x i8> @llvm.bitreverse.v4i8(<4 x i8> %op)
50 define <8 x i8> @bitreverse_v8i8(<8 x i8> %op) {
51 ; CHECK-LABEL: bitreverse_v8i8:
53 ; CHECK-NEXT: ptrue p0.b, vl8
54 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
55 ; CHECK-NEXT: rbit z0.b, p0/m, z0.b
56 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
59 ; NONEON-NOSVE-LABEL: bitreverse_v8i8:
60 ; NONEON-NOSVE: // %bb.0:
61 ; NONEON-NOSVE-NEXT: str d0, [sp, #-16]!
62 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
63 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #7]
64 ; NONEON-NOSVE-NEXT: rbit w8, w8
65 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
66 ; NONEON-NOSVE-NEXT: strb w8, [sp, #15]
67 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #6]
68 ; NONEON-NOSVE-NEXT: rbit w8, w8
69 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
70 ; NONEON-NOSVE-NEXT: strb w8, [sp, #14]
71 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #5]
72 ; NONEON-NOSVE-NEXT: rbit w8, w8
73 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
74 ; NONEON-NOSVE-NEXT: strb w8, [sp, #13]
75 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #4]
76 ; NONEON-NOSVE-NEXT: rbit w8, w8
77 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
78 ; NONEON-NOSVE-NEXT: strb w8, [sp, #12]
79 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #3]
80 ; NONEON-NOSVE-NEXT: rbit w8, w8
81 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
82 ; NONEON-NOSVE-NEXT: strb w8, [sp, #11]
83 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #2]
84 ; NONEON-NOSVE-NEXT: rbit w8, w8
85 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
86 ; NONEON-NOSVE-NEXT: strb w8, [sp, #10]
87 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #1]
88 ; NONEON-NOSVE-NEXT: rbit w8, w8
89 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
90 ; NONEON-NOSVE-NEXT: strb w8, [sp, #9]
91 ; NONEON-NOSVE-NEXT: ldrb w8, [sp]
92 ; NONEON-NOSVE-NEXT: rbit w8, w8
93 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
94 ; NONEON-NOSVE-NEXT: strb w8, [sp, #8]
95 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #8]
96 ; NONEON-NOSVE-NEXT: add sp, sp, #16
97 ; NONEON-NOSVE-NEXT: ret
98 %res = call <8 x i8> @llvm.bitreverse.v8i8(<8 x i8> %op)
102 define <16 x i8> @bitreverse_v16i8(<16 x i8> %op) {
103 ; CHECK-LABEL: bitreverse_v16i8:
105 ; CHECK-NEXT: ptrue p0.b, vl16
106 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
107 ; CHECK-NEXT: rbit z0.b, p0/m, z0.b
108 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
111 ; NONEON-NOSVE-LABEL: bitreverse_v16i8:
112 ; NONEON-NOSVE: // %bb.0:
113 ; NONEON-NOSVE-NEXT: str q0, [sp, #-32]!
114 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 32
115 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #15]
116 ; NONEON-NOSVE-NEXT: rbit w8, w8
117 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
118 ; NONEON-NOSVE-NEXT: strb w8, [sp, #31]
119 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #14]
120 ; NONEON-NOSVE-NEXT: rbit w8, w8
121 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
122 ; NONEON-NOSVE-NEXT: strb w8, [sp, #30]
123 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #13]
124 ; NONEON-NOSVE-NEXT: rbit w8, w8
125 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
126 ; NONEON-NOSVE-NEXT: strb w8, [sp, #29]
127 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #12]
128 ; NONEON-NOSVE-NEXT: rbit w8, w8
129 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
130 ; NONEON-NOSVE-NEXT: strb w8, [sp, #28]
131 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #11]
132 ; NONEON-NOSVE-NEXT: rbit w8, w8
133 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
134 ; NONEON-NOSVE-NEXT: strb w8, [sp, #27]
135 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #10]
136 ; NONEON-NOSVE-NEXT: rbit w8, w8
137 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
138 ; NONEON-NOSVE-NEXT: strb w8, [sp, #26]
139 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #9]
140 ; NONEON-NOSVE-NEXT: rbit w8, w8
141 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
142 ; NONEON-NOSVE-NEXT: strb w8, [sp, #25]
143 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #8]
144 ; NONEON-NOSVE-NEXT: rbit w8, w8
145 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
146 ; NONEON-NOSVE-NEXT: strb w8, [sp, #24]
147 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #7]
148 ; NONEON-NOSVE-NEXT: rbit w8, w8
149 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
150 ; NONEON-NOSVE-NEXT: strb w8, [sp, #23]
151 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #6]
152 ; NONEON-NOSVE-NEXT: rbit w8, w8
153 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
154 ; NONEON-NOSVE-NEXT: strb w8, [sp, #22]
155 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #5]
156 ; NONEON-NOSVE-NEXT: rbit w8, w8
157 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
158 ; NONEON-NOSVE-NEXT: strb w8, [sp, #21]
159 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #4]
160 ; NONEON-NOSVE-NEXT: rbit w8, w8
161 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
162 ; NONEON-NOSVE-NEXT: strb w8, [sp, #20]
163 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #3]
164 ; NONEON-NOSVE-NEXT: rbit w8, w8
165 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
166 ; NONEON-NOSVE-NEXT: strb w8, [sp, #19]
167 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #2]
168 ; NONEON-NOSVE-NEXT: rbit w8, w8
169 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
170 ; NONEON-NOSVE-NEXT: strb w8, [sp, #18]
171 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #1]
172 ; NONEON-NOSVE-NEXT: rbit w8, w8
173 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
174 ; NONEON-NOSVE-NEXT: strb w8, [sp, #17]
175 ; NONEON-NOSVE-NEXT: ldrb w8, [sp]
176 ; NONEON-NOSVE-NEXT: rbit w8, w8
177 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
178 ; NONEON-NOSVE-NEXT: strb w8, [sp, #16]
179 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #16]
180 ; NONEON-NOSVE-NEXT: add sp, sp, #32
181 ; NONEON-NOSVE-NEXT: ret
182 %res = call <16 x i8> @llvm.bitreverse.v16i8(<16 x i8> %op)
186 define void @bitreverse_v32i8(ptr %a) {
187 ; CHECK-LABEL: bitreverse_v32i8:
189 ; CHECK-NEXT: ldp q0, q1, [x0]
190 ; CHECK-NEXT: ptrue p0.b, vl16
191 ; CHECK-NEXT: rbit z0.b, p0/m, z0.b
192 ; CHECK-NEXT: rbit z1.b, p0/m, z1.b
193 ; CHECK-NEXT: stp q0, q1, [x0]
196 ; NONEON-NOSVE-LABEL: bitreverse_v32i8:
197 ; NONEON-NOSVE: // %bb.0:
198 ; NONEON-NOSVE-NEXT: ldp q1, q0, [x0]
199 ; NONEON-NOSVE-NEXT: stp q1, q0, [sp, #-64]!
200 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 64
201 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #31]
202 ; NONEON-NOSVE-NEXT: rbit w8, w8
203 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
204 ; NONEON-NOSVE-NEXT: strb w8, [sp, #63]
205 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #30]
206 ; NONEON-NOSVE-NEXT: rbit w8, w8
207 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
208 ; NONEON-NOSVE-NEXT: strb w8, [sp, #62]
209 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #29]
210 ; NONEON-NOSVE-NEXT: rbit w8, w8
211 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
212 ; NONEON-NOSVE-NEXT: strb w8, [sp, #61]
213 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #28]
214 ; NONEON-NOSVE-NEXT: rbit w8, w8
215 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
216 ; NONEON-NOSVE-NEXT: strb w8, [sp, #60]
217 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #27]
218 ; NONEON-NOSVE-NEXT: rbit w8, w8
219 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
220 ; NONEON-NOSVE-NEXT: strb w8, [sp, #59]
221 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #26]
222 ; NONEON-NOSVE-NEXT: rbit w8, w8
223 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
224 ; NONEON-NOSVE-NEXT: strb w8, [sp, #58]
225 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #25]
226 ; NONEON-NOSVE-NEXT: rbit w8, w8
227 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
228 ; NONEON-NOSVE-NEXT: strb w8, [sp, #57]
229 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #24]
230 ; NONEON-NOSVE-NEXT: rbit w8, w8
231 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
232 ; NONEON-NOSVE-NEXT: strb w8, [sp, #56]
233 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #23]
234 ; NONEON-NOSVE-NEXT: rbit w8, w8
235 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
236 ; NONEON-NOSVE-NEXT: strb w8, [sp, #55]
237 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #22]
238 ; NONEON-NOSVE-NEXT: rbit w8, w8
239 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
240 ; NONEON-NOSVE-NEXT: strb w8, [sp, #54]
241 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #21]
242 ; NONEON-NOSVE-NEXT: rbit w8, w8
243 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
244 ; NONEON-NOSVE-NEXT: strb w8, [sp, #53]
245 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #20]
246 ; NONEON-NOSVE-NEXT: rbit w8, w8
247 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
248 ; NONEON-NOSVE-NEXT: strb w8, [sp, #52]
249 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #19]
250 ; NONEON-NOSVE-NEXT: rbit w8, w8
251 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
252 ; NONEON-NOSVE-NEXT: strb w8, [sp, #51]
253 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #18]
254 ; NONEON-NOSVE-NEXT: rbit w8, w8
255 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
256 ; NONEON-NOSVE-NEXT: strb w8, [sp, #50]
257 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #17]
258 ; NONEON-NOSVE-NEXT: rbit w8, w8
259 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
260 ; NONEON-NOSVE-NEXT: strb w8, [sp, #49]
261 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #16]
262 ; NONEON-NOSVE-NEXT: rbit w8, w8
263 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
264 ; NONEON-NOSVE-NEXT: strb w8, [sp, #48]
265 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #15]
266 ; NONEON-NOSVE-NEXT: rbit w8, w8
267 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
268 ; NONEON-NOSVE-NEXT: strb w8, [sp, #47]
269 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #14]
270 ; NONEON-NOSVE-NEXT: rbit w8, w8
271 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
272 ; NONEON-NOSVE-NEXT: strb w8, [sp, #46]
273 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #13]
274 ; NONEON-NOSVE-NEXT: rbit w8, w8
275 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
276 ; NONEON-NOSVE-NEXT: strb w8, [sp, #45]
277 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #12]
278 ; NONEON-NOSVE-NEXT: rbit w8, w8
279 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
280 ; NONEON-NOSVE-NEXT: strb w8, [sp, #44]
281 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #11]
282 ; NONEON-NOSVE-NEXT: rbit w8, w8
283 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
284 ; NONEON-NOSVE-NEXT: strb w8, [sp, #43]
285 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #10]
286 ; NONEON-NOSVE-NEXT: rbit w8, w8
287 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
288 ; NONEON-NOSVE-NEXT: strb w8, [sp, #42]
289 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #9]
290 ; NONEON-NOSVE-NEXT: rbit w8, w8
291 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
292 ; NONEON-NOSVE-NEXT: strb w8, [sp, #41]
293 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #8]
294 ; NONEON-NOSVE-NEXT: rbit w8, w8
295 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
296 ; NONEON-NOSVE-NEXT: strb w8, [sp, #40]
297 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #7]
298 ; NONEON-NOSVE-NEXT: rbit w8, w8
299 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
300 ; NONEON-NOSVE-NEXT: strb w8, [sp, #39]
301 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #6]
302 ; NONEON-NOSVE-NEXT: rbit w8, w8
303 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
304 ; NONEON-NOSVE-NEXT: strb w8, [sp, #38]
305 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #5]
306 ; NONEON-NOSVE-NEXT: rbit w8, w8
307 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
308 ; NONEON-NOSVE-NEXT: strb w8, [sp, #37]
309 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #4]
310 ; NONEON-NOSVE-NEXT: rbit w8, w8
311 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
312 ; NONEON-NOSVE-NEXT: strb w8, [sp, #36]
313 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #3]
314 ; NONEON-NOSVE-NEXT: rbit w8, w8
315 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
316 ; NONEON-NOSVE-NEXT: strb w8, [sp, #35]
317 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #2]
318 ; NONEON-NOSVE-NEXT: rbit w8, w8
319 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
320 ; NONEON-NOSVE-NEXT: strb w8, [sp, #34]
321 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #1]
322 ; NONEON-NOSVE-NEXT: rbit w8, w8
323 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
324 ; NONEON-NOSVE-NEXT: strb w8, [sp, #33]
325 ; NONEON-NOSVE-NEXT: ldrb w8, [sp]
326 ; NONEON-NOSVE-NEXT: rbit w8, w8
327 ; NONEON-NOSVE-NEXT: lsr w8, w8, #24
328 ; NONEON-NOSVE-NEXT: strb w8, [sp, #32]
329 ; NONEON-NOSVE-NEXT: ldp q0, q1, [sp, #32]
330 ; NONEON-NOSVE-NEXT: stp q0, q1, [x0]
331 ; NONEON-NOSVE-NEXT: add sp, sp, #64
332 ; NONEON-NOSVE-NEXT: ret
333 %op = load <32 x i8>, ptr %a
334 %res = call <32 x i8> @llvm.bitreverse.v32i8(<32 x i8> %op)
335 store <32 x i8> %res, ptr %a
339 define <2 x i16> @bitreverse_v2i16(<2 x i16> %op) {
340 ; CHECK-LABEL: bitreverse_v2i16:
342 ; CHECK-NEXT: ptrue p0.s, vl2
343 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
344 ; CHECK-NEXT: rbit z0.s, p0/m, z0.s
345 ; CHECK-NEXT: lsr z0.s, z0.s, #16
346 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
349 ; NONEON-NOSVE-LABEL: bitreverse_v2i16:
350 ; NONEON-NOSVE: // %bb.0:
351 ; NONEON-NOSVE-NEXT: str d0, [sp, #-16]!
352 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
353 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #4]
354 ; NONEON-NOSVE-NEXT: rbit w8, w8
355 ; NONEON-NOSVE-NEXT: lsr w9, w8, #16
356 ; NONEON-NOSVE-NEXT: ldr w8, [sp]
357 ; NONEON-NOSVE-NEXT: rbit w8, w8
358 ; NONEON-NOSVE-NEXT: lsr w8, w8, #16
359 ; NONEON-NOSVE-NEXT: stp w8, w9, [sp, #8]
360 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #8]
361 ; NONEON-NOSVE-NEXT: add sp, sp, #16
362 ; NONEON-NOSVE-NEXT: ret
363 %res = call <2 x i16> @llvm.bitreverse.v2i16(<2 x i16> %op)
367 define <4 x i16> @bitreverse_v4i16(<4 x i16> %op) {
368 ; CHECK-LABEL: bitreverse_v4i16:
370 ; CHECK-NEXT: ptrue p0.h, vl4
371 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
372 ; CHECK-NEXT: rbit z0.h, p0/m, z0.h
373 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
376 ; NONEON-NOSVE-LABEL: bitreverse_v4i16:
377 ; NONEON-NOSVE: // %bb.0:
378 ; NONEON-NOSVE-NEXT: str d0, [sp, #-16]!
379 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
380 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #6]
381 ; NONEON-NOSVE-NEXT: rbit w8, w8
382 ; NONEON-NOSVE-NEXT: lsr w8, w8, #16
383 ; NONEON-NOSVE-NEXT: strh w8, [sp, #14]
384 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #4]
385 ; NONEON-NOSVE-NEXT: rbit w8, w8
386 ; NONEON-NOSVE-NEXT: lsr w8, w8, #16
387 ; NONEON-NOSVE-NEXT: strh w8, [sp, #12]
388 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #2]
389 ; NONEON-NOSVE-NEXT: rbit w8, w8
390 ; NONEON-NOSVE-NEXT: lsr w8, w8, #16
391 ; NONEON-NOSVE-NEXT: strh w8, [sp, #10]
392 ; NONEON-NOSVE-NEXT: ldrh w8, [sp]
393 ; NONEON-NOSVE-NEXT: rbit w8, w8
394 ; NONEON-NOSVE-NEXT: lsr w8, w8, #16
395 ; NONEON-NOSVE-NEXT: strh w8, [sp, #8]
396 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #8]
397 ; NONEON-NOSVE-NEXT: add sp, sp, #16
398 ; NONEON-NOSVE-NEXT: ret
399 %res = call <4 x i16> @llvm.bitreverse.v4i16(<4 x i16> %op)
403 define <8 x i16> @bitreverse_v8i16(<8 x i16> %op) {
404 ; CHECK-LABEL: bitreverse_v8i16:
406 ; CHECK-NEXT: ptrue p0.h, vl8
407 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
408 ; CHECK-NEXT: rbit z0.h, p0/m, z0.h
409 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
412 ; NONEON-NOSVE-LABEL: bitreverse_v8i16:
413 ; NONEON-NOSVE: // %bb.0:
414 ; NONEON-NOSVE-NEXT: str q0, [sp, #-32]!
415 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 32
416 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #14]
417 ; NONEON-NOSVE-NEXT: rbit w8, w8
418 ; NONEON-NOSVE-NEXT: lsr w8, w8, #16
419 ; NONEON-NOSVE-NEXT: strh w8, [sp, #30]
420 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #12]
421 ; NONEON-NOSVE-NEXT: rbit w8, w8
422 ; NONEON-NOSVE-NEXT: lsr w8, w8, #16
423 ; NONEON-NOSVE-NEXT: strh w8, [sp, #28]
424 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #10]
425 ; NONEON-NOSVE-NEXT: rbit w8, w8
426 ; NONEON-NOSVE-NEXT: lsr w8, w8, #16
427 ; NONEON-NOSVE-NEXT: strh w8, [sp, #26]
428 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #8]
429 ; NONEON-NOSVE-NEXT: rbit w8, w8
430 ; NONEON-NOSVE-NEXT: lsr w8, w8, #16
431 ; NONEON-NOSVE-NEXT: strh w8, [sp, #24]
432 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #6]
433 ; NONEON-NOSVE-NEXT: rbit w8, w8
434 ; NONEON-NOSVE-NEXT: lsr w8, w8, #16
435 ; NONEON-NOSVE-NEXT: strh w8, [sp, #22]
436 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #4]
437 ; NONEON-NOSVE-NEXT: rbit w8, w8
438 ; NONEON-NOSVE-NEXT: lsr w8, w8, #16
439 ; NONEON-NOSVE-NEXT: strh w8, [sp, #20]
440 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #2]
441 ; NONEON-NOSVE-NEXT: rbit w8, w8
442 ; NONEON-NOSVE-NEXT: lsr w8, w8, #16
443 ; NONEON-NOSVE-NEXT: strh w8, [sp, #18]
444 ; NONEON-NOSVE-NEXT: ldrh w8, [sp]
445 ; NONEON-NOSVE-NEXT: rbit w8, w8
446 ; NONEON-NOSVE-NEXT: lsr w8, w8, #16
447 ; NONEON-NOSVE-NEXT: strh w8, [sp, #16]
448 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #16]
449 ; NONEON-NOSVE-NEXT: add sp, sp, #32
450 ; NONEON-NOSVE-NEXT: ret
451 %res = call <8 x i16> @llvm.bitreverse.v8i16(<8 x i16> %op)
455 define void @bitreverse_v16i16(ptr %a) {
456 ; CHECK-LABEL: bitreverse_v16i16:
458 ; CHECK-NEXT: ldp q0, q1, [x0]
459 ; CHECK-NEXT: ptrue p0.h, vl8
460 ; CHECK-NEXT: rbit z0.h, p0/m, z0.h
461 ; CHECK-NEXT: rbit z1.h, p0/m, z1.h
462 ; CHECK-NEXT: stp q0, q1, [x0]
465 ; NONEON-NOSVE-LABEL: bitreverse_v16i16:
466 ; NONEON-NOSVE: // %bb.0:
467 ; NONEON-NOSVE-NEXT: ldp q1, q0, [x0]
468 ; NONEON-NOSVE-NEXT: stp q1, q0, [sp, #-64]!
469 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 64
470 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #30]
471 ; NONEON-NOSVE-NEXT: rbit w8, w8
472 ; NONEON-NOSVE-NEXT: lsr w8, w8, #16
473 ; NONEON-NOSVE-NEXT: strh w8, [sp, #62]
474 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #28]
475 ; NONEON-NOSVE-NEXT: rbit w8, w8
476 ; NONEON-NOSVE-NEXT: lsr w8, w8, #16
477 ; NONEON-NOSVE-NEXT: strh w8, [sp, #60]
478 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #26]
479 ; NONEON-NOSVE-NEXT: rbit w8, w8
480 ; NONEON-NOSVE-NEXT: lsr w8, w8, #16
481 ; NONEON-NOSVE-NEXT: strh w8, [sp, #58]
482 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #24]
483 ; NONEON-NOSVE-NEXT: rbit w8, w8
484 ; NONEON-NOSVE-NEXT: lsr w8, w8, #16
485 ; NONEON-NOSVE-NEXT: strh w8, [sp, #56]
486 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #22]
487 ; NONEON-NOSVE-NEXT: rbit w8, w8
488 ; NONEON-NOSVE-NEXT: lsr w8, w8, #16
489 ; NONEON-NOSVE-NEXT: strh w8, [sp, #54]
490 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #20]
491 ; NONEON-NOSVE-NEXT: rbit w8, w8
492 ; NONEON-NOSVE-NEXT: lsr w8, w8, #16
493 ; NONEON-NOSVE-NEXT: strh w8, [sp, #52]
494 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #18]
495 ; NONEON-NOSVE-NEXT: rbit w8, w8
496 ; NONEON-NOSVE-NEXT: lsr w8, w8, #16
497 ; NONEON-NOSVE-NEXT: strh w8, [sp, #50]
498 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #16]
499 ; NONEON-NOSVE-NEXT: rbit w8, w8
500 ; NONEON-NOSVE-NEXT: lsr w8, w8, #16
501 ; NONEON-NOSVE-NEXT: strh w8, [sp, #48]
502 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #14]
503 ; NONEON-NOSVE-NEXT: rbit w8, w8
504 ; NONEON-NOSVE-NEXT: lsr w8, w8, #16
505 ; NONEON-NOSVE-NEXT: strh w8, [sp, #46]
506 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #12]
507 ; NONEON-NOSVE-NEXT: rbit w8, w8
508 ; NONEON-NOSVE-NEXT: lsr w8, w8, #16
509 ; NONEON-NOSVE-NEXT: strh w8, [sp, #44]
510 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #10]
511 ; NONEON-NOSVE-NEXT: rbit w8, w8
512 ; NONEON-NOSVE-NEXT: lsr w8, w8, #16
513 ; NONEON-NOSVE-NEXT: strh w8, [sp, #42]
514 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #8]
515 ; NONEON-NOSVE-NEXT: rbit w8, w8
516 ; NONEON-NOSVE-NEXT: lsr w8, w8, #16
517 ; NONEON-NOSVE-NEXT: strh w8, [sp, #40]
518 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #6]
519 ; NONEON-NOSVE-NEXT: rbit w8, w8
520 ; NONEON-NOSVE-NEXT: lsr w8, w8, #16
521 ; NONEON-NOSVE-NEXT: strh w8, [sp, #38]
522 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #4]
523 ; NONEON-NOSVE-NEXT: rbit w8, w8
524 ; NONEON-NOSVE-NEXT: lsr w8, w8, #16
525 ; NONEON-NOSVE-NEXT: strh w8, [sp, #36]
526 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #2]
527 ; NONEON-NOSVE-NEXT: rbit w8, w8
528 ; NONEON-NOSVE-NEXT: lsr w8, w8, #16
529 ; NONEON-NOSVE-NEXT: strh w8, [sp, #34]
530 ; NONEON-NOSVE-NEXT: ldrh w8, [sp]
531 ; NONEON-NOSVE-NEXT: rbit w8, w8
532 ; NONEON-NOSVE-NEXT: lsr w8, w8, #16
533 ; NONEON-NOSVE-NEXT: strh w8, [sp, #32]
534 ; NONEON-NOSVE-NEXT: ldp q0, q1, [sp, #32]
535 ; NONEON-NOSVE-NEXT: stp q0, q1, [x0]
536 ; NONEON-NOSVE-NEXT: add sp, sp, #64
537 ; NONEON-NOSVE-NEXT: ret
538 %op = load <16 x i16>, ptr %a
539 %res = call <16 x i16> @llvm.bitreverse.v16i16(<16 x i16> %op)
540 store <16 x i16> %res, ptr %a
544 define <2 x i32> @bitreverse_v2i32(<2 x i32> %op) {
545 ; CHECK-LABEL: bitreverse_v2i32:
547 ; CHECK-NEXT: ptrue p0.s, vl2
548 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
549 ; CHECK-NEXT: rbit z0.s, p0/m, z0.s
550 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
553 ; NONEON-NOSVE-LABEL: bitreverse_v2i32:
554 ; NONEON-NOSVE: // %bb.0:
555 ; NONEON-NOSVE-NEXT: str d0, [sp, #-16]!
556 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
557 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #4]
558 ; NONEON-NOSVE-NEXT: rbit w9, w8
559 ; NONEON-NOSVE-NEXT: ldr w8, [sp]
560 ; NONEON-NOSVE-NEXT: rbit w8, w8
561 ; NONEON-NOSVE-NEXT: stp w8, w9, [sp, #8]
562 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #8]
563 ; NONEON-NOSVE-NEXT: add sp, sp, #16
564 ; NONEON-NOSVE-NEXT: ret
565 %res = call <2 x i32> @llvm.bitreverse.v2i32(<2 x i32> %op)
569 define <4 x i32> @bitreverse_v4i32(<4 x i32> %op) {
570 ; CHECK-LABEL: bitreverse_v4i32:
572 ; CHECK-NEXT: ptrue p0.s, vl4
573 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
574 ; CHECK-NEXT: rbit z0.s, p0/m, z0.s
575 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
578 ; NONEON-NOSVE-LABEL: bitreverse_v4i32:
579 ; NONEON-NOSVE: // %bb.0:
580 ; NONEON-NOSVE-NEXT: str q0, [sp, #-32]!
581 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 32
582 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #12]
583 ; NONEON-NOSVE-NEXT: rbit w9, w8
584 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #8]
585 ; NONEON-NOSVE-NEXT: rbit w8, w8
586 ; NONEON-NOSVE-NEXT: stp w8, w9, [sp, #24]
587 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #4]
588 ; NONEON-NOSVE-NEXT: rbit w9, w8
589 ; NONEON-NOSVE-NEXT: ldr w8, [sp]
590 ; NONEON-NOSVE-NEXT: rbit w8, w8
591 ; NONEON-NOSVE-NEXT: stp w8, w9, [sp, #16]
592 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #16]
593 ; NONEON-NOSVE-NEXT: add sp, sp, #32
594 ; NONEON-NOSVE-NEXT: ret
595 %res = call <4 x i32> @llvm.bitreverse.v4i32(<4 x i32> %op)
599 define void @bitreverse_v8i32(ptr %a) {
600 ; CHECK-LABEL: bitreverse_v8i32:
602 ; CHECK-NEXT: ldp q0, q1, [x0]
603 ; CHECK-NEXT: ptrue p0.s, vl4
604 ; CHECK-NEXT: rbit z0.s, p0/m, z0.s
605 ; CHECK-NEXT: rbit z1.s, p0/m, z1.s
606 ; CHECK-NEXT: stp q0, q1, [x0]
609 ; NONEON-NOSVE-LABEL: bitreverse_v8i32:
610 ; NONEON-NOSVE: // %bb.0:
611 ; NONEON-NOSVE-NEXT: ldp q1, q0, [x0]
612 ; NONEON-NOSVE-NEXT: stp q1, q0, [sp, #-64]!
613 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 64
614 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #28]
615 ; NONEON-NOSVE-NEXT: rbit w9, w8
616 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #24]
617 ; NONEON-NOSVE-NEXT: rbit w8, w8
618 ; NONEON-NOSVE-NEXT: stp w8, w9, [sp, #56]
619 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #20]
620 ; NONEON-NOSVE-NEXT: rbit w9, w8
621 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #16]
622 ; NONEON-NOSVE-NEXT: rbit w8, w8
623 ; NONEON-NOSVE-NEXT: stp w8, w9, [sp, #48]
624 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #12]
625 ; NONEON-NOSVE-NEXT: rbit w9, w8
626 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #8]
627 ; NONEON-NOSVE-NEXT: rbit w8, w8
628 ; NONEON-NOSVE-NEXT: stp w8, w9, [sp, #40]
629 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #4]
630 ; NONEON-NOSVE-NEXT: rbit w9, w8
631 ; NONEON-NOSVE-NEXT: ldr w8, [sp]
632 ; NONEON-NOSVE-NEXT: rbit w8, w8
633 ; NONEON-NOSVE-NEXT: stp w8, w9, [sp, #32]
634 ; NONEON-NOSVE-NEXT: ldp q0, q1, [sp, #32]
635 ; NONEON-NOSVE-NEXT: stp q0, q1, [x0]
636 ; NONEON-NOSVE-NEXT: add sp, sp, #64
637 ; NONEON-NOSVE-NEXT: ret
638 %op = load <8 x i32>, ptr %a
639 %res = call <8 x i32> @llvm.bitreverse.v8i32(<8 x i32> %op)
640 store <8 x i32> %res, ptr %a
644 define <1 x i64> @bitreverse_v1i64(<1 x i64> %op) {
645 ; CHECK-LABEL: bitreverse_v1i64:
647 ; CHECK-NEXT: ptrue p0.d, vl1
648 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
649 ; CHECK-NEXT: rbit z0.d, p0/m, z0.d
650 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
653 ; NONEON-NOSVE-LABEL: bitreverse_v1i64:
654 ; NONEON-NOSVE: // %bb.0:
655 ; NONEON-NOSVE-NEXT: sub sp, sp, #16
656 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
657 ; NONEON-NOSVE-NEXT: fmov x8, d0
658 ; NONEON-NOSVE-NEXT: rbit x8, x8
659 ; NONEON-NOSVE-NEXT: str x8, [sp, #8]
660 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #8]
661 ; NONEON-NOSVE-NEXT: add sp, sp, #16
662 ; NONEON-NOSVE-NEXT: ret
663 %res = call <1 x i64> @llvm.bitreverse.v1i64(<1 x i64> %op)
667 define <2 x i64> @bitreverse_v2i64(<2 x i64> %op) {
668 ; CHECK-LABEL: bitreverse_v2i64:
670 ; CHECK-NEXT: ptrue p0.d, vl2
671 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
672 ; CHECK-NEXT: rbit z0.d, p0/m, z0.d
673 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
676 ; NONEON-NOSVE-LABEL: bitreverse_v2i64:
677 ; NONEON-NOSVE: // %bb.0:
678 ; NONEON-NOSVE-NEXT: str q0, [sp, #-32]!
679 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 32
680 ; NONEON-NOSVE-NEXT: ldr x8, [sp, #8]
681 ; NONEON-NOSVE-NEXT: rbit x9, x8
682 ; NONEON-NOSVE-NEXT: ldr x8, [sp]
683 ; NONEON-NOSVE-NEXT: rbit x8, x8
684 ; NONEON-NOSVE-NEXT: stp x8, x9, [sp, #16]
685 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #16]
686 ; NONEON-NOSVE-NEXT: add sp, sp, #32
687 ; NONEON-NOSVE-NEXT: ret
688 %res = call <2 x i64> @llvm.bitreverse.v2i64(<2 x i64> %op)
692 define void @bitreverse_v4i64(ptr %a) {
693 ; CHECK-LABEL: bitreverse_v4i64:
695 ; CHECK-NEXT: ldp q0, q1, [x0]
696 ; CHECK-NEXT: ptrue p0.d, vl2
697 ; CHECK-NEXT: rbit z0.d, p0/m, z0.d
698 ; CHECK-NEXT: rbit z1.d, p0/m, z1.d
699 ; CHECK-NEXT: stp q0, q1, [x0]
702 ; NONEON-NOSVE-LABEL: bitreverse_v4i64:
703 ; NONEON-NOSVE: // %bb.0:
704 ; NONEON-NOSVE-NEXT: ldp q1, q0, [x0]
705 ; NONEON-NOSVE-NEXT: stp q1, q0, [sp, #-64]!
706 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 64
707 ; NONEON-NOSVE-NEXT: ldr x8, [sp, #24]
708 ; NONEON-NOSVE-NEXT: rbit x9, x8
709 ; NONEON-NOSVE-NEXT: ldr x8, [sp, #16]
710 ; NONEON-NOSVE-NEXT: rbit x8, x8
711 ; NONEON-NOSVE-NEXT: stp x8, x9, [sp, #48]
712 ; NONEON-NOSVE-NEXT: ldr x8, [sp, #8]
713 ; NONEON-NOSVE-NEXT: rbit x9, x8
714 ; NONEON-NOSVE-NEXT: ldr x8, [sp]
715 ; NONEON-NOSVE-NEXT: rbit x8, x8
716 ; NONEON-NOSVE-NEXT: stp x8, x9, [sp, #32]
717 ; NONEON-NOSVE-NEXT: ldp q0, q1, [sp, #32]
718 ; NONEON-NOSVE-NEXT: stp q0, q1, [x0]
719 ; NONEON-NOSVE-NEXT: add sp, sp, #64
720 ; NONEON-NOSVE-NEXT: ret
721 %op = load <4 x i64>, ptr %a
722 %res = call <4 x i64> @llvm.bitreverse.v4i64(<4 x i64> %op)
723 store <4 x i64> %res, ptr %a
731 define <2 x i16> @bswap_v2i16(<2 x i16> %op) {
732 ; CHECK-LABEL: bswap_v2i16:
734 ; CHECK-NEXT: ptrue p0.s, vl2
735 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
736 ; CHECK-NEXT: revb z0.s, p0/m, z0.s
737 ; CHECK-NEXT: lsr z0.s, z0.s, #16
738 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
741 ; NONEON-NOSVE-LABEL: bswap_v2i16:
742 ; NONEON-NOSVE: // %bb.0:
743 ; NONEON-NOSVE-NEXT: str d0, [sp, #-32]!
744 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 32
745 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #4]
746 ; NONEON-NOSVE-NEXT: strb w8, [sp, #15]
747 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #5]
748 ; NONEON-NOSVE-NEXT: strb w8, [sp, #14]
749 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #6]
750 ; NONEON-NOSVE-NEXT: strb w8, [sp, #13]
751 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #7]
752 ; NONEON-NOSVE-NEXT: strb w8, [sp, #12]
753 ; NONEON-NOSVE-NEXT: ldrb w8, [sp]
754 ; NONEON-NOSVE-NEXT: strb w8, [sp, #11]
755 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #1]
756 ; NONEON-NOSVE-NEXT: strb w8, [sp, #10]
757 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #2]
758 ; NONEON-NOSVE-NEXT: strb w8, [sp, #9]
759 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #3]
760 ; NONEON-NOSVE-NEXT: strb w8, [sp, #8]
761 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #8]
762 ; NONEON-NOSVE-NEXT: str d0, [sp, #16]
763 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #22]
764 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #18]
765 ; NONEON-NOSVE-NEXT: stp w8, w9, [sp, #24]
766 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #24]
767 ; NONEON-NOSVE-NEXT: add sp, sp, #32
768 ; NONEON-NOSVE-NEXT: ret
769 %res = call <2 x i16> @llvm.bswap.v2i16(<2 x i16> %op)
773 define <4 x i16> @bswap_v4i16(<4 x i16> %op) {
774 ; CHECK-LABEL: bswap_v4i16:
776 ; CHECK-NEXT: ptrue p0.h, vl4
777 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
778 ; CHECK-NEXT: revb z0.h, p0/m, z0.h
779 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
782 ; NONEON-NOSVE-LABEL: bswap_v4i16:
783 ; NONEON-NOSVE: // %bb.0:
784 ; NONEON-NOSVE-NEXT: str d0, [sp, #-16]!
785 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
786 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #6]
787 ; NONEON-NOSVE-NEXT: strb w8, [sp, #15]
788 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #7]
789 ; NONEON-NOSVE-NEXT: strb w8, [sp, #14]
790 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #4]
791 ; NONEON-NOSVE-NEXT: strb w8, [sp, #13]
792 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #5]
793 ; NONEON-NOSVE-NEXT: strb w8, [sp, #12]
794 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #2]
795 ; NONEON-NOSVE-NEXT: strb w8, [sp, #11]
796 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #3]
797 ; NONEON-NOSVE-NEXT: strb w8, [sp, #10]
798 ; NONEON-NOSVE-NEXT: ldrb w8, [sp]
799 ; NONEON-NOSVE-NEXT: strb w8, [sp, #9]
800 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #1]
801 ; NONEON-NOSVE-NEXT: strb w8, [sp, #8]
802 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #8]
803 ; NONEON-NOSVE-NEXT: add sp, sp, #16
804 ; NONEON-NOSVE-NEXT: ret
805 %res = call <4 x i16> @llvm.bswap.v4i16(<4 x i16> %op)
809 define <8 x i16> @bswap_v8i16(<8 x i16> %op) {
810 ; CHECK-LABEL: bswap_v8i16:
812 ; CHECK-NEXT: ptrue p0.h, vl8
813 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
814 ; CHECK-NEXT: revb z0.h, p0/m, z0.h
815 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
818 ; NONEON-NOSVE-LABEL: bswap_v8i16:
819 ; NONEON-NOSVE: // %bb.0:
820 ; NONEON-NOSVE-NEXT: str q0, [sp, #-32]!
821 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 32
822 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #14]
823 ; NONEON-NOSVE-NEXT: strb w8, [sp, #31]
824 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #15]
825 ; NONEON-NOSVE-NEXT: strb w8, [sp, #30]
826 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #12]
827 ; NONEON-NOSVE-NEXT: strb w8, [sp, #29]
828 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #13]
829 ; NONEON-NOSVE-NEXT: strb w8, [sp, #28]
830 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #10]
831 ; NONEON-NOSVE-NEXT: strb w8, [sp, #27]
832 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #11]
833 ; NONEON-NOSVE-NEXT: strb w8, [sp, #26]
834 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #8]
835 ; NONEON-NOSVE-NEXT: strb w8, [sp, #25]
836 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #9]
837 ; NONEON-NOSVE-NEXT: strb w8, [sp, #24]
838 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #6]
839 ; NONEON-NOSVE-NEXT: strb w8, [sp, #23]
840 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #7]
841 ; NONEON-NOSVE-NEXT: strb w8, [sp, #22]
842 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #4]
843 ; NONEON-NOSVE-NEXT: strb w8, [sp, #21]
844 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #5]
845 ; NONEON-NOSVE-NEXT: strb w8, [sp, #20]
846 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #2]
847 ; NONEON-NOSVE-NEXT: strb w8, [sp, #19]
848 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #3]
849 ; NONEON-NOSVE-NEXT: strb w8, [sp, #18]
850 ; NONEON-NOSVE-NEXT: ldrb w8, [sp]
851 ; NONEON-NOSVE-NEXT: strb w8, [sp, #17]
852 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #1]
853 ; NONEON-NOSVE-NEXT: strb w8, [sp, #16]
854 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #16]
855 ; NONEON-NOSVE-NEXT: add sp, sp, #32
856 ; NONEON-NOSVE-NEXT: ret
857 %res = call <8 x i16> @llvm.bswap.v8i16(<8 x i16> %op)
861 define void @bswap_v16i16(ptr %a) {
862 ; CHECK-LABEL: bswap_v16i16:
864 ; CHECK-NEXT: ldp q0, q1, [x0]
865 ; CHECK-NEXT: ptrue p0.h, vl8
866 ; CHECK-NEXT: revb z0.h, p0/m, z0.h
867 ; CHECK-NEXT: revb z1.h, p0/m, z1.h
868 ; CHECK-NEXT: stp q0, q1, [x0]
871 ; NONEON-NOSVE-LABEL: bswap_v16i16:
872 ; NONEON-NOSVE: // %bb.0:
873 ; NONEON-NOSVE-NEXT: ldr q0, [x0, #16]
874 ; NONEON-NOSVE-NEXT: str q0, [sp, #-64]!
875 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 64
876 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #14]
877 ; NONEON-NOSVE-NEXT: ldr q0, [x0]
878 ; NONEON-NOSVE-NEXT: strb w8, [sp, #31]
879 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #15]
880 ; NONEON-NOSVE-NEXT: str q0, [sp, #32]
881 ; NONEON-NOSVE-NEXT: strb w8, [sp, #30]
882 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #12]
883 ; NONEON-NOSVE-NEXT: strb w8, [sp, #29]
884 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #13]
885 ; NONEON-NOSVE-NEXT: strb w8, [sp, #28]
886 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #10]
887 ; NONEON-NOSVE-NEXT: strb w8, [sp, #27]
888 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #11]
889 ; NONEON-NOSVE-NEXT: strb w8, [sp, #26]
890 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #8]
891 ; NONEON-NOSVE-NEXT: strb w8, [sp, #25]
892 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #9]
893 ; NONEON-NOSVE-NEXT: strb w8, [sp, #24]
894 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #6]
895 ; NONEON-NOSVE-NEXT: strb w8, [sp, #23]
896 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #7]
897 ; NONEON-NOSVE-NEXT: strb w8, [sp, #22]
898 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #4]
899 ; NONEON-NOSVE-NEXT: strb w8, [sp, #21]
900 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #5]
901 ; NONEON-NOSVE-NEXT: strb w8, [sp, #20]
902 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #2]
903 ; NONEON-NOSVE-NEXT: strb w8, [sp, #19]
904 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #3]
905 ; NONEON-NOSVE-NEXT: strb w8, [sp, #18]
906 ; NONEON-NOSVE-NEXT: ldrb w8, [sp]
907 ; NONEON-NOSVE-NEXT: strb w8, [sp, #17]
908 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #1]
909 ; NONEON-NOSVE-NEXT: strb w8, [sp, #16]
910 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #46]
911 ; NONEON-NOSVE-NEXT: ldr q1, [sp, #16]
912 ; NONEON-NOSVE-NEXT: strb w8, [sp, #63]
913 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #47]
914 ; NONEON-NOSVE-NEXT: strb w8, [sp, #62]
915 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #44]
916 ; NONEON-NOSVE-NEXT: strb w8, [sp, #61]
917 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #45]
918 ; NONEON-NOSVE-NEXT: strb w8, [sp, #60]
919 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #42]
920 ; NONEON-NOSVE-NEXT: strb w8, [sp, #59]
921 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #43]
922 ; NONEON-NOSVE-NEXT: strb w8, [sp, #58]
923 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #40]
924 ; NONEON-NOSVE-NEXT: strb w8, [sp, #57]
925 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #41]
926 ; NONEON-NOSVE-NEXT: strb w8, [sp, #56]
927 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #38]
928 ; NONEON-NOSVE-NEXT: strb w8, [sp, #55]
929 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #39]
930 ; NONEON-NOSVE-NEXT: strb w8, [sp, #54]
931 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #36]
932 ; NONEON-NOSVE-NEXT: strb w8, [sp, #53]
933 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #37]
934 ; NONEON-NOSVE-NEXT: strb w8, [sp, #52]
935 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #34]
936 ; NONEON-NOSVE-NEXT: strb w8, [sp, #51]
937 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #35]
938 ; NONEON-NOSVE-NEXT: strb w8, [sp, #50]
939 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #32]
940 ; NONEON-NOSVE-NEXT: strb w8, [sp, #49]
941 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #33]
942 ; NONEON-NOSVE-NEXT: strb w8, [sp, #48]
943 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #48]
944 ; NONEON-NOSVE-NEXT: stp q0, q1, [x0]
945 ; NONEON-NOSVE-NEXT: add sp, sp, #64
946 ; NONEON-NOSVE-NEXT: ret
947 %op = load <16 x i16>, ptr %a
948 %res = call <16 x i16> @llvm.bswap.v16i16(<16 x i16> %op)
949 store <16 x i16> %res, ptr %a
953 define <2 x i32> @bswap_v2i32(<2 x i32> %op) {
954 ; CHECK-LABEL: bswap_v2i32:
956 ; CHECK-NEXT: ptrue p0.s, vl2
957 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
958 ; CHECK-NEXT: revb z0.s, p0/m, z0.s
959 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
962 ; NONEON-NOSVE-LABEL: bswap_v2i32:
963 ; NONEON-NOSVE: // %bb.0:
964 ; NONEON-NOSVE-NEXT: str d0, [sp, #-16]!
965 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
966 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #4]
967 ; NONEON-NOSVE-NEXT: strb w8, [sp, #15]
968 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #5]
969 ; NONEON-NOSVE-NEXT: strb w8, [sp, #14]
970 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #6]
971 ; NONEON-NOSVE-NEXT: strb w8, [sp, #13]
972 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #7]
973 ; NONEON-NOSVE-NEXT: strb w8, [sp, #12]
974 ; NONEON-NOSVE-NEXT: ldrb w8, [sp]
975 ; NONEON-NOSVE-NEXT: strb w8, [sp, #11]
976 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #1]
977 ; NONEON-NOSVE-NEXT: strb w8, [sp, #10]
978 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #2]
979 ; NONEON-NOSVE-NEXT: strb w8, [sp, #9]
980 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #3]
981 ; NONEON-NOSVE-NEXT: strb w8, [sp, #8]
982 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #8]
983 ; NONEON-NOSVE-NEXT: add sp, sp, #16
984 ; NONEON-NOSVE-NEXT: ret
985 %res = call <2 x i32> @llvm.bswap.v2i32(<2 x i32> %op)
989 define <4 x i32> @bswap_v4i32(<4 x i32> %op) {
990 ; CHECK-LABEL: bswap_v4i32:
992 ; CHECK-NEXT: ptrue p0.s, vl4
993 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
994 ; CHECK-NEXT: revb z0.s, p0/m, z0.s
995 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
998 ; NONEON-NOSVE-LABEL: bswap_v4i32:
999 ; NONEON-NOSVE: // %bb.0:
1000 ; NONEON-NOSVE-NEXT: str q0, [sp, #-32]!
1001 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 32
1002 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #12]
1003 ; NONEON-NOSVE-NEXT: strb w8, [sp, #31]
1004 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #13]
1005 ; NONEON-NOSVE-NEXT: strb w8, [sp, #30]
1006 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #14]
1007 ; NONEON-NOSVE-NEXT: strb w8, [sp, #29]
1008 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #15]
1009 ; NONEON-NOSVE-NEXT: strb w8, [sp, #28]
1010 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #8]
1011 ; NONEON-NOSVE-NEXT: strb w8, [sp, #27]
1012 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #9]
1013 ; NONEON-NOSVE-NEXT: strb w8, [sp, #26]
1014 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #10]
1015 ; NONEON-NOSVE-NEXT: strb w8, [sp, #25]
1016 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #11]
1017 ; NONEON-NOSVE-NEXT: strb w8, [sp, #24]
1018 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #4]
1019 ; NONEON-NOSVE-NEXT: strb w8, [sp, #23]
1020 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #5]
1021 ; NONEON-NOSVE-NEXT: strb w8, [sp, #22]
1022 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #6]
1023 ; NONEON-NOSVE-NEXT: strb w8, [sp, #21]
1024 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #7]
1025 ; NONEON-NOSVE-NEXT: strb w8, [sp, #20]
1026 ; NONEON-NOSVE-NEXT: ldrb w8, [sp]
1027 ; NONEON-NOSVE-NEXT: strb w8, [sp, #19]
1028 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #1]
1029 ; NONEON-NOSVE-NEXT: strb w8, [sp, #18]
1030 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #2]
1031 ; NONEON-NOSVE-NEXT: strb w8, [sp, #17]
1032 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #3]
1033 ; NONEON-NOSVE-NEXT: strb w8, [sp, #16]
1034 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #16]
1035 ; NONEON-NOSVE-NEXT: add sp, sp, #32
1036 ; NONEON-NOSVE-NEXT: ret
1037 %res = call <4 x i32> @llvm.bswap.v4i32(<4 x i32> %op)
1041 define void @bswap_v8i32(ptr %a) {
1042 ; CHECK-LABEL: bswap_v8i32:
1044 ; CHECK-NEXT: ldp q0, q1, [x0]
1045 ; CHECK-NEXT: ptrue p0.s, vl4
1046 ; CHECK-NEXT: revb z0.s, p0/m, z0.s
1047 ; CHECK-NEXT: revb z1.s, p0/m, z1.s
1048 ; CHECK-NEXT: stp q0, q1, [x0]
1051 ; NONEON-NOSVE-LABEL: bswap_v8i32:
1052 ; NONEON-NOSVE: // %bb.0:
1053 ; NONEON-NOSVE-NEXT: ldr q0, [x0, #16]
1054 ; NONEON-NOSVE-NEXT: str q0, [sp, #-64]!
1055 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 64
1056 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #12]
1057 ; NONEON-NOSVE-NEXT: ldr q0, [x0]
1058 ; NONEON-NOSVE-NEXT: strb w8, [sp, #31]
1059 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #13]
1060 ; NONEON-NOSVE-NEXT: str q0, [sp, #32]
1061 ; NONEON-NOSVE-NEXT: strb w8, [sp, #30]
1062 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #14]
1063 ; NONEON-NOSVE-NEXT: strb w8, [sp, #29]
1064 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #15]
1065 ; NONEON-NOSVE-NEXT: strb w8, [sp, #28]
1066 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #8]
1067 ; NONEON-NOSVE-NEXT: strb w8, [sp, #27]
1068 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #9]
1069 ; NONEON-NOSVE-NEXT: strb w8, [sp, #26]
1070 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #10]
1071 ; NONEON-NOSVE-NEXT: strb w8, [sp, #25]
1072 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #11]
1073 ; NONEON-NOSVE-NEXT: strb w8, [sp, #24]
1074 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #4]
1075 ; NONEON-NOSVE-NEXT: strb w8, [sp, #23]
1076 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #5]
1077 ; NONEON-NOSVE-NEXT: strb w8, [sp, #22]
1078 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #6]
1079 ; NONEON-NOSVE-NEXT: strb w8, [sp, #21]
1080 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #7]
1081 ; NONEON-NOSVE-NEXT: strb w8, [sp, #20]
1082 ; NONEON-NOSVE-NEXT: ldrb w8, [sp]
1083 ; NONEON-NOSVE-NEXT: strb w8, [sp, #19]
1084 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #1]
1085 ; NONEON-NOSVE-NEXT: strb w8, [sp, #18]
1086 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #2]
1087 ; NONEON-NOSVE-NEXT: strb w8, [sp, #17]
1088 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #3]
1089 ; NONEON-NOSVE-NEXT: strb w8, [sp, #16]
1090 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #44]
1091 ; NONEON-NOSVE-NEXT: ldr q1, [sp, #16]
1092 ; NONEON-NOSVE-NEXT: strb w8, [sp, #63]
1093 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #45]
1094 ; NONEON-NOSVE-NEXT: strb w8, [sp, #62]
1095 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #46]
1096 ; NONEON-NOSVE-NEXT: strb w8, [sp, #61]
1097 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #47]
1098 ; NONEON-NOSVE-NEXT: strb w8, [sp, #60]
1099 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #40]
1100 ; NONEON-NOSVE-NEXT: strb w8, [sp, #59]
1101 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #41]
1102 ; NONEON-NOSVE-NEXT: strb w8, [sp, #58]
1103 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #42]
1104 ; NONEON-NOSVE-NEXT: strb w8, [sp, #57]
1105 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #43]
1106 ; NONEON-NOSVE-NEXT: strb w8, [sp, #56]
1107 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #36]
1108 ; NONEON-NOSVE-NEXT: strb w8, [sp, #55]
1109 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #37]
1110 ; NONEON-NOSVE-NEXT: strb w8, [sp, #54]
1111 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #38]
1112 ; NONEON-NOSVE-NEXT: strb w8, [sp, #53]
1113 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #39]
1114 ; NONEON-NOSVE-NEXT: strb w8, [sp, #52]
1115 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #32]
1116 ; NONEON-NOSVE-NEXT: strb w8, [sp, #51]
1117 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #33]
1118 ; NONEON-NOSVE-NEXT: strb w8, [sp, #50]
1119 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #34]
1120 ; NONEON-NOSVE-NEXT: strb w8, [sp, #49]
1121 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #35]
1122 ; NONEON-NOSVE-NEXT: strb w8, [sp, #48]
1123 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #48]
1124 ; NONEON-NOSVE-NEXT: stp q0, q1, [x0]
1125 ; NONEON-NOSVE-NEXT: add sp, sp, #64
1126 ; NONEON-NOSVE-NEXT: ret
1127 %op = load <8 x i32>, ptr %a
1128 %res = call <8 x i32> @llvm.bswap.v8i32(<8 x i32> %op)
1129 store <8 x i32> %res, ptr %a
1133 define <1 x i64> @bswap_v1i64(<1 x i64> %op) {
1134 ; CHECK-LABEL: bswap_v1i64:
1136 ; CHECK-NEXT: ptrue p0.d, vl1
1137 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
1138 ; CHECK-NEXT: revb z0.d, p0/m, z0.d
1139 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
1142 ; NONEON-NOSVE-LABEL: bswap_v1i64:
1143 ; NONEON-NOSVE: // %bb.0:
1144 ; NONEON-NOSVE-NEXT: str d0, [sp, #-16]!
1145 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
1146 ; NONEON-NOSVE-NEXT: ldrb w8, [sp]
1147 ; NONEON-NOSVE-NEXT: strb w8, [sp, #15]
1148 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #1]
1149 ; NONEON-NOSVE-NEXT: strb w8, [sp, #14]
1150 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #2]
1151 ; NONEON-NOSVE-NEXT: strb w8, [sp, #13]
1152 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #3]
1153 ; NONEON-NOSVE-NEXT: strb w8, [sp, #12]
1154 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #4]
1155 ; NONEON-NOSVE-NEXT: strb w8, [sp, #11]
1156 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #5]
1157 ; NONEON-NOSVE-NEXT: strb w8, [sp, #10]
1158 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #6]
1159 ; NONEON-NOSVE-NEXT: strb w8, [sp, #9]
1160 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #7]
1161 ; NONEON-NOSVE-NEXT: strb w8, [sp, #8]
1162 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #8]
1163 ; NONEON-NOSVE-NEXT: add sp, sp, #16
1164 ; NONEON-NOSVE-NEXT: ret
1165 %res = call <1 x i64> @llvm.bswap.v1i64(<1 x i64> %op)
1169 define <2 x i64> @bswap_v2i64(<2 x i64> %op) {
1170 ; CHECK-LABEL: bswap_v2i64:
1172 ; CHECK-NEXT: ptrue p0.d, vl2
1173 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
1174 ; CHECK-NEXT: revb z0.d, p0/m, z0.d
1175 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
1178 ; NONEON-NOSVE-LABEL: bswap_v2i64:
1179 ; NONEON-NOSVE: // %bb.0:
1180 ; NONEON-NOSVE-NEXT: str q0, [sp, #-32]!
1181 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 32
1182 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #8]
1183 ; NONEON-NOSVE-NEXT: strb w8, [sp, #31]
1184 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #9]
1185 ; NONEON-NOSVE-NEXT: strb w8, [sp, #30]
1186 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #10]
1187 ; NONEON-NOSVE-NEXT: strb w8, [sp, #29]
1188 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #11]
1189 ; NONEON-NOSVE-NEXT: strb w8, [sp, #28]
1190 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #12]
1191 ; NONEON-NOSVE-NEXT: strb w8, [sp, #27]
1192 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #13]
1193 ; NONEON-NOSVE-NEXT: strb w8, [sp, #26]
1194 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #14]
1195 ; NONEON-NOSVE-NEXT: strb w8, [sp, #25]
1196 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #15]
1197 ; NONEON-NOSVE-NEXT: strb w8, [sp, #24]
1198 ; NONEON-NOSVE-NEXT: ldrb w8, [sp]
1199 ; NONEON-NOSVE-NEXT: strb w8, [sp, #23]
1200 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #1]
1201 ; NONEON-NOSVE-NEXT: strb w8, [sp, #22]
1202 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #2]
1203 ; NONEON-NOSVE-NEXT: strb w8, [sp, #21]
1204 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #3]
1205 ; NONEON-NOSVE-NEXT: strb w8, [sp, #20]
1206 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #4]
1207 ; NONEON-NOSVE-NEXT: strb w8, [sp, #19]
1208 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #5]
1209 ; NONEON-NOSVE-NEXT: strb w8, [sp, #18]
1210 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #6]
1211 ; NONEON-NOSVE-NEXT: strb w8, [sp, #17]
1212 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #7]
1213 ; NONEON-NOSVE-NEXT: strb w8, [sp, #16]
1214 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #16]
1215 ; NONEON-NOSVE-NEXT: add sp, sp, #32
1216 ; NONEON-NOSVE-NEXT: ret
1217 %res = call <2 x i64> @llvm.bswap.v2i64(<2 x i64> %op)
1221 define void @bswap_v4i64(ptr %a) {
1222 ; CHECK-LABEL: bswap_v4i64:
1224 ; CHECK-NEXT: ldp q0, q1, [x0]
1225 ; CHECK-NEXT: ptrue p0.d, vl2
1226 ; CHECK-NEXT: revb z0.d, p0/m, z0.d
1227 ; CHECK-NEXT: revb z1.d, p0/m, z1.d
1228 ; CHECK-NEXT: stp q0, q1, [x0]
1231 ; NONEON-NOSVE-LABEL: bswap_v4i64:
1232 ; NONEON-NOSVE: // %bb.0:
1233 ; NONEON-NOSVE-NEXT: ldr q0, [x0, #16]
1234 ; NONEON-NOSVE-NEXT: str q0, [sp, #-64]!
1235 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 64
1236 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #8]
1237 ; NONEON-NOSVE-NEXT: ldr q0, [x0]
1238 ; NONEON-NOSVE-NEXT: strb w8, [sp, #31]
1239 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #9]
1240 ; NONEON-NOSVE-NEXT: str q0, [sp, #32]
1241 ; NONEON-NOSVE-NEXT: strb w8, [sp, #30]
1242 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #10]
1243 ; NONEON-NOSVE-NEXT: strb w8, [sp, #29]
1244 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #11]
1245 ; NONEON-NOSVE-NEXT: strb w8, [sp, #28]
1246 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #12]
1247 ; NONEON-NOSVE-NEXT: strb w8, [sp, #27]
1248 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #13]
1249 ; NONEON-NOSVE-NEXT: strb w8, [sp, #26]
1250 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #14]
1251 ; NONEON-NOSVE-NEXT: strb w8, [sp, #25]
1252 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #15]
1253 ; NONEON-NOSVE-NEXT: strb w8, [sp, #24]
1254 ; NONEON-NOSVE-NEXT: ldrb w8, [sp]
1255 ; NONEON-NOSVE-NEXT: strb w8, [sp, #23]
1256 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #1]
1257 ; NONEON-NOSVE-NEXT: strb w8, [sp, #22]
1258 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #2]
1259 ; NONEON-NOSVE-NEXT: strb w8, [sp, #21]
1260 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #3]
1261 ; NONEON-NOSVE-NEXT: strb w8, [sp, #20]
1262 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #4]
1263 ; NONEON-NOSVE-NEXT: strb w8, [sp, #19]
1264 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #5]
1265 ; NONEON-NOSVE-NEXT: strb w8, [sp, #18]
1266 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #6]
1267 ; NONEON-NOSVE-NEXT: strb w8, [sp, #17]
1268 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #7]
1269 ; NONEON-NOSVE-NEXT: strb w8, [sp, #16]
1270 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #40]
1271 ; NONEON-NOSVE-NEXT: ldr q1, [sp, #16]
1272 ; NONEON-NOSVE-NEXT: strb w8, [sp, #63]
1273 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #41]
1274 ; NONEON-NOSVE-NEXT: strb w8, [sp, #62]
1275 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #42]
1276 ; NONEON-NOSVE-NEXT: strb w8, [sp, #61]
1277 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #43]
1278 ; NONEON-NOSVE-NEXT: strb w8, [sp, #60]
1279 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #44]
1280 ; NONEON-NOSVE-NEXT: strb w8, [sp, #59]
1281 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #45]
1282 ; NONEON-NOSVE-NEXT: strb w8, [sp, #58]
1283 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #46]
1284 ; NONEON-NOSVE-NEXT: strb w8, [sp, #57]
1285 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #47]
1286 ; NONEON-NOSVE-NEXT: strb w8, [sp, #56]
1287 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #32]
1288 ; NONEON-NOSVE-NEXT: strb w8, [sp, #55]
1289 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #33]
1290 ; NONEON-NOSVE-NEXT: strb w8, [sp, #54]
1291 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #34]
1292 ; NONEON-NOSVE-NEXT: strb w8, [sp, #53]
1293 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #35]
1294 ; NONEON-NOSVE-NEXT: strb w8, [sp, #52]
1295 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #36]
1296 ; NONEON-NOSVE-NEXT: strb w8, [sp, #51]
1297 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #37]
1298 ; NONEON-NOSVE-NEXT: strb w8, [sp, #50]
1299 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #38]
1300 ; NONEON-NOSVE-NEXT: strb w8, [sp, #49]
1301 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #39]
1302 ; NONEON-NOSVE-NEXT: strb w8, [sp, #48]
1303 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #48]
1304 ; NONEON-NOSVE-NEXT: stp q0, q1, [x0]
1305 ; NONEON-NOSVE-NEXT: add sp, sp, #64
1306 ; NONEON-NOSVE-NEXT: ret
1307 %op = load <4 x i64>, ptr %a
1308 %res = call <4 x i64> @llvm.bswap.v4i64(<4 x i64> %op)
1309 store <4 x i64> %res, ptr %a
1313 declare <4 x i8> @llvm.bitreverse.v4i8(<4 x i8>)
1314 declare <8 x i8> @llvm.bitreverse.v8i8(<8 x i8>)
1315 declare <16 x i8> @llvm.bitreverse.v16i8(<16 x i8>)
1316 declare <32 x i8> @llvm.bitreverse.v32i8(<32 x i8>)
1317 declare <2 x i16> @llvm.bitreverse.v2i16(<2 x i16>)
1318 declare <4 x i16> @llvm.bitreverse.v4i16(<4 x i16>)
1319 declare <8 x i16> @llvm.bitreverse.v8i16(<8 x i16>)
1320 declare <16 x i16> @llvm.bitreverse.v16i16(<16 x i16>)
1321 declare <2 x i32> @llvm.bitreverse.v2i32(<2 x i32>)
1322 declare <4 x i32> @llvm.bitreverse.v4i32(<4 x i32>)
1323 declare <8 x i32> @llvm.bitreverse.v8i32(<8 x i32>)
1324 declare <1 x i64> @llvm.bitreverse.v1i64(<1 x i64>)
1325 declare <2 x i64> @llvm.bitreverse.v2i64(<2 x i64>)
1326 declare <4 x i64> @llvm.bitreverse.v4i64(<4 x i64>)
1328 declare <2 x i16> @llvm.bswap.v2i16(<2 x i16>)
1329 declare <4 x i16> @llvm.bswap.v4i16(<4 x i16>)
1330 declare <8 x i16> @llvm.bswap.v8i16(<8 x i16>)
1331 declare <16 x i16> @llvm.bswap.v16i16(<16 x i16>)
1332 declare <2 x i32> @llvm.bswap.v2i32(<2 x i32>)
1333 declare <4 x i32> @llvm.bswap.v4i32(<4 x i32>)
1334 declare <8 x i32> @llvm.bswap.v8i32(<8 x i32>)
1335 declare <1 x i64> @llvm.bswap.v1i64(<1 x i64>)
1336 declare <2 x i64> @llvm.bswap.v2i64(<2 x i64>)
1337 declare <4 x i64> @llvm.bswap.v4i64(<4 x i64>)