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> @cmpeqz_v4i1(<4 x i32> %a, <4 x i32> %b) {
5 ; CHECK-LABEL: cmpeqz_v4i1:
6 ; CHECK: @ %bb.0: @ %entry
7 ; CHECK-NEXT: vcmp.i32 eq, q0, zr
8 ; CHECK-NEXT: vpsel q0, q1, q0
11 %c1 = icmp eq <4 x i32> %a, zeroinitializer
12 %o = xor <4 x i1> %c1, <i1 -1, i1 -1, i1 -1, i1 -1>
13 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
17 define arm_aapcs_vfpcc <4 x i32> @cmpnez_v4i1(<4 x i32> %a, <4 x i32> %b) {
18 ; CHECK-LABEL: cmpnez_v4i1:
19 ; CHECK: @ %bb.0: @ %entry
20 ; CHECK-NEXT: vcmp.i32 eq, q0, zr
21 ; CHECK-NEXT: vpsel q0, q1, q0
24 %c1 = icmp eq <4 x i32> %a, zeroinitializer
25 %o = xor <4 x i1> %c1, <i1 -1, i1 -1, i1 -1, i1 -1>
26 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
30 define arm_aapcs_vfpcc <4 x i32> @cmpsltz_v4i1(<4 x i32> %a, <4 x i32> %b) {
31 ; CHECK-LABEL: cmpsltz_v4i1:
32 ; CHECK: @ %bb.0: @ %entry
33 ; CHECK-NEXT: vcmp.i32 eq, q0, zr
34 ; CHECK-NEXT: vpsel q0, q1, q0
37 %c1 = icmp eq <4 x i32> %a, zeroinitializer
38 %o = xor <4 x i1> %c1, <i1 -1, i1 -1, i1 -1, i1 -1>
39 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
43 define arm_aapcs_vfpcc <4 x i32> @cmpsgtz_v4i1(<4 x i32> %a, <4 x i32> %b) {
44 ; CHECK-LABEL: cmpsgtz_v4i1:
45 ; CHECK: @ %bb.0: @ %entry
46 ; CHECK-NEXT: vcmp.i32 eq, q0, zr
47 ; CHECK-NEXT: vpsel q0, q1, q0
50 %c1 = icmp eq <4 x i32> %a, zeroinitializer
51 %o = xor <4 x i1> %c1, <i1 -1, i1 -1, i1 -1, i1 -1>
52 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
56 define arm_aapcs_vfpcc <4 x i32> @cmpslez_v4i1(<4 x i32> %a, <4 x i32> %b) {
57 ; CHECK-LABEL: cmpslez_v4i1:
58 ; CHECK: @ %bb.0: @ %entry
59 ; CHECK-NEXT: vcmp.i32 eq, q0, zr
60 ; CHECK-NEXT: vpsel q0, q1, q0
63 %c1 = icmp eq <4 x i32> %a, zeroinitializer
64 %o = xor <4 x i1> %c1, <i1 -1, i1 -1, i1 -1, i1 -1>
65 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
69 define arm_aapcs_vfpcc <4 x i32> @cmpsgez_v4i1(<4 x i32> %a, <4 x i32> %b) {
70 ; CHECK-LABEL: cmpsgez_v4i1:
71 ; CHECK: @ %bb.0: @ %entry
72 ; CHECK-NEXT: vcmp.i32 eq, q0, zr
73 ; CHECK-NEXT: vpsel q0, q1, q0
76 %c1 = icmp eq <4 x i32> %a, zeroinitializer
77 %o = xor <4 x i1> %c1, <i1 -1, i1 -1, i1 -1, i1 -1>
78 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
82 define arm_aapcs_vfpcc <4 x i32> @cmpultz_v4i1(<4 x i32> %a, <4 x i32> %b) {
83 ; CHECK-LABEL: cmpultz_v4i1:
84 ; CHECK: @ %bb.0: @ %entry
85 ; CHECK-NEXT: vcmp.i32 eq, q0, zr
86 ; CHECK-NEXT: vpsel q0, q1, q0
89 %c1 = icmp eq <4 x i32> %a, zeroinitializer
90 %o = xor <4 x i1> %c1, <i1 -1, i1 -1, i1 -1, i1 -1>
91 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
95 define arm_aapcs_vfpcc <4 x i32> @cmpugtz_v4i1(<4 x i32> %a, <4 x i32> %b) {
96 ; CHECK-LABEL: cmpugtz_v4i1:
97 ; CHECK: @ %bb.0: @ %entry
98 ; CHECK-NEXT: vcmp.i32 eq, q0, zr
99 ; CHECK-NEXT: vpsel q0, q1, q0
102 %c1 = icmp eq <4 x i32> %a, zeroinitializer
103 %o = xor <4 x i1> %c1, <i1 -1, i1 -1, i1 -1, i1 -1>
104 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
108 define arm_aapcs_vfpcc <4 x i32> @cmpulez_v4i1(<4 x i32> %a, <4 x i32> %b) {
109 ; CHECK-LABEL: cmpulez_v4i1:
110 ; CHECK: @ %bb.0: @ %entry
111 ; CHECK-NEXT: vcmp.i32 eq, q0, zr
112 ; CHECK-NEXT: vpsel q0, q1, q0
115 %c1 = icmp eq <4 x i32> %a, zeroinitializer
116 %o = xor <4 x i1> %c1, <i1 -1, i1 -1, i1 -1, i1 -1>
117 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
121 define arm_aapcs_vfpcc <4 x i32> @cmpugez_v4i1(<4 x i32> %a, <4 x i32> %b) {
122 ; CHECK-LABEL: cmpugez_v4i1:
123 ; CHECK: @ %bb.0: @ %entry
124 ; CHECK-NEXT: vcmp.i32 eq, q0, zr
125 ; CHECK-NEXT: vpsel q0, q1, q0
128 %c1 = icmp eq <4 x i32> %a, zeroinitializer
129 %o = xor <4 x i1> %c1, <i1 -1, i1 -1, i1 -1, i1 -1>
130 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
136 define arm_aapcs_vfpcc <4 x i32> @cmpeq_v4i1(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
137 ; CHECK-LABEL: cmpeq_v4i1:
138 ; CHECK: @ %bb.0: @ %entry
139 ; CHECK-NEXT: vcmp.i32 eq, q0, zr
140 ; CHECK-NEXT: vpsel q0, q1, q0
143 %c1 = icmp eq <4 x i32> %a, zeroinitializer
144 %o = xor <4 x i1> %c1, <i1 -1, i1 -1, i1 -1, i1 -1>
145 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
149 define arm_aapcs_vfpcc <4 x i32> @cmpne_v4i1(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
150 ; CHECK-LABEL: cmpne_v4i1:
151 ; CHECK: @ %bb.0: @ %entry
152 ; CHECK-NEXT: vcmp.i32 eq, q0, zr
153 ; CHECK-NEXT: vpsel q0, q1, q0
156 %c1 = icmp eq <4 x i32> %a, zeroinitializer
157 %o = xor <4 x i1> %c1, <i1 -1, i1 -1, i1 -1, i1 -1>
158 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
162 define arm_aapcs_vfpcc <4 x i32> @cmpslt_v4i1(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
163 ; CHECK-LABEL: cmpslt_v4i1:
164 ; CHECK: @ %bb.0: @ %entry
165 ; CHECK-NEXT: vcmp.i32 eq, q0, zr
166 ; CHECK-NEXT: vpsel q0, q1, q0
169 %c1 = icmp eq <4 x i32> %a, zeroinitializer
170 %o = xor <4 x i1> %c1, <i1 -1, i1 -1, i1 -1, i1 -1>
171 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
175 define arm_aapcs_vfpcc <4 x i32> @cmpsgt_v4i1(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
176 ; CHECK-LABEL: cmpsgt_v4i1:
177 ; CHECK: @ %bb.0: @ %entry
178 ; CHECK-NEXT: vcmp.i32 eq, q0, zr
179 ; CHECK-NEXT: vpsel q0, q1, q0
182 %c1 = icmp eq <4 x i32> %a, zeroinitializer
183 %o = xor <4 x i1> %c1, <i1 -1, i1 -1, i1 -1, i1 -1>
184 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
188 define arm_aapcs_vfpcc <4 x i32> @cmpsle_v4i1(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
189 ; CHECK-LABEL: cmpsle_v4i1:
190 ; CHECK: @ %bb.0: @ %entry
191 ; CHECK-NEXT: vcmp.i32 eq, q0, zr
192 ; CHECK-NEXT: vpsel q0, q1, q0
195 %c1 = icmp eq <4 x i32> %a, zeroinitializer
196 %o = xor <4 x i1> %c1, <i1 -1, i1 -1, i1 -1, i1 -1>
197 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
201 define arm_aapcs_vfpcc <4 x i32> @cmpsge_v4i1(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
202 ; CHECK-LABEL: cmpsge_v4i1:
203 ; CHECK: @ %bb.0: @ %entry
204 ; CHECK-NEXT: vcmp.i32 eq, q0, zr
205 ; CHECK-NEXT: vpsel q0, q1, q0
208 %c1 = icmp eq <4 x i32> %a, zeroinitializer
209 %o = xor <4 x i1> %c1, <i1 -1, i1 -1, i1 -1, i1 -1>
210 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
214 define arm_aapcs_vfpcc <4 x i32> @cmpult_v4i1(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
215 ; CHECK-LABEL: cmpult_v4i1:
216 ; CHECK: @ %bb.0: @ %entry
217 ; CHECK-NEXT: vcmp.i32 eq, q0, zr
218 ; CHECK-NEXT: vpsel q0, q1, q0
221 %c1 = icmp eq <4 x i32> %a, zeroinitializer
222 %o = xor <4 x i1> %c1, <i1 -1, i1 -1, i1 -1, i1 -1>
223 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
227 define arm_aapcs_vfpcc <4 x i32> @cmpugt_v4i1(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
228 ; CHECK-LABEL: cmpugt_v4i1:
229 ; CHECK: @ %bb.0: @ %entry
230 ; CHECK-NEXT: vcmp.i32 eq, q0, zr
231 ; CHECK-NEXT: vpsel q0, q1, q0
234 %c1 = icmp eq <4 x i32> %a, zeroinitializer
235 %o = xor <4 x i1> %c1, <i1 -1, i1 -1, i1 -1, i1 -1>
236 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
240 define arm_aapcs_vfpcc <4 x i32> @cmpule_v4i1(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
241 ; CHECK-LABEL: cmpule_v4i1:
242 ; CHECK: @ %bb.0: @ %entry
243 ; CHECK-NEXT: vcmp.i32 eq, q0, zr
244 ; CHECK-NEXT: vpsel q0, q1, q0
247 %c1 = icmp eq <4 x i32> %a, zeroinitializer
248 %o = xor <4 x i1> %c1, <i1 -1, i1 -1, i1 -1, i1 -1>
249 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
253 define arm_aapcs_vfpcc <4 x i32> @cmpuge_v4i1(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
254 ; CHECK-LABEL: cmpuge_v4i1:
255 ; CHECK: @ %bb.0: @ %entry
256 ; CHECK-NEXT: vcmp.i32 eq, q0, zr
257 ; CHECK-NEXT: vpsel q0, q1, q0
260 %c1 = icmp eq <4 x i32> %a, zeroinitializer
261 %o = xor <4 x i1> %c1, <i1 -1, i1 -1, i1 -1, i1 -1>
262 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b
269 define arm_aapcs_vfpcc <8 x i16> @cmpeqz_v8i1(<8 x i16> %a, <8 x i16> %b) {
270 ; CHECK-LABEL: cmpeqz_v8i1:
271 ; CHECK: @ %bb.0: @ %entry
272 ; CHECK-NEXT: vcmp.i16 eq, q0, zr
273 ; CHECK-NEXT: vpsel q0, q1, q0
276 %c1 = icmp eq <8 x i16> %a, zeroinitializer
277 %o = xor <8 x i1> %c1, <i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1>
278 %s = select <8 x i1> %o, <8 x i16> %a, <8 x i16> %b
282 define arm_aapcs_vfpcc <8 x i16> @cmpeq_v8i1(<8 x i16> %a, <8 x i16> %b, <8 x i16> %c) {
283 ; CHECK-LABEL: cmpeq_v8i1:
284 ; CHECK: @ %bb.0: @ %entry
285 ; CHECK-NEXT: vcmp.i16 eq, q0, zr
286 ; CHECK-NEXT: vpsel q0, q1, q0
289 %c1 = icmp eq <8 x i16> %a, zeroinitializer
290 %o = xor <8 x i1> %c1, <i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1>
291 %s = select <8 x i1> %o, <8 x i16> %a, <8 x i16> %b
296 define arm_aapcs_vfpcc <16 x i8> @cmpeqz_v16i1(<16 x i8> %a, <16 x i8> %b) {
297 ; CHECK-LABEL: cmpeqz_v16i1:
298 ; CHECK: @ %bb.0: @ %entry
299 ; CHECK-NEXT: vcmp.i8 eq, q0, zr
300 ; CHECK-NEXT: vpsel q0, q1, q0
303 %c1 = icmp eq <16 x i8> %a, zeroinitializer
304 %o = xor <16 x i1> %c1, <i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1>
305 %s = select <16 x i1> %o, <16 x i8> %a, <16 x i8> %b
309 define arm_aapcs_vfpcc <16 x i8> @cmpeq_v16i1(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
310 ; CHECK-LABEL: cmpeq_v16i1:
311 ; CHECK: @ %bb.0: @ %entry
312 ; CHECK-NEXT: vcmp.i8 eq, q0, zr
313 ; CHECK-NEXT: vpsel q0, q1, q0
316 %c1 = icmp eq <16 x i8> %a, zeroinitializer
317 %o = xor <16 x i1> %c1, <i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1>
318 %s = select <16 x i1> %o, <16 x i8> %a, <16 x i8> %b
323 define arm_aapcs_vfpcc <2 x i64> @cmpeqz_v2i1(<2 x i64> %a, <2 x i64> %b) {
324 ; CHECK-LABEL: cmpeqz_v2i1:
325 ; CHECK: @ %bb.0: @ %entry
326 ; CHECK-NEXT: vmov r0, s1
327 ; CHECK-NEXT: vmov r1, s0
328 ; CHECK-NEXT: orrs r0, r1
329 ; CHECK-NEXT: vmov r1, s2
330 ; CHECK-NEXT: cset r0, eq
331 ; CHECK-NEXT: tst.w r0, #1
332 ; CHECK-NEXT: csetm r0, ne
333 ; CHECK-NEXT: vmov.32 q2[0], r0
334 ; CHECK-NEXT: vmov.32 q2[1], r0
335 ; CHECK-NEXT: vmov r0, s3
336 ; CHECK-NEXT: orrs r0, r1
337 ; CHECK-NEXT: cset r0, eq
338 ; CHECK-NEXT: tst.w r0, #1
339 ; CHECK-NEXT: csetm r0, ne
340 ; CHECK-NEXT: vmov.32 q2[2], r0
341 ; CHECK-NEXT: vmov.32 q2[3], r0
342 ; CHECK-NEXT: vbic q0, q0, q2
343 ; CHECK-NEXT: vand q1, q1, q2
344 ; CHECK-NEXT: vorr q0, q1, q0
347 %c1 = icmp eq <2 x i64> %a, zeroinitializer
348 %o = xor <2 x i1> %c1, <i1 -1, i1 -1>
349 %s = select <2 x i1> %o, <2 x i64> %a, <2 x i64> %b
353 define arm_aapcs_vfpcc <2 x i64> @cmpeq_v2i1(<2 x i64> %a, <2 x i64> %b, <2 x i64> %c) {
354 ; CHECK-LABEL: cmpeq_v2i1:
355 ; CHECK: @ %bb.0: @ %entry
356 ; CHECK-NEXT: vmov r0, s1
357 ; CHECK-NEXT: vmov r1, s0
358 ; CHECK-NEXT: orrs r0, r1
359 ; CHECK-NEXT: vmov r1, s2
360 ; CHECK-NEXT: cset r0, eq
361 ; CHECK-NEXT: tst.w r0, #1
362 ; CHECK-NEXT: csetm r0, ne
363 ; CHECK-NEXT: vmov.32 q2[0], r0
364 ; CHECK-NEXT: vmov.32 q2[1], r0
365 ; CHECK-NEXT: vmov r0, s3
366 ; CHECK-NEXT: orrs r0, r1
367 ; CHECK-NEXT: cset r0, eq
368 ; CHECK-NEXT: tst.w r0, #1
369 ; CHECK-NEXT: csetm r0, ne
370 ; CHECK-NEXT: vmov.32 q2[2], r0
371 ; CHECK-NEXT: vmov.32 q2[3], r0
372 ; CHECK-NEXT: vbic q0, q0, q2
373 ; CHECK-NEXT: vand q1, q1, q2
374 ; CHECK-NEXT: vorr q0, q1, q0
377 %c1 = icmp eq <2 x i64> %a, zeroinitializer
378 %o = xor <2 x i1> %c1, <i1 -1, i1 -1>
379 %s = select <2 x i1> %o, <2 x i64> %a, <2 x i64> %b
383 define arm_aapcs_vfpcc <4 x i32> @vpnot_v4i1(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
384 ; CHECK-LABEL: vpnot_v4i1:
385 ; CHECK: @ %bb.0: @ %entry
386 ; CHECK-NEXT: vpt.s32 lt, q0, zr
387 ; CHECK-NEXT: vcmpt.s32 gt, q1, zr
390 ; CHECK-NEXT: vcmpt.i32 eq, q2, zr
391 ; CHECK-NEXT: vpsel q0, q0, q1
394 %c1 = icmp slt <4 x i32> %a, zeroinitializer
395 %c2 = icmp sgt <4 x i32> %b, zeroinitializer
396 %c3 = icmp eq <4 x i32> %c, zeroinitializer
397 %o1 = and <4 x i1> %c1, %c2
398 %o2 = xor <4 x i1> %o1, <i1 -1, i1 -1, i1 -1, i1 -1>
399 %o = and <4 x i1> %c3, %o2
400 %s = select <4 x i1> %o, <4 x i32> %a, <4 x i32> %b