1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=thumbv8.1m.main-none-none-eabi -mattr=+mve -verify-machineinstrs %s -o - | FileCheck %s
4 define arm_aapcs_vfpcc <4 x i32> @cmpeqz_v4i1(<4 x i32> %a, <4 x i32> %b) {
5 ; CHECK-LABEL: cmpeqz_v4i1:
6 ; CHECK: @ %bb.0: @ %entry
7 ; CHECK-NEXT: vpt.i32 ne, q0, zr
8 ; CHECK-NEXT: vcmpt.i32 ne, q1, zr
9 ; CHECK-NEXT: vpsel q0, q1, q0
12 %c1 = icmp eq <4 x i32> %a, zeroinitializer
13 %c2 = icmp eq <4 x i32> %b, zeroinitializer
14 %o = or <4 x i1> %c1, %c2
15 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
19 define arm_aapcs_vfpcc <4 x i32> @cmpnez_v4i1(<4 x i32> %a, <4 x i32> %b) {
20 ; CHECK-LABEL: cmpnez_v4i1:
21 ; CHECK: @ %bb.0: @ %entry
22 ; CHECK-NEXT: vpt.i32 ne, q0, zr
23 ; CHECK-NEXT: vcmpt.i32 eq, q1, zr
24 ; CHECK-NEXT: vpsel q0, q1, q0
27 %c1 = icmp eq <4 x i32> %a, zeroinitializer
28 %c2 = icmp ne <4 x i32> %b, zeroinitializer
29 %o = or <4 x i1> %c1, %c2
30 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
34 define arm_aapcs_vfpcc <4 x i32> @cmpsltz_v4i1(<4 x i32> %a, <4 x i32> %b) {
35 ; CHECK-LABEL: cmpsltz_v4i1:
36 ; CHECK: @ %bb.0: @ %entry
37 ; CHECK-NEXT: vpt.i32 ne, q0, zr
38 ; CHECK-NEXT: vcmpt.s32 ge, q1, zr
39 ; CHECK-NEXT: vpsel q0, q1, q0
42 %c1 = icmp eq <4 x i32> %a, zeroinitializer
43 %c2 = icmp slt <4 x i32> %b, zeroinitializer
44 %o = or <4 x i1> %c1, %c2
45 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
49 define arm_aapcs_vfpcc <4 x i32> @cmpsgtz_v4i1(<4 x i32> %a, <4 x i32> %b) {
50 ; CHECK-LABEL: cmpsgtz_v4i1:
51 ; CHECK: @ %bb.0: @ %entry
52 ; CHECK-NEXT: vpt.i32 ne, q0, zr
53 ; CHECK-NEXT: vcmpt.s32 le, q1, zr
54 ; CHECK-NEXT: vpsel q0, q1, q0
57 %c1 = icmp eq <4 x i32> %a, zeroinitializer
58 %c2 = icmp sgt <4 x i32> %b, zeroinitializer
59 %o = or <4 x i1> %c1, %c2
60 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
64 define arm_aapcs_vfpcc <4 x i32> @cmpslez_v4i1(<4 x i32> %a, <4 x i32> %b) {
65 ; CHECK-LABEL: cmpslez_v4i1:
66 ; CHECK: @ %bb.0: @ %entry
67 ; CHECK-NEXT: vpt.i32 ne, q0, zr
68 ; CHECK-NEXT: vcmpt.s32 gt, q1, zr
69 ; CHECK-NEXT: vpsel q0, q1, q0
72 %c1 = icmp eq <4 x i32> %a, zeroinitializer
73 %c2 = icmp sle <4 x i32> %b, zeroinitializer
74 %o = or <4 x i1> %c1, %c2
75 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
79 define arm_aapcs_vfpcc <4 x i32> @cmpsgez_v4i1(<4 x i32> %a, <4 x i32> %b) {
80 ; CHECK-LABEL: cmpsgez_v4i1:
81 ; CHECK: @ %bb.0: @ %entry
82 ; CHECK-NEXT: vpt.i32 ne, q0, zr
83 ; CHECK-NEXT: vcmpt.s32 lt, q1, zr
84 ; CHECK-NEXT: vpsel q0, q1, q0
87 %c1 = icmp eq <4 x i32> %a, zeroinitializer
88 %c2 = icmp sge <4 x i32> %b, zeroinitializer
89 %o = or <4 x i1> %c1, %c2
90 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
94 define arm_aapcs_vfpcc <4 x i32> @cmpultz_v4i1(<4 x i32> %a, <4 x i32> %b) {
95 ; CHECK-LABEL: cmpultz_v4i1:
96 ; CHECK: @ %bb.0: @ %entry
97 ; CHECK-NEXT: vcmp.i32 eq, q0, zr
98 ; CHECK-NEXT: vpsel q0, q0, q1
101 %c1 = icmp eq <4 x i32> %a, zeroinitializer
102 %c2 = icmp ult <4 x i32> %b, zeroinitializer
103 %o = or <4 x i1> %c1, %c2
104 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
108 define arm_aapcs_vfpcc <4 x i32> @cmpugtz_v4i1(<4 x i32> %a, <4 x i32> %b) {
109 ; CHECK-LABEL: cmpugtz_v4i1:
110 ; CHECK: @ %bb.0: @ %entry
111 ; CHECK-NEXT: vpt.i32 ne, q0, zr
112 ; CHECK-NEXT: vcmpt.i32 eq, q1, zr
113 ; CHECK-NEXT: vpsel q0, q1, q0
116 %c1 = icmp eq <4 x i32> %a, zeroinitializer
117 %c2 = icmp ugt <4 x i32> %b, zeroinitializer
118 %o = or <4 x i1> %c1, %c2
119 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
123 define arm_aapcs_vfpcc <4 x i32> @cmpulez_v4i1(<4 x i32> %a, <4 x i32> %b) {
124 ; CHECK-LABEL: cmpulez_v4i1:
125 ; CHECK: @ %bb.0: @ %entry
126 ; CHECK-NEXT: vcmp.u32 cs, q1, zr
129 ; CHECK-NEXT: vcmpt.i32 ne, q0, zr
130 ; CHECK-NEXT: vpsel q0, q1, q0
133 %c1 = icmp eq <4 x i32> %a, zeroinitializer
134 %c2 = icmp ule <4 x i32> %b, zeroinitializer
135 %o = or <4 x i1> %c1, %c2
136 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
140 define arm_aapcs_vfpcc <4 x i32> @cmpugez_v4i1(<4 x i32> %a, <4 x i32> %b) {
141 ; CHECK-LABEL: cmpugez_v4i1:
142 ; CHECK: @ %bb.0: @ %entry
145 %c1 = icmp eq <4 x i32> %a, zeroinitializer
146 %c2 = icmp uge <4 x i32> %b, zeroinitializer
147 %o = or <4 x i1> %c1, %c2
148 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
154 define arm_aapcs_vfpcc <4 x i32> @cmpeq_v4i1(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
155 ; CHECK-LABEL: cmpeq_v4i1:
156 ; CHECK: @ %bb.0: @ %entry
157 ; CHECK-NEXT: vpt.i32 ne, q0, zr
158 ; CHECK-NEXT: vcmpt.i32 ne, q1, q2
159 ; CHECK-NEXT: vpsel q0, q1, q0
162 %c1 = icmp eq <4 x i32> %a, zeroinitializer
163 %c2 = icmp eq <4 x i32> %b, %c
164 %o = or <4 x i1> %c1, %c2
165 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
169 define arm_aapcs_vfpcc <4 x i32> @cmpne_v4i1(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
170 ; CHECK-LABEL: cmpne_v4i1:
171 ; CHECK: @ %bb.0: @ %entry
172 ; CHECK-NEXT: vpt.i32 ne, q0, zr
173 ; CHECK-NEXT: vcmpt.i32 eq, q1, q2
174 ; CHECK-NEXT: vpsel q0, q1, q0
177 %c1 = icmp eq <4 x i32> %a, zeroinitializer
178 %c2 = icmp ne <4 x i32> %b, %c
179 %o = or <4 x i1> %c1, %c2
180 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
184 define arm_aapcs_vfpcc <4 x i32> @cmpslt_v4i1(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
185 ; CHECK-LABEL: cmpslt_v4i1:
186 ; CHECK: @ %bb.0: @ %entry
187 ; CHECK-NEXT: vpt.i32 ne, q0, zr
188 ; CHECK-NEXT: vcmpt.s32 le, q2, q1
189 ; CHECK-NEXT: vpsel q0, q1, q0
192 %c1 = icmp eq <4 x i32> %a, zeroinitializer
193 %c2 = icmp slt <4 x i32> %b, %c
194 %o = or <4 x i1> %c1, %c2
195 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
199 define arm_aapcs_vfpcc <4 x i32> @cmpsgt_v4i1(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
200 ; CHECK-LABEL: cmpsgt_v4i1:
201 ; CHECK: @ %bb.0: @ %entry
202 ; CHECK-NEXT: vpt.i32 ne, q0, zr
203 ; CHECK-NEXT: vcmpt.s32 le, q1, q2
204 ; CHECK-NEXT: vpsel q0, q1, q0
207 %c1 = icmp eq <4 x i32> %a, zeroinitializer
208 %c2 = icmp sgt <4 x i32> %b, %c
209 %o = or <4 x i1> %c1, %c2
210 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
214 define arm_aapcs_vfpcc <4 x i32> @cmpsle_v4i1(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
215 ; CHECK-LABEL: cmpsle_v4i1:
216 ; CHECK: @ %bb.0: @ %entry
217 ; CHECK-NEXT: vpt.i32 ne, q0, zr
218 ; CHECK-NEXT: vcmpt.s32 lt, q2, q1
219 ; CHECK-NEXT: vpsel q0, q1, q0
222 %c1 = icmp eq <4 x i32> %a, zeroinitializer
223 %c2 = icmp sle <4 x i32> %b, %c
224 %o = or <4 x i1> %c1, %c2
225 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
229 define arm_aapcs_vfpcc <4 x i32> @cmpsge_v4i1(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
230 ; CHECK-LABEL: cmpsge_v4i1:
231 ; CHECK: @ %bb.0: @ %entry
232 ; CHECK-NEXT: vpt.i32 ne, q0, zr
233 ; CHECK-NEXT: vcmpt.s32 lt, q1, q2
234 ; CHECK-NEXT: vpsel q0, q1, q0
237 %c1 = icmp eq <4 x i32> %a, zeroinitializer
238 %c2 = icmp sge <4 x i32> %b, %c
239 %o = or <4 x i1> %c1, %c2
240 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
244 define arm_aapcs_vfpcc <4 x i32> @cmpult_v4i1(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
245 ; CHECK-LABEL: cmpult_v4i1:
246 ; CHECK: @ %bb.0: @ %entry
247 ; CHECK-NEXT: vcmp.u32 hi, q2, q1
250 ; CHECK-NEXT: vcmpt.i32 ne, q0, zr
251 ; CHECK-NEXT: vpsel q0, q1, q0
254 %c1 = icmp eq <4 x i32> %a, zeroinitializer
255 %c2 = icmp ult <4 x i32> %b, %c
256 %o = or <4 x i1> %c1, %c2
257 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
261 define arm_aapcs_vfpcc <4 x i32> @cmpugt_v4i1(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
262 ; CHECK-LABEL: cmpugt_v4i1:
263 ; CHECK: @ %bb.0: @ %entry
264 ; CHECK-NEXT: vcmp.u32 hi, q1, q2
267 ; CHECK-NEXT: vcmpt.i32 ne, q0, zr
268 ; CHECK-NEXT: vpsel q0, q1, q0
271 %c1 = icmp eq <4 x i32> %a, zeroinitializer
272 %c2 = icmp ugt <4 x i32> %b, %c
273 %o = or <4 x i1> %c1, %c2
274 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
278 define arm_aapcs_vfpcc <4 x i32> @cmpule_v4i1(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
279 ; CHECK-LABEL: cmpule_v4i1:
280 ; CHECK: @ %bb.0: @ %entry
281 ; CHECK-NEXT: vcmp.u32 cs, q2, q1
284 ; CHECK-NEXT: vcmpt.i32 ne, q0, zr
285 ; CHECK-NEXT: vpsel q0, q1, q0
288 %c1 = icmp eq <4 x i32> %a, zeroinitializer
289 %c2 = icmp ule <4 x i32> %b, %c
290 %o = or <4 x i1> %c1, %c2
291 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
295 define arm_aapcs_vfpcc <4 x i32> @cmpuge_v4i1(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
296 ; CHECK-LABEL: cmpuge_v4i1:
297 ; CHECK: @ %bb.0: @ %entry
298 ; CHECK-NEXT: vcmp.u32 cs, q1, q2
301 ; CHECK-NEXT: vcmpt.i32 ne, q0, zr
302 ; CHECK-NEXT: vpsel q0, q1, q0
305 %c1 = icmp eq <4 x i32> %a, zeroinitializer
306 %c2 = icmp uge <4 x i32> %b, %c
307 %o = or <4 x i1> %c1, %c2
308 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
315 define arm_aapcs_vfpcc <8 x i16> @cmpeqz_v8i1(<8 x i16> %a, <8 x i16> %b) {
316 ; CHECK-LABEL: cmpeqz_v8i1:
317 ; CHECK: @ %bb.0: @ %entry
318 ; CHECK-NEXT: vpt.i16 ne, q0, zr
319 ; CHECK-NEXT: vcmpt.i16 ne, q1, zr
320 ; CHECK-NEXT: vpsel q0, q1, q0
323 %c1 = icmp eq <8 x i16> %a, zeroinitializer
324 %c2 = icmp eq <8 x i16> %b, zeroinitializer
325 %o = or <8 x i1> %c1, %c2
326 %s = select <8 x i1> %o, <8 x i16> %a, <8 x i16> %b
330 define arm_aapcs_vfpcc <8 x i16> @cmpeq_v8i1(<8 x i16> %a, <8 x i16> %b, <8 x i16> %c) {
331 ; CHECK-LABEL: cmpeq_v8i1:
332 ; CHECK: @ %bb.0: @ %entry
333 ; CHECK-NEXT: vpt.i16 ne, q0, zr
334 ; CHECK-NEXT: vcmpt.i16 ne, q1, q2
335 ; CHECK-NEXT: vpsel q0, q1, q0
338 %c1 = icmp eq <8 x i16> %a, zeroinitializer
339 %c2 = icmp eq <8 x i16> %b, %c
340 %o = or <8 x i1> %c1, %c2
341 %s = select <8 x i1> %o, <8 x i16> %a, <8 x i16> %b
346 define arm_aapcs_vfpcc <16 x i8> @cmpeqz_v16i1(<16 x i8> %a, <16 x i8> %b) {
347 ; CHECK-LABEL: cmpeqz_v16i1:
348 ; CHECK: @ %bb.0: @ %entry
349 ; CHECK-NEXT: vpt.i8 ne, q0, zr
350 ; CHECK-NEXT: vcmpt.i8 ne, q1, zr
351 ; CHECK-NEXT: vpsel q0, q1, q0
354 %c1 = icmp eq <16 x i8> %a, zeroinitializer
355 %c2 = icmp eq <16 x i8> %b, zeroinitializer
356 %o = or <16 x i1> %c1, %c2
357 %s = select <16 x i1> %o, <16 x i8> %a, <16 x i8> %b
361 define arm_aapcs_vfpcc <16 x i8> @cmpeq_v16i1(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
362 ; CHECK-LABEL: cmpeq_v16i1:
363 ; CHECK: @ %bb.0: @ %entry
364 ; CHECK-NEXT: vpt.i8 ne, q0, zr
365 ; CHECK-NEXT: vcmpt.i8 ne, q1, q2
366 ; CHECK-NEXT: vpsel q0, q1, q0
369 %c1 = icmp eq <16 x i8> %a, zeroinitializer
370 %c2 = icmp eq <16 x i8> %b, %c
371 %o = or <16 x i1> %c1, %c2
372 %s = select <16 x i1> %o, <16 x i8> %a, <16 x i8> %b
377 define arm_aapcs_vfpcc <2 x i64> @cmpeqz_v2i1(<2 x i64> %a, <2 x i64> %b) {
378 ; CHECK-LABEL: cmpeqz_v2i1:
379 ; CHECK: @ %bb.0: @ %entry
380 ; CHECK-NEXT: vmov r0, r1, d3
381 ; CHECK-NEXT: orrs r0, r1
382 ; CHECK-NEXT: vmov r1, r2, d2
383 ; CHECK-NEXT: cset r0, eq
384 ; CHECK-NEXT: cmp r0, #0
385 ; CHECK-NEXT: csetm r0, ne
386 ; CHECK-NEXT: orrs r1, r2
387 ; CHECK-NEXT: cset r1, eq
388 ; CHECK-NEXT: cmp r1, #0
389 ; CHECK-NEXT: csetm r1, ne
390 ; CHECK-NEXT: vmov q2[2], q2[0], r1, r0
391 ; CHECK-NEXT: vmov q2[3], q2[1], r1, r0
392 ; CHECK-NEXT: vmov r0, r1, d1
393 ; CHECK-NEXT: orrs r0, r1
394 ; CHECK-NEXT: vmov r1, r2, d0
395 ; CHECK-NEXT: cset r0, eq
396 ; CHECK-NEXT: cmp r0, #0
397 ; CHECK-NEXT: csetm r0, ne
398 ; CHECK-NEXT: orrs r1, r2
399 ; CHECK-NEXT: cset r1, eq
400 ; CHECK-NEXT: cmp r1, #0
401 ; CHECK-NEXT: csetm r1, ne
402 ; CHECK-NEXT: vmov q3[2], q3[0], r1, r0
403 ; CHECK-NEXT: vmov q3[3], q3[1], r1, r0
404 ; CHECK-NEXT: vorr q2, q3, q2
405 ; CHECK-NEXT: vbic q1, q1, q2
406 ; CHECK-NEXT: vand q0, q0, q2
407 ; CHECK-NEXT: vorr q0, q0, q1
410 %c1 = icmp eq <2 x i64> %a, zeroinitializer
411 %c2 = icmp eq <2 x i64> %b, zeroinitializer
412 %o = or <2 x i1> %c1, %c2
413 %s = select <2 x i1> %o, <2 x i64> %a, <2 x i64> %b
417 define arm_aapcs_vfpcc <2 x i64> @cmpeq_v2i1(<2 x i64> %a, <2 x i64> %b, <2 x i64> %c) {
418 ; CHECK-LABEL: cmpeq_v2i1:
419 ; CHECK: @ %bb.0: @ %entry
420 ; CHECK-NEXT: vmov r0, r1, d5
421 ; CHECK-NEXT: vmov r2, r3, d3
422 ; CHECK-NEXT: eors r0, r2
423 ; CHECK-NEXT: eors r1, r3
424 ; CHECK-NEXT: orrs r0, r1
425 ; CHECK-NEXT: vmov r12, r2, d4
426 ; CHECK-NEXT: vmov r3, r1, d2
427 ; CHECK-NEXT: cset r0, eq
428 ; CHECK-NEXT: cmp r0, #0
429 ; CHECK-NEXT: csetm r0, ne
430 ; CHECK-NEXT: eors r1, r2
431 ; CHECK-NEXT: eor.w r2, r3, r12
432 ; CHECK-NEXT: orrs r1, r2
433 ; CHECK-NEXT: cset r1, eq
434 ; CHECK-NEXT: cmp r1, #0
435 ; CHECK-NEXT: csetm r1, ne
436 ; CHECK-NEXT: vmov q2[2], q2[0], r1, r0
437 ; CHECK-NEXT: vmov q2[3], q2[1], r1, r0
438 ; CHECK-NEXT: vmov r0, r1, d1
439 ; CHECK-NEXT: orrs r0, r1
440 ; CHECK-NEXT: vmov r1, r2, d0
441 ; CHECK-NEXT: cset r0, eq
442 ; CHECK-NEXT: cmp r0, #0
443 ; CHECK-NEXT: csetm r0, ne
444 ; CHECK-NEXT: orrs r1, r2
445 ; CHECK-NEXT: cset r1, eq
446 ; CHECK-NEXT: cmp r1, #0
447 ; CHECK-NEXT: csetm r1, ne
448 ; CHECK-NEXT: vmov q3[2], q3[0], r1, r0
449 ; CHECK-NEXT: vmov q3[3], q3[1], r1, r0
450 ; CHECK-NEXT: vorr q2, q3, q2
451 ; CHECK-NEXT: vbic q1, q1, q2
452 ; CHECK-NEXT: vand q0, q0, q2
453 ; CHECK-NEXT: vorr q0, q0, q1
456 %c1 = icmp eq <2 x i64> %a, zeroinitializer
457 %c2 = icmp eq <2 x i64> %b, %c
458 %o = or <2 x i1> %c1, %c2
459 %s = select <2 x i1> %o, <2 x i64> %a, <2 x i64> %b