1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve2 < %s | FileCheck %s
3 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sme -force-streaming < %s | FileCheck %s
9 define <vscale x 16 x i1> @whilege_b_ww(i32 %a, i32 %b) {
10 ; CHECK-LABEL: whilege_b_ww:
12 ; CHECK-NEXT: whilege p0.b, w0, w1
14 %out = call <vscale x 16 x i1> @llvm.aarch64.sve.whilege.nxv16i1.i32(i32 %a, i32 %b)
15 ret <vscale x 16 x i1> %out
18 define <vscale x 16 x i1> @whilege_b_xx(i64 %a, i64 %b) {
19 ; CHECK-LABEL: whilege_b_xx:
21 ; CHECK-NEXT: whilege p0.b, x0, x1
23 %out = call <vscale x 16 x i1> @llvm.aarch64.sve.whilege.nxv16i1.i64(i64 %a, i64 %b)
24 ret <vscale x 16 x i1> %out
27 define <vscale x 8 x i1> @whilege_h_ww(i32 %a, i32 %b) {
28 ; CHECK-LABEL: whilege_h_ww:
30 ; CHECK-NEXT: whilege p0.h, w0, w1
32 %out = call <vscale x 8 x i1> @llvm.aarch64.sve.whilege.nxv8i1.i32(i32 %a, i32 %b)
33 ret <vscale x 8 x i1> %out
36 define <vscale x 8 x i1> @whilege_h_xx(i64 %a, i64 %b) {
37 ; CHECK-LABEL: whilege_h_xx:
39 ; CHECK-NEXT: whilege p0.h, x0, x1
41 %out = call <vscale x 8 x i1> @llvm.aarch64.sve.whilege.nxv8i1.i64(i64 %a, i64 %b)
42 ret <vscale x 8 x i1> %out
45 define <vscale x 4 x i1> @whilege_s_ww(i32 %a, i32 %b) {
46 ; CHECK-LABEL: whilege_s_ww:
48 ; CHECK-NEXT: whilege p0.s, w0, w1
50 %out = call <vscale x 4 x i1> @llvm.aarch64.sve.whilege.nxv4i1.i32(i32 %a, i32 %b)
51 ret <vscale x 4 x i1> %out
54 define <vscale x 4 x i1> @whilege_s_xx(i64 %a, i64 %b) {
55 ; CHECK-LABEL: whilege_s_xx:
57 ; CHECK-NEXT: whilege p0.s, x0, x1
59 %out = call <vscale x 4 x i1> @llvm.aarch64.sve.whilege.nxv4i1.i64(i64 %a, i64 %b)
60 ret <vscale x 4 x i1> %out
63 define <vscale x 2 x i1> @whilege_d_ww(i32 %a, i32 %b) {
64 ; CHECK-LABEL: whilege_d_ww:
66 ; CHECK-NEXT: whilege p0.d, w0, w1
68 %out = call <vscale x 2 x i1> @llvm.aarch64.sve.whilege.nxv2i1.i32(i32 %a, i32 %b)
69 ret <vscale x 2 x i1> %out
72 define <vscale x 2 x i1> @whilege_d_xx(i64 %a, i64 %b) {
73 ; CHECK-LABEL: whilege_d_xx:
75 ; CHECK-NEXT: whilege p0.d, x0, x1
77 %out = call <vscale x 2 x i1> @llvm.aarch64.sve.whilege.nxv2i1.i64(i64 %a, i64 %b)
78 ret <vscale x 2 x i1> %out
81 ; Ensure we don't convert constant decrementing while instructions to ptrue.
82 define <vscale x 16 x i1> @whilege_b_ii() {
83 ; CHECK-LABEL: whilege_b_ii:
84 ; CHECK: // %bb.0: // %entry
85 ; CHECK-NEXT: mov w8, #-2 // =0xfffffffe
86 ; CHECK-NEXT: mov w9, #3 // =0x3
87 ; CHECK-NEXT: whilege p0.b, w9, w8
90 %out = call <vscale x 16 x i1> @llvm.aarch64.sve.whilege.nxv16i1.i32(i32 3, i32 -2)
91 ret <vscale x 16 x i1> %out
98 define <vscale x 16 x i1> @whilehs_b_ww(i32 %a, i32 %b) {
99 ; CHECK-LABEL: whilehs_b_ww:
101 ; CHECK-NEXT: whilehs p0.b, w0, w1
103 %out = call <vscale x 16 x i1> @llvm.aarch64.sve.whilehs.nxv16i1.i32(i32 %a, i32 %b)
104 ret <vscale x 16 x i1> %out
107 define <vscale x 16 x i1> @whilehs_b_xx(i64 %a, i64 %b) {
108 ; CHECK-LABEL: whilehs_b_xx:
110 ; CHECK-NEXT: whilehs p0.b, x0, x1
112 %out = call <vscale x 16 x i1> @llvm.aarch64.sve.whilehs.nxv16i1.i64(i64 %a, i64 %b)
113 ret <vscale x 16 x i1> %out
116 define <vscale x 8 x i1> @whilehs_h_ww(i32 %a, i32 %b) {
117 ; CHECK-LABEL: whilehs_h_ww:
119 ; CHECK-NEXT: whilehs p0.h, w0, w1
121 %out = call <vscale x 8 x i1> @llvm.aarch64.sve.whilehs.nxv8i1.i32(i32 %a, i32 %b)
122 ret <vscale x 8 x i1> %out
125 define <vscale x 8 x i1> @whilehs_h_xx(i64 %a, i64 %b) {
126 ; CHECK-LABEL: whilehs_h_xx:
128 ; CHECK-NEXT: whilehs p0.h, x0, x1
130 %out = call <vscale x 8 x i1> @llvm.aarch64.sve.whilehs.nxv8i1.i64(i64 %a, i64 %b)
131 ret <vscale x 8 x i1> %out
134 define <vscale x 4 x i1> @whilehs_s_ww(i32 %a, i32 %b) {
135 ; CHECK-LABEL: whilehs_s_ww:
137 ; CHECK-NEXT: whilehs p0.s, w0, w1
139 %out = call <vscale x 4 x i1> @llvm.aarch64.sve.whilehs.nxv4i1.i32(i32 %a, i32 %b)
140 ret <vscale x 4 x i1> %out
143 define <vscale x 4 x i1> @whilehs_s_xx(i64 %a, i64 %b) {
144 ; CHECK-LABEL: whilehs_s_xx:
146 ; CHECK-NEXT: whilehs p0.s, x0, x1
148 %out = call <vscale x 4 x i1> @llvm.aarch64.sve.whilehs.nxv4i1.i64(i64 %a, i64 %b)
149 ret <vscale x 4 x i1> %out
152 define <vscale x 2 x i1> @whilehs_d_ww(i32 %a, i32 %b) {
153 ; CHECK-LABEL: whilehs_d_ww:
155 ; CHECK-NEXT: whilehs p0.d, w0, w1
157 %out = call <vscale x 2 x i1> @llvm.aarch64.sve.whilehs.nxv2i1.i32(i32 %a, i32 %b)
158 ret <vscale x 2 x i1> %out
161 define <vscale x 2 x i1> @whilehs_d_xx(i64 %a, i64 %b) {
162 ; CHECK-LABEL: whilehs_d_xx:
164 ; CHECK-NEXT: whilehs p0.d, x0, x1
166 %out = call <vscale x 2 x i1> @llvm.aarch64.sve.whilehs.nxv2i1.i64(i64 %a, i64 %b)
167 ret <vscale x 2 x i1> %out
170 ; Ensure we don't convert constant decrementing while instructions to ptrue.
171 define <vscale x 16 x i1> @whilehs_b_ii() {
172 ; CHECK-LABEL: whilehs_b_ii:
173 ; CHECK: // %bb.0: // %entry
174 ; CHECK-NEXT: mov w8, #2 // =0x2
175 ; CHECK-NEXT: mov w9, #8 // =0x8
176 ; CHECK-NEXT: whilehs p0.b, x9, x8
179 %out = call <vscale x 16 x i1> @llvm.aarch64.sve.whilehs.nxv16i1.i64(i64 8, i64 2)
180 ret <vscale x 16 x i1> %out
187 define <vscale x 16 x i1> @whilegt_b_ww(i32 %a, i32 %b) {
188 ; CHECK-LABEL: whilegt_b_ww:
190 ; CHECK-NEXT: whilegt p0.b, w0, w1
192 %out = call <vscale x 16 x i1> @llvm.aarch64.sve.whilegt.nxv16i1.i32(i32 %a, i32 %b)
193 ret <vscale x 16 x i1> %out
196 define <vscale x 16 x i1> @whilegt_b_xx(i64 %a, i64 %b) {
197 ; CHECK-LABEL: whilegt_b_xx:
199 ; CHECK-NEXT: whilegt p0.b, x0, x1
201 %out = call <vscale x 16 x i1> @llvm.aarch64.sve.whilegt.nxv16i1.i64(i64 %a, i64 %b)
202 ret <vscale x 16 x i1> %out
205 define <vscale x 8 x i1> @whilegt_h_ww(i32 %a, i32 %b) {
206 ; CHECK-LABEL: whilegt_h_ww:
208 ; CHECK-NEXT: whilegt p0.h, w0, w1
210 %out = call <vscale x 8 x i1> @llvm.aarch64.sve.whilegt.nxv8i1.i32(i32 %a, i32 %b)
211 ret <vscale x 8 x i1> %out
214 define <vscale x 8 x i1> @whilegt_h_xx(i64 %a, i64 %b) {
215 ; CHECK-LABEL: whilegt_h_xx:
217 ; CHECK-NEXT: whilegt p0.h, x0, x1
219 %out = call <vscale x 8 x i1> @llvm.aarch64.sve.whilegt.nxv8i1.i64(i64 %a, i64 %b)
220 ret <vscale x 8 x i1> %out
223 define <vscale x 4 x i1> @whilegt_s_ww(i32 %a, i32 %b) {
224 ; CHECK-LABEL: whilegt_s_ww:
226 ; CHECK-NEXT: whilegt p0.s, w0, w1
228 %out = call <vscale x 4 x i1> @llvm.aarch64.sve.whilegt.nxv4i1.i32(i32 %a, i32 %b)
229 ret <vscale x 4 x i1> %out
232 define <vscale x 4 x i1> @whilegt_s_xx(i64 %a, i64 %b) {
233 ; CHECK-LABEL: whilegt_s_xx:
235 ; CHECK-NEXT: whilegt p0.s, x0, x1
237 %out = call <vscale x 4 x i1> @llvm.aarch64.sve.whilegt.nxv4i1.i64(i64 %a, i64 %b)
238 ret <vscale x 4 x i1> %out
241 define <vscale x 2 x i1> @whilegt_d_ww(i32 %a, i32 %b) {
242 ; CHECK-LABEL: whilegt_d_ww:
244 ; CHECK-NEXT: whilegt p0.d, w0, w1
246 %out = call <vscale x 2 x i1> @llvm.aarch64.sve.whilegt.nxv2i1.i32(i32 %a, i32 %b)
247 ret <vscale x 2 x i1> %out
250 define <vscale x 2 x i1> @whilegt_d_xx(i64 %a, i64 %b) {
251 ; CHECK-LABEL: whilegt_d_xx:
253 ; CHECK-NEXT: whilegt p0.d, x0, x1
255 %out = call <vscale x 2 x i1> @llvm.aarch64.sve.whilegt.nxv2i1.i64(i64 %a, i64 %b)
256 ret <vscale x 2 x i1> %out
259 ; Ensure we don't convert constant decrementing while instructions to ptrue.
260 define <vscale x 16 x i1> @whilegt_b_ii() {
261 ; CHECK-LABEL: whilegt_b_ii:
262 ; CHECK: // %bb.0: // %entry
263 ; CHECK-NEXT: mov w8, #-2 // =0xfffffffe
264 ; CHECK-NEXT: mov w9, #3 // =0x3
265 ; CHECK-NEXT: whilegt p0.b, w9, w8
268 %out = call <vscale x 16 x i1> @llvm.aarch64.sve.whilegt.nxv16i1.i32(i32 3, i32 -2)
269 ret <vscale x 16 x i1> %out
276 define <vscale x 16 x i1> @whilehi_b_ww(i32 %a, i32 %b) {
277 ; CHECK-LABEL: whilehi_b_ww:
279 ; CHECK-NEXT: whilehi p0.b, w0, w1
281 %out = call <vscale x 16 x i1> @llvm.aarch64.sve.whilehi.nxv16i1.i32(i32 %a, i32 %b)
282 ret <vscale x 16 x i1> %out
285 define <vscale x 16 x i1> @whilehi_b_xx(i64 %a, i64 %b) {
286 ; CHECK-LABEL: whilehi_b_xx:
288 ; CHECK-NEXT: whilehi p0.b, x0, x1
290 %out = call <vscale x 16 x i1> @llvm.aarch64.sve.whilehi.nxv16i1.i64(i64 %a, i64 %b)
291 ret <vscale x 16 x i1> %out
294 define <vscale x 8 x i1> @whilehi_h_ww(i32 %a, i32 %b) {
295 ; CHECK-LABEL: whilehi_h_ww:
297 ; CHECK-NEXT: whilehi p0.h, w0, w1
299 %out = call <vscale x 8 x i1> @llvm.aarch64.sve.whilehi.nxv8i1.i32(i32 %a, i32 %b)
300 ret <vscale x 8 x i1> %out
303 define <vscale x 8 x i1> @whilehi_h_xx(i64 %a, i64 %b) {
304 ; CHECK-LABEL: whilehi_h_xx:
306 ; CHECK-NEXT: whilehi p0.h, x0, x1
308 %out = call <vscale x 8 x i1> @llvm.aarch64.sve.whilehi.nxv8i1.i64(i64 %a, i64 %b)
309 ret <vscale x 8 x i1> %out
312 define <vscale x 4 x i1> @whilehi_s_ww(i32 %a, i32 %b) {
313 ; CHECK-LABEL: whilehi_s_ww:
315 ; CHECK-NEXT: whilehi p0.s, w0, w1
317 %out = call <vscale x 4 x i1> @llvm.aarch64.sve.whilehi.nxv4i1.i32(i32 %a, i32 %b)
318 ret <vscale x 4 x i1> %out
321 define <vscale x 4 x i1> @whilehi_s_xx(i64 %a, i64 %b) {
322 ; CHECK-LABEL: whilehi_s_xx:
324 ; CHECK-NEXT: whilehi p0.s, x0, x1
326 %out = call <vscale x 4 x i1> @llvm.aarch64.sve.whilehi.nxv4i1.i64(i64 %a, i64 %b)
327 ret <vscale x 4 x i1> %out
330 define <vscale x 2 x i1> @whilehi_d_ww(i32 %a, i32 %b) {
331 ; CHECK-LABEL: whilehi_d_ww:
333 ; CHECK-NEXT: whilehi p0.d, w0, w1
335 %out = call <vscale x 2 x i1> @llvm.aarch64.sve.whilehi.nxv2i1.i32(i32 %a, i32 %b)
336 ret <vscale x 2 x i1> %out
339 define <vscale x 2 x i1> @whilehi_d_xx(i64 %a, i64 %b) {
340 ; CHECK-LABEL: whilehi_d_xx:
342 ; CHECK-NEXT: whilehi p0.d, x0, x1
344 %out = call <vscale x 2 x i1> @llvm.aarch64.sve.whilehi.nxv2i1.i64(i64 %a, i64 %b)
345 ret <vscale x 2 x i1> %out
348 ; Ensure we don't convert constant decrementing while instructions to ptrue.
349 define <vscale x 16 x i1> @whilehi_b_ii() {
350 ; CHECK-LABEL: whilehi_b_ii:
351 ; CHECK: // %bb.0: // %entry
352 ; CHECK-NEXT: mov w8, #2 // =0x2
353 ; CHECK-NEXT: mov w9, #8 // =0x8
354 ; CHECK-NEXT: whilehi p0.b, x9, x8
357 %out = call <vscale x 16 x i1> @llvm.aarch64.sve.whilehi.nxv16i1.i64(i64 8, i64 2)
358 ret <vscale x 16 x i1> %out
361 declare <vscale x 16 x i1> @llvm.aarch64.sve.whilege.nxv16i1.i32(i32, i32)
362 declare <vscale x 16 x i1> @llvm.aarch64.sve.whilege.nxv16i1.i64(i64, i64)
363 declare <vscale x 8 x i1> @llvm.aarch64.sve.whilege.nxv8i1.i32(i32, i32)
364 declare <vscale x 8 x i1> @llvm.aarch64.sve.whilege.nxv8i1.i64(i64, i64)
365 declare <vscale x 4 x i1> @llvm.aarch64.sve.whilege.nxv4i1.i32(i32, i32)
366 declare <vscale x 4 x i1> @llvm.aarch64.sve.whilege.nxv4i1.i64(i64, i64)
367 declare <vscale x 2 x i1> @llvm.aarch64.sve.whilege.nxv2i1.i32(i32, i32)
368 declare <vscale x 2 x i1> @llvm.aarch64.sve.whilege.nxv2i1.i64(i64, i64)
370 declare <vscale x 16 x i1> @llvm.aarch64.sve.whilehs.nxv16i1.i32(i32, i32)
371 declare <vscale x 16 x i1> @llvm.aarch64.sve.whilehs.nxv16i1.i64(i64, i64)
372 declare <vscale x 8 x i1> @llvm.aarch64.sve.whilehs.nxv8i1.i32(i32, i32)
373 declare <vscale x 8 x i1> @llvm.aarch64.sve.whilehs.nxv8i1.i64(i64, i64)
374 declare <vscale x 4 x i1> @llvm.aarch64.sve.whilehs.nxv4i1.i32(i32, i32)
375 declare <vscale x 4 x i1> @llvm.aarch64.sve.whilehs.nxv4i1.i64(i64, i64)
376 declare <vscale x 2 x i1> @llvm.aarch64.sve.whilehs.nxv2i1.i32(i32, i32)
377 declare <vscale x 2 x i1> @llvm.aarch64.sve.whilehs.nxv2i1.i64(i64, i64)
379 declare <vscale x 16 x i1> @llvm.aarch64.sve.whilegt.nxv16i1.i32(i32, i32)
380 declare <vscale x 16 x i1> @llvm.aarch64.sve.whilegt.nxv16i1.i64(i64, i64)
381 declare <vscale x 8 x i1> @llvm.aarch64.sve.whilegt.nxv8i1.i32(i32, i32)
382 declare <vscale x 8 x i1> @llvm.aarch64.sve.whilegt.nxv8i1.i64(i64, i64)
383 declare <vscale x 4 x i1> @llvm.aarch64.sve.whilegt.nxv4i1.i32(i32, i32)
384 declare <vscale x 4 x i1> @llvm.aarch64.sve.whilegt.nxv4i1.i64(i64, i64)
385 declare <vscale x 2 x i1> @llvm.aarch64.sve.whilegt.nxv2i1.i32(i32, i32)
386 declare <vscale x 2 x i1> @llvm.aarch64.sve.whilegt.nxv2i1.i64(i64, i64)
388 declare <vscale x 16 x i1> @llvm.aarch64.sve.whilehi.nxv16i1.i32(i32, i32)
389 declare <vscale x 16 x i1> @llvm.aarch64.sve.whilehi.nxv16i1.i64(i64, i64)
390 declare <vscale x 8 x i1> @llvm.aarch64.sve.whilehi.nxv8i1.i32(i32, i32)
391 declare <vscale x 8 x i1> @llvm.aarch64.sve.whilehi.nxv8i1.i64(i64, i64)
392 declare <vscale x 4 x i1> @llvm.aarch64.sve.whilehi.nxv4i1.i32(i32, i32)
393 declare <vscale x 4 x i1> @llvm.aarch64.sve.whilehi.nxv4i1.i64(i64, i64)
394 declare <vscale x 2 x i1> @llvm.aarch64.sve.whilehi.nxv2i1.i32(i32, i32)
395 declare <vscale x 2 x i1> @llvm.aarch64.sve.whilehi.nxv2i1.i64(i64, i64)