1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mattr=+sve -force-streaming-compatible-sve < %s | FileCheck %s
3 ; RUN: llc -mattr=+sme -force-streaming-compatible-sve < %s | FileCheck %s
6 target triple = "aarch64-unknown-linux-gnu"
12 define <4 x i8> @bitreverse_v4i8(<4 x i8> %op) {
13 ; CHECK-LABEL: bitreverse_v4i8:
15 ; CHECK-NEXT: ptrue p0.h, vl4
16 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
17 ; CHECK-NEXT: rbit z0.h, p0/m, z0.h
18 ; CHECK-NEXT: lsr z0.h, z0.h, #8
19 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
21 %res = call <4 x i8> @llvm.bitreverse.v4i8(<4 x i8> %op)
25 define <8 x i8> @bitreverse_v8i8(<8 x i8> %op) {
26 ; CHECK-LABEL: bitreverse_v8i8:
28 ; CHECK-NEXT: ptrue p0.b, vl8
29 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
30 ; CHECK-NEXT: rbit z0.b, p0/m, z0.b
31 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
33 %res = call <8 x i8> @llvm.bitreverse.v8i8(<8 x i8> %op)
37 define <16 x i8> @bitreverse_v16i8(<16 x i8> %op) {
38 ; CHECK-LABEL: bitreverse_v16i8:
40 ; CHECK-NEXT: ptrue p0.b, vl16
41 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
42 ; CHECK-NEXT: rbit z0.b, p0/m, z0.b
43 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
45 %res = call <16 x i8> @llvm.bitreverse.v16i8(<16 x i8> %op)
49 define void @bitreverse_v32i8(ptr %a) {
50 ; CHECK-LABEL: bitreverse_v32i8:
52 ; CHECK-NEXT: ptrue p0.b, vl16
53 ; CHECK-NEXT: ldp q0, q1, [x0]
54 ; CHECK-NEXT: rbit z0.b, p0/m, z0.b
55 ; CHECK-NEXT: rbit z1.b, p0/m, z1.b
56 ; CHECK-NEXT: stp q0, q1, [x0]
58 %op = load <32 x i8>, ptr %a
59 %res = call <32 x i8> @llvm.bitreverse.v32i8(<32 x i8> %op)
60 store <32 x i8> %res, ptr %a
64 define <2 x i16> @bitreverse_v2i16(<2 x i16> %op) {
65 ; CHECK-LABEL: bitreverse_v2i16:
67 ; CHECK-NEXT: ptrue p0.s, vl2
68 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
69 ; CHECK-NEXT: rbit z0.s, p0/m, z0.s
70 ; CHECK-NEXT: lsr z0.s, z0.s, #16
71 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
73 %res = call <2 x i16> @llvm.bitreverse.v2i16(<2 x i16> %op)
77 define <4 x i16> @bitreverse_v4i16(<4 x i16> %op) {
78 ; CHECK-LABEL: bitreverse_v4i16:
80 ; CHECK-NEXT: ptrue p0.h, vl4
81 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
82 ; CHECK-NEXT: rbit z0.h, p0/m, z0.h
83 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
85 %res = call <4 x i16> @llvm.bitreverse.v4i16(<4 x i16> %op)
89 define <8 x i16> @bitreverse_v8i16(<8 x i16> %op) {
90 ; CHECK-LABEL: bitreverse_v8i16:
92 ; CHECK-NEXT: ptrue p0.h, vl8
93 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
94 ; CHECK-NEXT: rbit z0.h, p0/m, z0.h
95 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
97 %res = call <8 x i16> @llvm.bitreverse.v8i16(<8 x i16> %op)
101 define void @bitreverse_v16i16(ptr %a) {
102 ; CHECK-LABEL: bitreverse_v16i16:
104 ; CHECK-NEXT: ptrue p0.h, vl8
105 ; CHECK-NEXT: ldp q0, q1, [x0]
106 ; CHECK-NEXT: rbit z0.h, p0/m, z0.h
107 ; CHECK-NEXT: rbit z1.h, p0/m, z1.h
108 ; CHECK-NEXT: stp q0, q1, [x0]
110 %op = load <16 x i16>, ptr %a
111 %res = call <16 x i16> @llvm.bitreverse.v16i16(<16 x i16> %op)
112 store <16 x i16> %res, ptr %a
116 define <2 x i32> @bitreverse_v2i32(<2 x i32> %op) {
117 ; CHECK-LABEL: bitreverse_v2i32:
119 ; CHECK-NEXT: ptrue p0.s, vl2
120 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
121 ; CHECK-NEXT: rbit z0.s, p0/m, z0.s
122 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
124 %res = call <2 x i32> @llvm.bitreverse.v2i32(<2 x i32> %op)
128 define <4 x i32> @bitreverse_v4i32(<4 x i32> %op) {
129 ; CHECK-LABEL: bitreverse_v4i32:
131 ; CHECK-NEXT: ptrue p0.s, vl4
132 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
133 ; CHECK-NEXT: rbit z0.s, p0/m, z0.s
134 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
136 %res = call <4 x i32> @llvm.bitreverse.v4i32(<4 x i32> %op)
140 define void @bitreverse_v8i32(ptr %a) {
141 ; CHECK-LABEL: bitreverse_v8i32:
143 ; CHECK-NEXT: ptrue p0.s, vl4
144 ; CHECK-NEXT: ldp q0, q1, [x0]
145 ; CHECK-NEXT: rbit z0.s, p0/m, z0.s
146 ; CHECK-NEXT: rbit z1.s, p0/m, z1.s
147 ; CHECK-NEXT: stp q0, q1, [x0]
149 %op = load <8 x i32>, ptr %a
150 %res = call <8 x i32> @llvm.bitreverse.v8i32(<8 x i32> %op)
151 store <8 x i32> %res, ptr %a
155 define <1 x i64> @bitreverse_v1i64(<1 x i64> %op) {
156 ; CHECK-LABEL: bitreverse_v1i64:
158 ; CHECK-NEXT: ptrue p0.d, vl1
159 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
160 ; CHECK-NEXT: rbit z0.d, p0/m, z0.d
161 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
163 %res = call <1 x i64> @llvm.bitreverse.v1i64(<1 x i64> %op)
167 define <2 x i64> @bitreverse_v2i64(<2 x i64> %op) {
168 ; CHECK-LABEL: bitreverse_v2i64:
170 ; CHECK-NEXT: ptrue p0.d, vl2
171 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
172 ; CHECK-NEXT: rbit z0.d, p0/m, z0.d
173 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
175 %res = call <2 x i64> @llvm.bitreverse.v2i64(<2 x i64> %op)
179 define void @bitreverse_v4i64(ptr %a) {
180 ; CHECK-LABEL: bitreverse_v4i64:
182 ; CHECK-NEXT: ptrue p0.d, vl2
183 ; CHECK-NEXT: ldp q0, q1, [x0]
184 ; CHECK-NEXT: rbit z0.d, p0/m, z0.d
185 ; CHECK-NEXT: rbit z1.d, p0/m, z1.d
186 ; CHECK-NEXT: stp q0, q1, [x0]
188 %op = load <4 x i64>, ptr %a
189 %res = call <4 x i64> @llvm.bitreverse.v4i64(<4 x i64> %op)
190 store <4 x i64> %res, ptr %a
198 define <2 x i16> @bswap_v2i16(<2 x i16> %op) {
199 ; CHECK-LABEL: bswap_v2i16:
201 ; CHECK-NEXT: ptrue p0.s, vl2
202 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
203 ; CHECK-NEXT: revb z0.s, p0/m, z0.s
204 ; CHECK-NEXT: lsr z0.s, z0.s, #16
205 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
207 %res = call <2 x i16> @llvm.bswap.v2i16(<2 x i16> %op)
211 define <4 x i16> @bswap_v4i16(<4 x i16> %op) {
212 ; CHECK-LABEL: bswap_v4i16:
214 ; CHECK-NEXT: ptrue p0.h, vl4
215 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
216 ; CHECK-NEXT: revb z0.h, p0/m, z0.h
217 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
219 %res = call <4 x i16> @llvm.bswap.v4i16(<4 x i16> %op)
223 define <8 x i16> @bswap_v8i16(<8 x i16> %op) {
224 ; CHECK-LABEL: bswap_v8i16:
226 ; CHECK-NEXT: ptrue p0.h, vl8
227 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
228 ; CHECK-NEXT: revb z0.h, p0/m, z0.h
229 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
231 %res = call <8 x i16> @llvm.bswap.v8i16(<8 x i16> %op)
235 define void @bswap_v16i16(ptr %a) {
236 ; CHECK-LABEL: bswap_v16i16:
238 ; CHECK-NEXT: ptrue p0.h, vl8
239 ; CHECK-NEXT: ldp q0, q1, [x0]
240 ; CHECK-NEXT: revb z0.h, p0/m, z0.h
241 ; CHECK-NEXT: revb z1.h, p0/m, z1.h
242 ; CHECK-NEXT: stp q0, q1, [x0]
244 %op = load <16 x i16>, ptr %a
245 %res = call <16 x i16> @llvm.bswap.v16i16(<16 x i16> %op)
246 store <16 x i16> %res, ptr %a
250 define <2 x i32> @bswap_v2i32(<2 x i32> %op) {
251 ; CHECK-LABEL: bswap_v2i32:
253 ; CHECK-NEXT: ptrue p0.s, vl2
254 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
255 ; CHECK-NEXT: revb z0.s, p0/m, z0.s
256 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
258 %res = call <2 x i32> @llvm.bswap.v2i32(<2 x i32> %op)
262 define <4 x i32> @bswap_v4i32(<4 x i32> %op) {
263 ; CHECK-LABEL: bswap_v4i32:
265 ; CHECK-NEXT: ptrue p0.s, vl4
266 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
267 ; CHECK-NEXT: revb z0.s, p0/m, z0.s
268 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
270 %res = call <4 x i32> @llvm.bswap.v4i32(<4 x i32> %op)
274 define void @bswap_v8i32(ptr %a) {
275 ; CHECK-LABEL: bswap_v8i32:
277 ; CHECK-NEXT: ptrue p0.s, vl4
278 ; CHECK-NEXT: ldp q0, q1, [x0]
279 ; CHECK-NEXT: revb z0.s, p0/m, z0.s
280 ; CHECK-NEXT: revb z1.s, p0/m, z1.s
281 ; CHECK-NEXT: stp q0, q1, [x0]
283 %op = load <8 x i32>, ptr %a
284 %res = call <8 x i32> @llvm.bswap.v8i32(<8 x i32> %op)
285 store <8 x i32> %res, ptr %a
289 define <1 x i64> @bswap_v1i64(<1 x i64> %op) {
290 ; CHECK-LABEL: bswap_v1i64:
292 ; CHECK-NEXT: ptrue p0.d, vl1
293 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
294 ; CHECK-NEXT: revb z0.d, p0/m, z0.d
295 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
297 %res = call <1 x i64> @llvm.bswap.v1i64(<1 x i64> %op)
301 define <2 x i64> @bswap_v2i64(<2 x i64> %op) {
302 ; CHECK-LABEL: bswap_v2i64:
304 ; CHECK-NEXT: ptrue p0.d, vl2
305 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
306 ; CHECK-NEXT: revb z0.d, p0/m, z0.d
307 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
309 %res = call <2 x i64> @llvm.bswap.v2i64(<2 x i64> %op)
313 define void @bswap_v4i64(ptr %a) {
314 ; CHECK-LABEL: bswap_v4i64:
316 ; CHECK-NEXT: ptrue p0.d, vl2
317 ; CHECK-NEXT: ldp q0, q1, [x0]
318 ; CHECK-NEXT: revb z0.d, p0/m, z0.d
319 ; CHECK-NEXT: revb z1.d, p0/m, z1.d
320 ; CHECK-NEXT: stp q0, q1, [x0]
322 %op = load <4 x i64>, ptr %a
323 %res = call <4 x i64> @llvm.bswap.v4i64(<4 x i64> %op)
324 store <4 x i64> %res, ptr %a
328 declare <4 x i8> @llvm.bitreverse.v4i8(<4 x i8>)
329 declare <8 x i8> @llvm.bitreverse.v8i8(<8 x i8>)
330 declare <16 x i8> @llvm.bitreverse.v16i8(<16 x i8>)
331 declare <32 x i8> @llvm.bitreverse.v32i8(<32 x i8>)
332 declare <2 x i16> @llvm.bitreverse.v2i16(<2 x i16>)
333 declare <4 x i16> @llvm.bitreverse.v4i16(<4 x i16>)
334 declare <8 x i16> @llvm.bitreverse.v8i16(<8 x i16>)
335 declare <16 x i16> @llvm.bitreverse.v16i16(<16 x i16>)
336 declare <2 x i32> @llvm.bitreverse.v2i32(<2 x i32>)
337 declare <4 x i32> @llvm.bitreverse.v4i32(<4 x i32>)
338 declare <8 x i32> @llvm.bitreverse.v8i32(<8 x i32>)
339 declare <1 x i64> @llvm.bitreverse.v1i64(<1 x i64>)
340 declare <2 x i64> @llvm.bitreverse.v2i64(<2 x i64>)
341 declare <4 x i64> @llvm.bitreverse.v4i64(<4 x i64>)
343 declare <2 x i16> @llvm.bswap.v2i16(<2 x i16>)
344 declare <4 x i16> @llvm.bswap.v4i16(<4 x i16>)
345 declare <8 x i16> @llvm.bswap.v8i16(<8 x i16>)
346 declare <16 x i16> @llvm.bswap.v16i16(<16 x i16>)
347 declare <2 x i32> @llvm.bswap.v2i32(<2 x i32>)
348 declare <4 x i32> @llvm.bswap.v4i32(<4 x i32>)
349 declare <8 x i32> @llvm.bswap.v8i32(<8 x i32>)
350 declare <1 x i64> @llvm.bswap.v1i64(<1 x i64>)
351 declare <2 x i64> @llvm.bswap.v2i64(<2 x i64>)
352 declare <4 x i64> @llvm.bswap.v4i64(<4 x i64>)