1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=thumbv8.1m.main-arm-none-eabi -mattr=+mve -verify-machineinstrs %s -o - | FileCheck %s
4 define arm_aapcs_vfpcc <4 x i32> @vcmp_eqz_v4i32(<4 x i32> %src, <4 x i32> %a, <4 x i32> %b) {
5 ; CHECK-LABEL: vcmp_eqz_v4i32:
6 ; CHECK: @ %bb.0: @ %entry
7 ; CHECK-NEXT: vcmp.i32 eq, q0, zr
8 ; CHECK-NEXT: vpsel q0, q1, q2
11 %c = icmp eq <4 x i32> %src, zeroinitializer
12 %s = select <4 x i1> %c, <4 x i32> %a, <4 x i32> %b
16 define arm_aapcs_vfpcc <4 x i32> @vcmp_nez_v4i32(<4 x i32> %src, <4 x i32> %a, <4 x i32> %b) {
17 ; CHECK-LABEL: vcmp_nez_v4i32:
18 ; CHECK: @ %bb.0: @ %entry
19 ; CHECK-NEXT: vcmp.i32 ne, q0, zr
20 ; CHECK-NEXT: vpsel q0, q1, q2
23 %c = icmp ne <4 x i32> %src, zeroinitializer
24 %s = select <4 x i1> %c, <4 x i32> %a, <4 x i32> %b
28 define arm_aapcs_vfpcc <4 x i32> @vcmp_sgtz_v4i32(<4 x i32> %src, <4 x i32> %a, <4 x i32> %b) {
29 ; CHECK-LABEL: vcmp_sgtz_v4i32:
30 ; CHECK: @ %bb.0: @ %entry
31 ; CHECK-NEXT: vcmp.s32 gt, q0, zr
32 ; CHECK-NEXT: vpsel q0, q1, q2
35 %c = icmp sgt <4 x i32> %src, zeroinitializer
36 %s = select <4 x i1> %c, <4 x i32> %a, <4 x i32> %b
40 define arm_aapcs_vfpcc <4 x i32> @vcmp_sgez_v4i32(<4 x i32> %src, <4 x i32> %a, <4 x i32> %b) {
41 ; CHECK-LABEL: vcmp_sgez_v4i32:
42 ; CHECK: @ %bb.0: @ %entry
43 ; CHECK-NEXT: vcmp.s32 ge, q0, zr
44 ; CHECK-NEXT: vpsel q0, q1, q2
47 %c = icmp sge <4 x i32> %src, zeroinitializer
48 %s = select <4 x i1> %c, <4 x i32> %a, <4 x i32> %b
52 define arm_aapcs_vfpcc <4 x i32> @vcmp_sltz_v4i32(<4 x i32> %src, <4 x i32> %a, <4 x i32> %b) {
53 ; CHECK-LABEL: vcmp_sltz_v4i32:
54 ; CHECK: @ %bb.0: @ %entry
55 ; CHECK-NEXT: vcmp.s32 lt, q0, zr
56 ; CHECK-NEXT: vpsel q0, q1, q2
59 %c = icmp slt <4 x i32> %src, zeroinitializer
60 %s = select <4 x i1> %c, <4 x i32> %a, <4 x i32> %b
64 define arm_aapcs_vfpcc <4 x i32> @vcmp_slez_v4i32(<4 x i32> %src, <4 x i32> %a, <4 x i32> %b) {
65 ; CHECK-LABEL: vcmp_slez_v4i32:
66 ; CHECK: @ %bb.0: @ %entry
67 ; CHECK-NEXT: vcmp.s32 le, q0, zr
68 ; CHECK-NEXT: vpsel q0, q1, q2
71 %c = icmp sle <4 x i32> %src, zeroinitializer
72 %s = select <4 x i1> %c, <4 x i32> %a, <4 x i32> %b
76 define arm_aapcs_vfpcc <4 x i32> @vcmp_ugtz_v4i32(<4 x i32> %src, <4 x i32> %a, <4 x i32> %b) {
77 ; CHECK-LABEL: vcmp_ugtz_v4i32:
78 ; CHECK: @ %bb.0: @ %entry
79 ; CHECK-NEXT: vcmp.i32 ne, q0, zr
80 ; CHECK-NEXT: vpsel q0, q1, q2
83 %c = icmp ugt <4 x i32> %src, zeroinitializer
84 %s = select <4 x i1> %c, <4 x i32> %a, <4 x i32> %b
88 define arm_aapcs_vfpcc <4 x i32> @vcmp_ugez_v4i32(<4 x i32> %src, <4 x i32> %a, <4 x i32> %b) {
89 ; CHECK-LABEL: vcmp_ugez_v4i32:
90 ; CHECK: @ %bb.0: @ %entry
91 ; CHECK-NEXT: vmov q0, q1
94 %c = icmp uge <4 x i32> %src, zeroinitializer
95 %s = select <4 x i1> %c, <4 x i32> %a, <4 x i32> %b
99 define arm_aapcs_vfpcc <4 x i32> @vcmp_ultz_v4i32(<4 x i32> %src, <4 x i32> %a, <4 x i32> %b) {
100 ; CHECK-LABEL: vcmp_ultz_v4i32:
101 ; CHECK: @ %bb.0: @ %entry
102 ; CHECK-NEXT: vmov q0, q2
105 %c = icmp ult <4 x i32> %src, zeroinitializer
106 %s = select <4 x i1> %c, <4 x i32> %a, <4 x i32> %b
110 define arm_aapcs_vfpcc <4 x i32> @vcmp_ulez_v4i32(<4 x i32> %src, <4 x i32> %a, <4 x i32> %b) {
111 ; CHECK-LABEL: vcmp_ulez_v4i32:
112 ; CHECK: @ %bb.0: @ %entry
113 ; CHECK-NEXT: vmov.i32 q3, #0x0
114 ; CHECK-NEXT: vcmp.u32 cs, q3, q0
115 ; CHECK-NEXT: vpsel q0, q1, q2
118 %c = icmp ule <4 x i32> %src, zeroinitializer
119 %s = select <4 x i1> %c, <4 x i32> %a, <4 x i32> %b
124 define arm_aapcs_vfpcc <8 x i16> @vcmp_eqz_v8i16(<8 x i16> %src, <8 x i16> %a, <8 x i16> %b) {
125 ; CHECK-LABEL: vcmp_eqz_v8i16:
126 ; CHECK: @ %bb.0: @ %entry
127 ; CHECK-NEXT: vcmp.i16 eq, q0, zr
128 ; CHECK-NEXT: vpsel q0, q1, q2
131 %c = icmp eq <8 x i16> %src, zeroinitializer
132 %s = select <8 x i1> %c, <8 x i16> %a, <8 x i16> %b
136 define arm_aapcs_vfpcc <8 x i16> @vcmp_nez_v8i16(<8 x i16> %src, <8 x i16> %a, <8 x i16> %b) {
137 ; CHECK-LABEL: vcmp_nez_v8i16:
138 ; CHECK: @ %bb.0: @ %entry
139 ; CHECK-NEXT: vcmp.i16 ne, q0, zr
140 ; CHECK-NEXT: vpsel q0, q1, q2
143 %c = icmp ne <8 x i16> %src, zeroinitializer
144 %s = select <8 x i1> %c, <8 x i16> %a, <8 x i16> %b
148 define arm_aapcs_vfpcc <8 x i16> @vcmp_sgtz_v8i16(<8 x i16> %src, <8 x i16> %a, <8 x i16> %b) {
149 ; CHECK-LABEL: vcmp_sgtz_v8i16:
150 ; CHECK: @ %bb.0: @ %entry
151 ; CHECK-NEXT: vcmp.s16 gt, q0, zr
152 ; CHECK-NEXT: vpsel q0, q1, q2
155 %c = icmp sgt <8 x i16> %src, zeroinitializer
156 %s = select <8 x i1> %c, <8 x i16> %a, <8 x i16> %b
160 define arm_aapcs_vfpcc <8 x i16> @vcmp_sgez_v8i16(<8 x i16> %src, <8 x i16> %a, <8 x i16> %b) {
161 ; CHECK-LABEL: vcmp_sgez_v8i16:
162 ; CHECK: @ %bb.0: @ %entry
163 ; CHECK-NEXT: vcmp.s16 ge, q0, zr
164 ; CHECK-NEXT: vpsel q0, q1, q2
167 %c = icmp sge <8 x i16> %src, zeroinitializer
168 %s = select <8 x i1> %c, <8 x i16> %a, <8 x i16> %b
172 define arm_aapcs_vfpcc <8 x i16> @vcmp_sltz_v8i16(<8 x i16> %src, <8 x i16> %a, <8 x i16> %b) {
173 ; CHECK-LABEL: vcmp_sltz_v8i16:
174 ; CHECK: @ %bb.0: @ %entry
175 ; CHECK-NEXT: vcmp.s16 lt, q0, zr
176 ; CHECK-NEXT: vpsel q0, q1, q2
179 %c = icmp slt <8 x i16> %src, zeroinitializer
180 %s = select <8 x i1> %c, <8 x i16> %a, <8 x i16> %b
184 define arm_aapcs_vfpcc <8 x i16> @vcmp_slez_v8i16(<8 x i16> %src, <8 x i16> %a, <8 x i16> %b) {
185 ; CHECK-LABEL: vcmp_slez_v8i16:
186 ; CHECK: @ %bb.0: @ %entry
187 ; CHECK-NEXT: vcmp.s16 le, q0, zr
188 ; CHECK-NEXT: vpsel q0, q1, q2
191 %c = icmp sle <8 x i16> %src, zeroinitializer
192 %s = select <8 x i1> %c, <8 x i16> %a, <8 x i16> %b
196 define arm_aapcs_vfpcc <8 x i16> @vcmp_ugtz_v8i16(<8 x i16> %src, <8 x i16> %a, <8 x i16> %b) {
197 ; CHECK-LABEL: vcmp_ugtz_v8i16:
198 ; CHECK: @ %bb.0: @ %entry
199 ; CHECK-NEXT: vcmp.i16 ne, q0, zr
200 ; CHECK-NEXT: vpsel q0, q1, q2
203 %c = icmp ugt <8 x i16> %src, zeroinitializer
204 %s = select <8 x i1> %c, <8 x i16> %a, <8 x i16> %b
208 define arm_aapcs_vfpcc <8 x i16> @vcmp_ugez_v8i16(<8 x i16> %src, <8 x i16> %a, <8 x i16> %b) {
209 ; CHECK-LABEL: vcmp_ugez_v8i16:
210 ; CHECK: @ %bb.0: @ %entry
211 ; CHECK-NEXT: vmov q0, q1
214 %c = icmp uge <8 x i16> %src, zeroinitializer
215 %s = select <8 x i1> %c, <8 x i16> %a, <8 x i16> %b
219 define arm_aapcs_vfpcc <8 x i16> @vcmp_ultz_v8i16(<8 x i16> %src, <8 x i16> %a, <8 x i16> %b) {
220 ; CHECK-LABEL: vcmp_ultz_v8i16:
221 ; CHECK: @ %bb.0: @ %entry
222 ; CHECK-NEXT: vmov q0, q2
225 %c = icmp ult <8 x i16> %src, zeroinitializer
226 %s = select <8 x i1> %c, <8 x i16> %a, <8 x i16> %b
230 define arm_aapcs_vfpcc <8 x i16> @vcmp_ulez_v8i16(<8 x i16> %src, <8 x i16> %a, <8 x i16> %b) {
231 ; CHECK-LABEL: vcmp_ulez_v8i16:
232 ; CHECK: @ %bb.0: @ %entry
233 ; CHECK-NEXT: vmov.i32 q3, #0x0
234 ; CHECK-NEXT: vcmp.u16 cs, q3, q0
235 ; CHECK-NEXT: vpsel q0, q1, q2
238 %c = icmp ule <8 x i16> %src, zeroinitializer
239 %s = select <8 x i1> %c, <8 x i16> %a, <8 x i16> %b
244 define arm_aapcs_vfpcc <16 x i8> @vcmp_eqz_v16i8(<16 x i8> %src, <16 x i8> %a, <16 x i8> %b) {
245 ; CHECK-LABEL: vcmp_eqz_v16i8:
246 ; CHECK: @ %bb.0: @ %entry
247 ; CHECK-NEXT: vcmp.i8 eq, q0, zr
248 ; CHECK-NEXT: vpsel q0, q1, q2
251 %c = icmp eq <16 x i8> %src, zeroinitializer
252 %s = select <16 x i1> %c, <16 x i8> %a, <16 x i8> %b
256 define arm_aapcs_vfpcc <16 x i8> @vcmp_nez_v16i8(<16 x i8> %src, <16 x i8> %a, <16 x i8> %b) {
257 ; CHECK-LABEL: vcmp_nez_v16i8:
258 ; CHECK: @ %bb.0: @ %entry
259 ; CHECK-NEXT: vcmp.i8 ne, q0, zr
260 ; CHECK-NEXT: vpsel q0, q1, q2
263 %c = icmp ne <16 x i8> %src, zeroinitializer
264 %s = select <16 x i1> %c, <16 x i8> %a, <16 x i8> %b
268 define arm_aapcs_vfpcc <16 x i8> @vcmp_sgtz_v16i8(<16 x i8> %src, <16 x i8> %a, <16 x i8> %b) {
269 ; CHECK-LABEL: vcmp_sgtz_v16i8:
270 ; CHECK: @ %bb.0: @ %entry
271 ; CHECK-NEXT: vcmp.s8 gt, q0, zr
272 ; CHECK-NEXT: vpsel q0, q1, q2
275 %c = icmp sgt <16 x i8> %src, zeroinitializer
276 %s = select <16 x i1> %c, <16 x i8> %a, <16 x i8> %b
280 define arm_aapcs_vfpcc <16 x i8> @vcmp_sgez_v16i8(<16 x i8> %src, <16 x i8> %a, <16 x i8> %b) {
281 ; CHECK-LABEL: vcmp_sgez_v16i8:
282 ; CHECK: @ %bb.0: @ %entry
283 ; CHECK-NEXT: vcmp.s8 ge, q0, zr
284 ; CHECK-NEXT: vpsel q0, q1, q2
287 %c = icmp sge <16 x i8> %src, zeroinitializer
288 %s = select <16 x i1> %c, <16 x i8> %a, <16 x i8> %b
292 define arm_aapcs_vfpcc <16 x i8> @vcmp_sltz_v16i8(<16 x i8> %src, <16 x i8> %a, <16 x i8> %b) {
293 ; CHECK-LABEL: vcmp_sltz_v16i8:
294 ; CHECK: @ %bb.0: @ %entry
295 ; CHECK-NEXT: vcmp.s8 lt, q0, zr
296 ; CHECK-NEXT: vpsel q0, q1, q2
299 %c = icmp slt <16 x i8> %src, zeroinitializer
300 %s = select <16 x i1> %c, <16 x i8> %a, <16 x i8> %b
304 define arm_aapcs_vfpcc <16 x i8> @vcmp_slez_v16i8(<16 x i8> %src, <16 x i8> %a, <16 x i8> %b) {
305 ; CHECK-LABEL: vcmp_slez_v16i8:
306 ; CHECK: @ %bb.0: @ %entry
307 ; CHECK-NEXT: vcmp.s8 le, q0, zr
308 ; CHECK-NEXT: vpsel q0, q1, q2
311 %c = icmp sle <16 x i8> %src, zeroinitializer
312 %s = select <16 x i1> %c, <16 x i8> %a, <16 x i8> %b
316 define arm_aapcs_vfpcc <16 x i8> @vcmp_ugtz_v16i8(<16 x i8> %src, <16 x i8> %a, <16 x i8> %b) {
317 ; CHECK-LABEL: vcmp_ugtz_v16i8:
318 ; CHECK: @ %bb.0: @ %entry
319 ; CHECK-NEXT: vcmp.i8 ne, q0, zr
320 ; CHECK-NEXT: vpsel q0, q1, q2
323 %c = icmp ugt <16 x i8> %src, zeroinitializer
324 %s = select <16 x i1> %c, <16 x i8> %a, <16 x i8> %b
328 define arm_aapcs_vfpcc <16 x i8> @vcmp_ugez_v16i8(<16 x i8> %src, <16 x i8> %a, <16 x i8> %b) {
329 ; CHECK-LABEL: vcmp_ugez_v16i8:
330 ; CHECK: @ %bb.0: @ %entry
331 ; CHECK-NEXT: vmov q0, q1
334 %c = icmp uge <16 x i8> %src, zeroinitializer
335 %s = select <16 x i1> %c, <16 x i8> %a, <16 x i8> %b
339 define arm_aapcs_vfpcc <16 x i8> @vcmp_ultz_v16i8(<16 x i8> %src, <16 x i8> %a, <16 x i8> %b) {
340 ; CHECK-LABEL: vcmp_ultz_v16i8:
341 ; CHECK: @ %bb.0: @ %entry
342 ; CHECK-NEXT: vmov q0, q2
345 %c = icmp ult <16 x i8> %src, zeroinitializer
346 %s = select <16 x i1> %c, <16 x i8> %a, <16 x i8> %b
350 define arm_aapcs_vfpcc <16 x i8> @vcmp_ulez_v16i8(<16 x i8> %src, <16 x i8> %a, <16 x i8> %b) {
351 ; CHECK-LABEL: vcmp_ulez_v16i8:
352 ; CHECK: @ %bb.0: @ %entry
353 ; CHECK-NEXT: vmov.i32 q3, #0x0
354 ; CHECK-NEXT: vcmp.u8 cs, q3, q0
355 ; CHECK-NEXT: vpsel q0, q1, q2
358 %c = icmp ule <16 x i8> %src, zeroinitializer
359 %s = select <16 x i1> %c, <16 x i8> %a, <16 x i8> %b
364 define arm_aapcs_vfpcc <2 x i64> @vcmp_eqz_v2i64(<2 x i64> %src, <2 x i64> %a, <2 x i64> %b) {
365 ; CHECK-LABEL: vcmp_eqz_v2i64:
366 ; CHECK: @ %bb.0: @ %entry
367 ; CHECK-NEXT: vmov r0, s1
368 ; CHECK-NEXT: vmov r1, s0
369 ; CHECK-NEXT: orrs r0, r1
370 ; CHECK-NEXT: vmov r1, s2
371 ; CHECK-NEXT: clz r0, r0
372 ; CHECK-NEXT: lsrs r0, r0, #5
374 ; CHECK-NEXT: movne.w r0, #-1
375 ; CHECK-NEXT: vmov.32 q3[0], r0
376 ; CHECK-NEXT: vmov.32 q3[1], r0
377 ; CHECK-NEXT: vmov r0, s3
378 ; CHECK-NEXT: orrs r0, r1
379 ; CHECK-NEXT: clz r0, r0
380 ; CHECK-NEXT: lsrs r0, r0, #5
382 ; CHECK-NEXT: movne.w r0, #-1
383 ; CHECK-NEXT: vmov.32 q3[2], r0
384 ; CHECK-NEXT: vmov.32 q3[3], r0
385 ; CHECK-NEXT: vbic q0, q2, q3
386 ; CHECK-NEXT: vand q1, q1, q3
387 ; CHECK-NEXT: vorr q0, q1, q0
390 %c = icmp eq <2 x i64> %src, zeroinitializer
391 %s = select <2 x i1> %c, <2 x i64> %a, <2 x i64> %b
395 define arm_aapcs_vfpcc <2 x i32> @vcmp_eqz_v2i32(<2 x i64> %src, <2 x i32> %a, <2 x i32> %b) {
396 ; CHECK-LABEL: vcmp_eqz_v2i32:
397 ; CHECK: @ %bb.0: @ %entry
398 ; CHECK-NEXT: vmov r0, s1
399 ; CHECK-NEXT: vmov r1, s0
400 ; CHECK-NEXT: orrs r0, r1
401 ; CHECK-NEXT: vmov r1, s2
402 ; CHECK-NEXT: clz r0, r0
403 ; CHECK-NEXT: lsrs r0, r0, #5
405 ; CHECK-NEXT: movne.w r0, #-1
406 ; CHECK-NEXT: vmov.32 q3[0], r0
407 ; CHECK-NEXT: vmov.32 q3[1], r0
408 ; CHECK-NEXT: vmov r0, s3
409 ; CHECK-NEXT: orrs r0, r1
410 ; CHECK-NEXT: clz r0, r0
411 ; CHECK-NEXT: lsrs r0, r0, #5
413 ; CHECK-NEXT: movne.w r0, #-1
414 ; CHECK-NEXT: vmov.32 q3[2], r0
415 ; CHECK-NEXT: vmov.32 q3[3], r0
416 ; CHECK-NEXT: vbic q0, q2, q3
417 ; CHECK-NEXT: vand q1, q1, q3
418 ; CHECK-NEXT: vorr q0, q1, q0
421 %c = icmp eq <2 x i64> %src, zeroinitializer
422 %s = select <2 x i1> %c, <2 x i32> %a, <2 x i32> %b