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: vmov.i32 q2, #0x0
127 ; CHECK-NEXT: vcmp.u32 cs, q2, q1
130 ; CHECK-NEXT: vcmpt.i32 ne, q0, zr
131 ; CHECK-NEXT: vpsel q0, q1, q0
134 %c1 = icmp eq <4 x i32> %a, zeroinitializer
135 %c2 = icmp ule <4 x i32> %b, zeroinitializer
136 %o = or <4 x i1> %c1, %c2
137 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
141 define arm_aapcs_vfpcc <4 x i32> @cmpugez_v4i1(<4 x i32> %a, <4 x i32> %b) {
142 ; CHECK-LABEL: cmpugez_v4i1:
143 ; CHECK: @ %bb.0: @ %entry
146 %c1 = icmp eq <4 x i32> %a, zeroinitializer
147 %c2 = icmp uge <4 x i32> %b, zeroinitializer
148 %o = or <4 x i1> %c1, %c2
149 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
155 define arm_aapcs_vfpcc <4 x i32> @cmpeq_v4i1(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
156 ; CHECK-LABEL: cmpeq_v4i1:
157 ; CHECK: @ %bb.0: @ %entry
158 ; CHECK-NEXT: vpt.i32 ne, q0, zr
159 ; CHECK-NEXT: vcmpt.i32 ne, q1, q2
160 ; CHECK-NEXT: vpsel q0, q1, q0
163 %c1 = icmp eq <4 x i32> %a, zeroinitializer
164 %c2 = icmp eq <4 x i32> %b, %c
165 %o = or <4 x i1> %c1, %c2
166 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
170 define arm_aapcs_vfpcc <4 x i32> @cmpne_v4i1(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
171 ; CHECK-LABEL: cmpne_v4i1:
172 ; CHECK: @ %bb.0: @ %entry
173 ; CHECK-NEXT: vpt.i32 ne, q0, zr
174 ; CHECK-NEXT: vcmpt.i32 eq, q1, q2
175 ; CHECK-NEXT: vpsel q0, q1, q0
178 %c1 = icmp eq <4 x i32> %a, zeroinitializer
179 %c2 = icmp ne <4 x i32> %b, %c
180 %o = or <4 x i1> %c1, %c2
181 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
185 define arm_aapcs_vfpcc <4 x i32> @cmpslt_v4i1(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
186 ; CHECK-LABEL: cmpslt_v4i1:
187 ; CHECK: @ %bb.0: @ %entry
188 ; CHECK-NEXT: vpt.i32 ne, q0, zr
189 ; CHECK-NEXT: vcmpt.s32 le, q2, q1
190 ; CHECK-NEXT: vpsel q0, q1, q0
193 %c1 = icmp eq <4 x i32> %a, zeroinitializer
194 %c2 = icmp slt <4 x i32> %b, %c
195 %o = or <4 x i1> %c1, %c2
196 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
200 define arm_aapcs_vfpcc <4 x i32> @cmpsgt_v4i1(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
201 ; CHECK-LABEL: cmpsgt_v4i1:
202 ; CHECK: @ %bb.0: @ %entry
203 ; CHECK-NEXT: vpt.i32 ne, q0, zr
204 ; CHECK-NEXT: vcmpt.s32 le, q1, q2
205 ; CHECK-NEXT: vpsel q0, q1, q0
208 %c1 = icmp eq <4 x i32> %a, zeroinitializer
209 %c2 = icmp sgt <4 x i32> %b, %c
210 %o = or <4 x i1> %c1, %c2
211 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
215 define arm_aapcs_vfpcc <4 x i32> @cmpsle_v4i1(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
216 ; CHECK-LABEL: cmpsle_v4i1:
217 ; CHECK: @ %bb.0: @ %entry
218 ; CHECK-NEXT: vpt.i32 ne, q0, zr
219 ; CHECK-NEXT: vcmpt.s32 lt, q2, q1
220 ; CHECK-NEXT: vpsel q0, q1, q0
223 %c1 = icmp eq <4 x i32> %a, zeroinitializer
224 %c2 = icmp sle <4 x i32> %b, %c
225 %o = or <4 x i1> %c1, %c2
226 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
230 define arm_aapcs_vfpcc <4 x i32> @cmpsge_v4i1(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
231 ; CHECK-LABEL: cmpsge_v4i1:
232 ; CHECK: @ %bb.0: @ %entry
233 ; CHECK-NEXT: vpt.i32 ne, q0, zr
234 ; CHECK-NEXT: vcmpt.s32 lt, q1, q2
235 ; CHECK-NEXT: vpsel q0, q1, q0
238 %c1 = icmp eq <4 x i32> %a, zeroinitializer
239 %c2 = icmp sge <4 x i32> %b, %c
240 %o = or <4 x i1> %c1, %c2
241 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
245 define arm_aapcs_vfpcc <4 x i32> @cmpult_v4i1(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
246 ; CHECK-LABEL: cmpult_v4i1:
247 ; CHECK: @ %bb.0: @ %entry
248 ; CHECK-NEXT: vcmp.u32 hi, q2, q1
251 ; CHECK-NEXT: vcmpt.i32 ne, q0, zr
252 ; CHECK-NEXT: vpsel q0, q1, q0
255 %c1 = icmp eq <4 x i32> %a, zeroinitializer
256 %c2 = icmp ult <4 x i32> %b, %c
257 %o = or <4 x i1> %c1, %c2
258 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
262 define arm_aapcs_vfpcc <4 x i32> @cmpugt_v4i1(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
263 ; CHECK-LABEL: cmpugt_v4i1:
264 ; CHECK: @ %bb.0: @ %entry
265 ; CHECK-NEXT: vcmp.u32 hi, q1, q2
268 ; CHECK-NEXT: vcmpt.i32 ne, q0, zr
269 ; CHECK-NEXT: vpsel q0, q1, q0
272 %c1 = icmp eq <4 x i32> %a, zeroinitializer
273 %c2 = icmp ugt <4 x i32> %b, %c
274 %o = or <4 x i1> %c1, %c2
275 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
279 define arm_aapcs_vfpcc <4 x i32> @cmpule_v4i1(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
280 ; CHECK-LABEL: cmpule_v4i1:
281 ; CHECK: @ %bb.0: @ %entry
282 ; CHECK-NEXT: vcmp.u32 cs, q2, q1
285 ; CHECK-NEXT: vcmpt.i32 ne, q0, zr
286 ; CHECK-NEXT: vpsel q0, q1, q0
289 %c1 = icmp eq <4 x i32> %a, zeroinitializer
290 %c2 = icmp ule <4 x i32> %b, %c
291 %o = or <4 x i1> %c1, %c2
292 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
296 define arm_aapcs_vfpcc <4 x i32> @cmpuge_v4i1(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
297 ; CHECK-LABEL: cmpuge_v4i1:
298 ; CHECK: @ %bb.0: @ %entry
299 ; CHECK-NEXT: vcmp.u32 cs, q1, q2
302 ; CHECK-NEXT: vcmpt.i32 ne, q0, zr
303 ; CHECK-NEXT: vpsel q0, q1, q0
306 %c1 = icmp eq <4 x i32> %a, zeroinitializer
307 %c2 = icmp uge <4 x i32> %b, %c
308 %o = or <4 x i1> %c1, %c2
309 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
316 define arm_aapcs_vfpcc <8 x i16> @cmpeqz_v8i1(<8 x i16> %a, <8 x i16> %b) {
317 ; CHECK-LABEL: cmpeqz_v8i1:
318 ; CHECK: @ %bb.0: @ %entry
319 ; CHECK-NEXT: vpt.i16 ne, q0, zr
320 ; CHECK-NEXT: vcmpt.i16 ne, q1, zr
321 ; CHECK-NEXT: vpsel q0, q1, q0
324 %c1 = icmp eq <8 x i16> %a, zeroinitializer
325 %c2 = icmp eq <8 x i16> %b, zeroinitializer
326 %o = or <8 x i1> %c1, %c2
327 %s = select <8 x i1> %o, <8 x i16> %a, <8 x i16> %b
331 define arm_aapcs_vfpcc <8 x i16> @cmpeq_v8i1(<8 x i16> %a, <8 x i16> %b, <8 x i16> %c) {
332 ; CHECK-LABEL: cmpeq_v8i1:
333 ; CHECK: @ %bb.0: @ %entry
334 ; CHECK-NEXT: vpt.i16 ne, q0, zr
335 ; CHECK-NEXT: vcmpt.i16 ne, q1, q2
336 ; CHECK-NEXT: vpsel q0, q1, q0
339 %c1 = icmp eq <8 x i16> %a, zeroinitializer
340 %c2 = icmp eq <8 x i16> %b, %c
341 %o = or <8 x i1> %c1, %c2
342 %s = select <8 x i1> %o, <8 x i16> %a, <8 x i16> %b
347 define arm_aapcs_vfpcc <16 x i8> @cmpeqz_v16i1(<16 x i8> %a, <16 x i8> %b) {
348 ; CHECK-LABEL: cmpeqz_v16i1:
349 ; CHECK: @ %bb.0: @ %entry
350 ; CHECK-NEXT: vpt.i8 ne, q0, zr
351 ; CHECK-NEXT: vcmpt.i8 ne, q1, zr
352 ; CHECK-NEXT: vpsel q0, q1, q0
355 %c1 = icmp eq <16 x i8> %a, zeroinitializer
356 %c2 = icmp eq <16 x i8> %b, zeroinitializer
357 %o = or <16 x i1> %c1, %c2
358 %s = select <16 x i1> %o, <16 x i8> %a, <16 x i8> %b
362 define arm_aapcs_vfpcc <16 x i8> @cmpeq_v16i1(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
363 ; CHECK-LABEL: cmpeq_v16i1:
364 ; CHECK: @ %bb.0: @ %entry
365 ; CHECK-NEXT: vpt.i8 ne, q0, zr
366 ; CHECK-NEXT: vcmpt.i8 ne, q1, q2
367 ; CHECK-NEXT: vpsel q0, q1, q0
370 %c1 = icmp eq <16 x i8> %a, zeroinitializer
371 %c2 = icmp eq <16 x i8> %b, %c
372 %o = or <16 x i1> %c1, %c2
373 %s = select <16 x i1> %o, <16 x i8> %a, <16 x i8> %b
378 define arm_aapcs_vfpcc <2 x i64> @cmpeqz_v2i1(<2 x i64> %a, <2 x i64> %b) {
379 ; CHECK-LABEL: cmpeqz_v2i1:
380 ; CHECK: @ %bb.0: @ %entry
381 ; CHECK-NEXT: vmov r0, r1, d0
382 ; CHECK-NEXT: orrs r0, r1
383 ; CHECK-NEXT: vmov r1, r2, d2
384 ; CHECK-NEXT: orrs r1, r2
385 ; CHECK-NEXT: cset r1, eq
386 ; CHECK-NEXT: cmp r0, #0
387 ; CHECK-NEXT: csinc r0, r1, zr, ne
388 ; CHECK-NEXT: movs r1, #0
389 ; CHECK-NEXT: rsbs r0, r0, #0
390 ; CHECK-NEXT: bfi r1, r0, #0, #8
391 ; CHECK-NEXT: vmov r0, r2, d1
392 ; CHECK-NEXT: orrs r0, r2
393 ; CHECK-NEXT: vmov r2, r3, d3
394 ; CHECK-NEXT: orrs r2, r3
395 ; CHECK-NEXT: cset r2, eq
396 ; CHECK-NEXT: cmp r0, #0
397 ; CHECK-NEXT: csinc r0, r2, zr, ne
398 ; CHECK-NEXT: rsbs r0, r0, #0
399 ; CHECK-NEXT: bfi r1, r0, #8, #8
400 ; CHECK-NEXT: vmsr p0, r1
401 ; CHECK-NEXT: vpsel q0, q0, q1
404 %c1 = icmp eq <2 x i64> %a, zeroinitializer
405 %c2 = icmp eq <2 x i64> %b, zeroinitializer
406 %o = or <2 x i1> %c1, %c2
407 %s = select <2 x i1> %o, <2 x i64> %a, <2 x i64> %b
411 define arm_aapcs_vfpcc <2 x i64> @cmpeq_v2i1(<2 x i64> %a, <2 x i64> %b, <2 x i64> %c) {
412 ; CHECK-LABEL: cmpeq_v2i1:
413 ; CHECK: @ %bb.0: @ %entry
414 ; CHECK-NEXT: vmov r0, r1, d4
415 ; CHECK-NEXT: vmov r2, r3, d2
416 ; CHECK-NEXT: eors r1, r3
417 ; CHECK-NEXT: eors r0, r2
418 ; CHECK-NEXT: orrs r0, r1
419 ; CHECK-NEXT: vmov r1, r2, d0
420 ; CHECK-NEXT: cset r0, eq
421 ; CHECK-NEXT: orrs r1, r2
422 ; CHECK-NEXT: vmov r12, r2, d5
423 ; CHECK-NEXT: csinc r0, r0, zr, ne
424 ; CHECK-NEXT: movs r1, #0
425 ; CHECK-NEXT: rsbs r0, r0, #0
426 ; CHECK-NEXT: bfi r1, r0, #0, #8
427 ; CHECK-NEXT: vmov r3, r0, d3
428 ; CHECK-NEXT: eors r0, r2
429 ; CHECK-NEXT: eor.w r2, r3, r12
430 ; CHECK-NEXT: orrs r0, r2
431 ; CHECK-NEXT: vmov r2, r3, d1
432 ; CHECK-NEXT: cset r0, eq
433 ; CHECK-NEXT: orrs r2, r3
434 ; CHECK-NEXT: csinc r0, r0, zr, ne
435 ; CHECK-NEXT: rsbs r0, r0, #0
436 ; CHECK-NEXT: bfi r1, r0, #8, #8
437 ; CHECK-NEXT: vmsr p0, r1
438 ; CHECK-NEXT: vpsel q0, q0, q1
441 %c1 = icmp eq <2 x i64> %a, zeroinitializer
442 %c2 = icmp eq <2 x i64> %b, %c
443 %o = or <2 x i1> %c1, %c2
444 %s = select <2 x i1> %o, <2 x i64> %a, <2 x i64> %b