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> @vcmp_eq_v4i32(<4 x i32> %src, i32 %src2, <4 x i32> %a, <4 x i32> %b) {
5 ; CHECK-LABEL: vcmp_eq_v4i32:
6 ; CHECK: @ %bb.0: @ %entry
7 ; CHECK-NEXT: vcmp.i32 eq, q0, r0
8 ; CHECK-NEXT: vpsel q0, q1, q2
11 %i = insertelement <4 x i32> undef, i32 %src2, i32 0
12 %sp = shufflevector <4 x i32> %i, <4 x i32> undef, <4 x i32> zeroinitializer
13 %c = icmp eq <4 x i32> %src, %sp
14 %s = select <4 x i1> %c, <4 x i32> %a, <4 x i32> %b
18 define arm_aapcs_vfpcc <4 x i32> @vcmp_ne_v4i32(<4 x i32> %src, i32 %src2, <4 x i32> %a, <4 x i32> %b) {
19 ; CHECK-LABEL: vcmp_ne_v4i32:
20 ; CHECK: @ %bb.0: @ %entry
21 ; CHECK-NEXT: vcmp.i32 ne, q0, r0
22 ; CHECK-NEXT: vpsel q0, q1, q2
25 %i = insertelement <4 x i32> undef, i32 %src2, i32 0
26 %sp = shufflevector <4 x i32> %i, <4 x i32> undef, <4 x i32> zeroinitializer
27 %c = icmp ne <4 x i32> %src, %sp
28 %s = select <4 x i1> %c, <4 x i32> %a, <4 x i32> %b
32 define arm_aapcs_vfpcc <4 x i32> @vcmp_sgt_v4i32(<4 x i32> %src, i32 %src2, <4 x i32> %a, <4 x i32> %b) {
33 ; CHECK-LABEL: vcmp_sgt_v4i32:
34 ; CHECK: @ %bb.0: @ %entry
35 ; CHECK-NEXT: vcmp.s32 gt, q0, r0
36 ; CHECK-NEXT: vpsel q0, q1, q2
39 %i = insertelement <4 x i32> undef, i32 %src2, i32 0
40 %sp = shufflevector <4 x i32> %i, <4 x i32> undef, <4 x i32> zeroinitializer
41 %c = icmp sgt <4 x i32> %src, %sp
42 %s = select <4 x i1> %c, <4 x i32> %a, <4 x i32> %b
46 define arm_aapcs_vfpcc <4 x i32> @vcmp_sge_v4i32(<4 x i32> %src, i32 %src2, <4 x i32> %a, <4 x i32> %b) {
47 ; CHECK-LABEL: vcmp_sge_v4i32:
48 ; CHECK: @ %bb.0: @ %entry
49 ; CHECK-NEXT: vcmp.s32 ge, q0, r0
50 ; CHECK-NEXT: vpsel q0, q1, q2
53 %i = insertelement <4 x i32> undef, i32 %src2, i32 0
54 %sp = shufflevector <4 x i32> %i, <4 x i32> undef, <4 x i32> zeroinitializer
55 %c = icmp sge <4 x i32> %src, %sp
56 %s = select <4 x i1> %c, <4 x i32> %a, <4 x i32> %b
60 define arm_aapcs_vfpcc <4 x i32> @vcmp_slt_v4i32(<4 x i32> %src, i32 %src2, <4 x i32> %a, <4 x i32> %b) {
61 ; CHECK-LABEL: vcmp_slt_v4i32:
62 ; CHECK: @ %bb.0: @ %entry
63 ; CHECK-NEXT: vcmp.s32 lt, q0, r0
64 ; CHECK-NEXT: vpsel q0, q1, q2
67 %i = insertelement <4 x i32> undef, i32 %src2, i32 0
68 %sp = shufflevector <4 x i32> %i, <4 x i32> undef, <4 x i32> zeroinitializer
69 %c = icmp slt <4 x i32> %src, %sp
70 %s = select <4 x i1> %c, <4 x i32> %a, <4 x i32> %b
74 define arm_aapcs_vfpcc <4 x i32> @vcmp_sle_v4i32(<4 x i32> %src, i32 %src2, <4 x i32> %a, <4 x i32> %b) {
75 ; CHECK-LABEL: vcmp_sle_v4i32:
76 ; CHECK: @ %bb.0: @ %entry
77 ; CHECK-NEXT: vcmp.s32 le, q0, r0
78 ; CHECK-NEXT: vpsel q0, q1, q2
81 %i = insertelement <4 x i32> undef, i32 %src2, i32 0
82 %sp = shufflevector <4 x i32> %i, <4 x i32> undef, <4 x i32> zeroinitializer
83 %c = icmp sle <4 x i32> %src, %sp
84 %s = select <4 x i1> %c, <4 x i32> %a, <4 x i32> %b
88 define arm_aapcs_vfpcc <4 x i32> @vcmp_ugt_v4i32(<4 x i32> %src, i32 %src2, <4 x i32> %a, <4 x i32> %b) {
89 ; CHECK-LABEL: vcmp_ugt_v4i32:
90 ; CHECK: @ %bb.0: @ %entry
91 ; CHECK-NEXT: vcmp.u32 hi, q0, r0
92 ; CHECK-NEXT: vpsel q0, q1, q2
95 %i = insertelement <4 x i32> undef, i32 %src2, i32 0
96 %sp = shufflevector <4 x i32> %i, <4 x i32> undef, <4 x i32> zeroinitializer
97 %c = icmp ugt <4 x i32> %src, %sp
98 %s = select <4 x i1> %c, <4 x i32> %a, <4 x i32> %b
102 define arm_aapcs_vfpcc <4 x i32> @vcmp_uge_v4i32(<4 x i32> %src, i32 %src2, <4 x i32> %a, <4 x i32> %b) {
103 ; CHECK-LABEL: vcmp_uge_v4i32:
104 ; CHECK: @ %bb.0: @ %entry
105 ; CHECK-NEXT: vcmp.u32 cs, q0, r0
106 ; CHECK-NEXT: vpsel q0, q1, q2
109 %i = insertelement <4 x i32> undef, i32 %src2, i32 0
110 %sp = shufflevector <4 x i32> %i, <4 x i32> undef, <4 x i32> zeroinitializer
111 %c = icmp uge <4 x i32> %src, %sp
112 %s = select <4 x i1> %c, <4 x i32> %a, <4 x i32> %b
116 define arm_aapcs_vfpcc <4 x i32> @vcmp_ult_v4i32(<4 x i32> %src, i32 %src2, <4 x i32> %a, <4 x i32> %b) {
117 ; CHECK-LABEL: vcmp_ult_v4i32:
118 ; CHECK: @ %bb.0: @ %entry
119 ; CHECK-NEXT: vdup.32 q3, r0
120 ; CHECK-NEXT: vcmp.u32 hi, q3, q0
121 ; CHECK-NEXT: vpsel q0, q1, q2
124 %i = insertelement <4 x i32> undef, i32 %src2, i32 0
125 %sp = shufflevector <4 x i32> %i, <4 x i32> undef, <4 x i32> zeroinitializer
126 %c = icmp ult <4 x i32> %src, %sp
127 %s = select <4 x i1> %c, <4 x i32> %a, <4 x i32> %b
131 define arm_aapcs_vfpcc <4 x i32> @vcmp_ule_v4i32(<4 x i32> %src, i32 %src2, <4 x i32> %a, <4 x i32> %b) {
132 ; CHECK-LABEL: vcmp_ule_v4i32:
133 ; CHECK: @ %bb.0: @ %entry
134 ; CHECK-NEXT: vdup.32 q3, r0
135 ; CHECK-NEXT: vcmp.u32 cs, q3, q0
136 ; CHECK-NEXT: vpsel q0, q1, q2
139 %i = insertelement <4 x i32> undef, i32 %src2, i32 0
140 %sp = shufflevector <4 x i32> %i, <4 x i32> undef, <4 x i32> zeroinitializer
141 %c = icmp ule <4 x i32> %src, %sp
142 %s = select <4 x i1> %c, <4 x i32> %a, <4 x i32> %b
147 define arm_aapcs_vfpcc <8 x i16> @vcmp_eq_v8i16(<8 x i16> %src, i16 %src2, <8 x i16> %a, <8 x i16> %b) {
148 ; CHECK-LABEL: vcmp_eq_v8i16:
149 ; CHECK: @ %bb.0: @ %entry
150 ; CHECK-NEXT: vcmp.i16 eq, q0, r0
151 ; CHECK-NEXT: vpsel q0, q1, q2
154 %i = insertelement <8 x i16> undef, i16 %src2, i32 0
155 %sp = shufflevector <8 x i16> %i, <8 x i16> undef, <8 x i32> zeroinitializer
156 %c = icmp eq <8 x i16> %src, %sp
157 %s = select <8 x i1> %c, <8 x i16> %a, <8 x i16> %b
161 define arm_aapcs_vfpcc <8 x i16> @vcmp_ne_v8i16(<8 x i16> %src, i16 %src2, <8 x i16> %a, <8 x i16> %b) {
162 ; CHECK-LABEL: vcmp_ne_v8i16:
163 ; CHECK: @ %bb.0: @ %entry
164 ; CHECK-NEXT: vcmp.i16 ne, q0, r0
165 ; CHECK-NEXT: vpsel q0, q1, q2
168 %i = insertelement <8 x i16> undef, i16 %src2, i32 0
169 %sp = shufflevector <8 x i16> %i, <8 x i16> undef, <8 x i32> zeroinitializer
170 %c = icmp ne <8 x i16> %src, %sp
171 %s = select <8 x i1> %c, <8 x i16> %a, <8 x i16> %b
175 define arm_aapcs_vfpcc <8 x i16> @vcmp_sgt_v8i16(<8 x i16> %src, i16 %src2, <8 x i16> %a, <8 x i16> %b) {
176 ; CHECK-LABEL: vcmp_sgt_v8i16:
177 ; CHECK: @ %bb.0: @ %entry
178 ; CHECK-NEXT: vcmp.s16 gt, q0, r0
179 ; CHECK-NEXT: vpsel q0, q1, q2
182 %i = insertelement <8 x i16> undef, i16 %src2, i32 0
183 %sp = shufflevector <8 x i16> %i, <8 x i16> undef, <8 x i32> zeroinitializer
184 %c = icmp sgt <8 x i16> %src, %sp
185 %s = select <8 x i1> %c, <8 x i16> %a, <8 x i16> %b
189 define arm_aapcs_vfpcc <8 x i16> @vcmp_sge_v8i16(<8 x i16> %src, i16 %src2, <8 x i16> %a, <8 x i16> %b) {
190 ; CHECK-LABEL: vcmp_sge_v8i16:
191 ; CHECK: @ %bb.0: @ %entry
192 ; CHECK-NEXT: vcmp.s16 ge, q0, r0
193 ; CHECK-NEXT: vpsel q0, q1, q2
196 %i = insertelement <8 x i16> undef, i16 %src2, i32 0
197 %sp = shufflevector <8 x i16> %i, <8 x i16> undef, <8 x i32> zeroinitializer
198 %c = icmp sge <8 x i16> %src, %sp
199 %s = select <8 x i1> %c, <8 x i16> %a, <8 x i16> %b
203 define arm_aapcs_vfpcc <8 x i16> @vcmp_slt_v8i16(<8 x i16> %src, i16 %src2, <8 x i16> %a, <8 x i16> %b) {
204 ; CHECK-LABEL: vcmp_slt_v8i16:
205 ; CHECK: @ %bb.0: @ %entry
206 ; CHECK-NEXT: vcmp.s16 lt, q0, r0
207 ; CHECK-NEXT: vpsel q0, q1, q2
210 %i = insertelement <8 x i16> undef, i16 %src2, i32 0
211 %sp = shufflevector <8 x i16> %i, <8 x i16> undef, <8 x i32> zeroinitializer
212 %c = icmp slt <8 x i16> %src, %sp
213 %s = select <8 x i1> %c, <8 x i16> %a, <8 x i16> %b
217 define arm_aapcs_vfpcc <8 x i16> @vcmp_sle_v8i16(<8 x i16> %src, i16 %src2, <8 x i16> %a, <8 x i16> %b) {
218 ; CHECK-LABEL: vcmp_sle_v8i16:
219 ; CHECK: @ %bb.0: @ %entry
220 ; CHECK-NEXT: vcmp.s16 le, q0, r0
221 ; CHECK-NEXT: vpsel q0, q1, q2
224 %i = insertelement <8 x i16> undef, i16 %src2, i32 0
225 %sp = shufflevector <8 x i16> %i, <8 x i16> undef, <8 x i32> zeroinitializer
226 %c = icmp sle <8 x i16> %src, %sp
227 %s = select <8 x i1> %c, <8 x i16> %a, <8 x i16> %b
231 define arm_aapcs_vfpcc <8 x i16> @vcmp_ugt_v8i16(<8 x i16> %src, i16 %src2, <8 x i16> %a, <8 x i16> %b) {
232 ; CHECK-LABEL: vcmp_ugt_v8i16:
233 ; CHECK: @ %bb.0: @ %entry
234 ; CHECK-NEXT: vcmp.u16 hi, q0, r0
235 ; CHECK-NEXT: vpsel q0, q1, q2
238 %i = insertelement <8 x i16> undef, i16 %src2, i32 0
239 %sp = shufflevector <8 x i16> %i, <8 x i16> undef, <8 x i32> zeroinitializer
240 %c = icmp ugt <8 x i16> %src, %sp
241 %s = select <8 x i1> %c, <8 x i16> %a, <8 x i16> %b
245 define arm_aapcs_vfpcc <8 x i16> @vcmp_uge_v8i16(<8 x i16> %src, i16 %src2, <8 x i16> %a, <8 x i16> %b) {
246 ; CHECK-LABEL: vcmp_uge_v8i16:
247 ; CHECK: @ %bb.0: @ %entry
248 ; CHECK-NEXT: vcmp.u16 cs, q0, r0
249 ; CHECK-NEXT: vpsel q0, q1, q2
252 %i = insertelement <8 x i16> undef, i16 %src2, i32 0
253 %sp = shufflevector <8 x i16> %i, <8 x i16> undef, <8 x i32> zeroinitializer
254 %c = icmp uge <8 x i16> %src, %sp
255 %s = select <8 x i1> %c, <8 x i16> %a, <8 x i16> %b
259 define arm_aapcs_vfpcc <8 x i16> @vcmp_ult_v8i16(<8 x i16> %src, i16 %src2, <8 x i16> %a, <8 x i16> %b) {
260 ; CHECK-LABEL: vcmp_ult_v8i16:
261 ; CHECK: @ %bb.0: @ %entry
262 ; CHECK-NEXT: vdup.16 q3, r0
263 ; CHECK-NEXT: vcmp.u16 hi, q3, q0
264 ; CHECK-NEXT: vpsel q0, q1, q2
267 %i = insertelement <8 x i16> undef, i16 %src2, i32 0
268 %sp = shufflevector <8 x i16> %i, <8 x i16> undef, <8 x i32> zeroinitializer
269 %c = icmp ult <8 x i16> %src, %sp
270 %s = select <8 x i1> %c, <8 x i16> %a, <8 x i16> %b
274 define arm_aapcs_vfpcc <8 x i16> @vcmp_ule_v8i16(<8 x i16> %src, i16 %src2, <8 x i16> %a, <8 x i16> %b) {
275 ; CHECK-LABEL: vcmp_ule_v8i16:
276 ; CHECK: @ %bb.0: @ %entry
277 ; CHECK-NEXT: vdup.16 q3, r0
278 ; CHECK-NEXT: vcmp.u16 cs, q3, q0
279 ; CHECK-NEXT: vpsel q0, q1, q2
282 %i = insertelement <8 x i16> undef, i16 %src2, i32 0
283 %sp = shufflevector <8 x i16> %i, <8 x i16> undef, <8 x i32> zeroinitializer
284 %c = icmp ule <8 x i16> %src, %sp
285 %s = select <8 x i1> %c, <8 x i16> %a, <8 x i16> %b
290 define arm_aapcs_vfpcc <16 x i8> @vcmp_eq_v16i8(<16 x i8> %src, i8 %src2, <16 x i8> %a, <16 x i8> %b) {
291 ; CHECK-LABEL: vcmp_eq_v16i8:
292 ; CHECK: @ %bb.0: @ %entry
293 ; CHECK-NEXT: vcmp.i8 eq, q0, r0
294 ; CHECK-NEXT: vpsel q0, q1, q2
297 %i = insertelement <16 x i8> undef, i8 %src2, i32 0
298 %sp = shufflevector <16 x i8> %i, <16 x i8> undef, <16 x i32> zeroinitializer
299 %c = icmp eq <16 x i8> %src, %sp
300 %s = select <16 x i1> %c, <16 x i8> %a, <16 x i8> %b
304 define arm_aapcs_vfpcc <16 x i8> @vcmp_ne_v16i8(<16 x i8> %src, i8 %src2, <16 x i8> %a, <16 x i8> %b) {
305 ; CHECK-LABEL: vcmp_ne_v16i8:
306 ; CHECK: @ %bb.0: @ %entry
307 ; CHECK-NEXT: vcmp.i8 ne, q0, r0
308 ; CHECK-NEXT: vpsel q0, q1, q2
311 %i = insertelement <16 x i8> undef, i8 %src2, i32 0
312 %sp = shufflevector <16 x i8> %i, <16 x i8> undef, <16 x i32> zeroinitializer
313 %c = icmp ne <16 x i8> %src, %sp
314 %s = select <16 x i1> %c, <16 x i8> %a, <16 x i8> %b
318 define arm_aapcs_vfpcc <16 x i8> @vcmp_sgt_v16i8(<16 x i8> %src, i8 %src2, <16 x i8> %a, <16 x i8> %b) {
319 ; CHECK-LABEL: vcmp_sgt_v16i8:
320 ; CHECK: @ %bb.0: @ %entry
321 ; CHECK-NEXT: vcmp.s8 gt, q0, r0
322 ; CHECK-NEXT: vpsel q0, q1, q2
325 %i = insertelement <16 x i8> undef, i8 %src2, i32 0
326 %sp = shufflevector <16 x i8> %i, <16 x i8> undef, <16 x i32> zeroinitializer
327 %c = icmp sgt <16 x i8> %src, %sp
328 %s = select <16 x i1> %c, <16 x i8> %a, <16 x i8> %b
332 define arm_aapcs_vfpcc <16 x i8> @vcmp_sge_v16i8(<16 x i8> %src, i8 %src2, <16 x i8> %a, <16 x i8> %b) {
333 ; CHECK-LABEL: vcmp_sge_v16i8:
334 ; CHECK: @ %bb.0: @ %entry
335 ; CHECK-NEXT: vcmp.s8 ge, q0, r0
336 ; CHECK-NEXT: vpsel q0, q1, q2
339 %i = insertelement <16 x i8> undef, i8 %src2, i32 0
340 %sp = shufflevector <16 x i8> %i, <16 x i8> undef, <16 x i32> zeroinitializer
341 %c = icmp sge <16 x i8> %src, %sp
342 %s = select <16 x i1> %c, <16 x i8> %a, <16 x i8> %b
346 define arm_aapcs_vfpcc <16 x i8> @vcmp_slt_v16i8(<16 x i8> %src, i8 %src2, <16 x i8> %a, <16 x i8> %b) {
347 ; CHECK-LABEL: vcmp_slt_v16i8:
348 ; CHECK: @ %bb.0: @ %entry
349 ; CHECK-NEXT: vcmp.s8 lt, q0, r0
350 ; CHECK-NEXT: vpsel q0, q1, q2
353 %i = insertelement <16 x i8> undef, i8 %src2, i32 0
354 %sp = shufflevector <16 x i8> %i, <16 x i8> undef, <16 x i32> zeroinitializer
355 %c = icmp slt <16 x i8> %src, %sp
356 %s = select <16 x i1> %c, <16 x i8> %a, <16 x i8> %b
360 define arm_aapcs_vfpcc <16 x i8> @vcmp_sle_v16i8(<16 x i8> %src, i8 %src2, <16 x i8> %a, <16 x i8> %b) {
361 ; CHECK-LABEL: vcmp_sle_v16i8:
362 ; CHECK: @ %bb.0: @ %entry
363 ; CHECK-NEXT: vcmp.s8 le, q0, r0
364 ; CHECK-NEXT: vpsel q0, q1, q2
367 %i = insertelement <16 x i8> undef, i8 %src2, i32 0
368 %sp = shufflevector <16 x i8> %i, <16 x i8> undef, <16 x i32> zeroinitializer
369 %c = icmp sle <16 x i8> %src, %sp
370 %s = select <16 x i1> %c, <16 x i8> %a, <16 x i8> %b
374 define arm_aapcs_vfpcc <16 x i8> @vcmp_ugt_v16i8(<16 x i8> %src, i8 %src2, <16 x i8> %a, <16 x i8> %b) {
375 ; CHECK-LABEL: vcmp_ugt_v16i8:
376 ; CHECK: @ %bb.0: @ %entry
377 ; CHECK-NEXT: vcmp.u8 hi, q0, r0
378 ; CHECK-NEXT: vpsel q0, q1, q2
381 %i = insertelement <16 x i8> undef, i8 %src2, i32 0
382 %sp = shufflevector <16 x i8> %i, <16 x i8> undef, <16 x i32> zeroinitializer
383 %c = icmp ugt <16 x i8> %src, %sp
384 %s = select <16 x i1> %c, <16 x i8> %a, <16 x i8> %b
388 define arm_aapcs_vfpcc <16 x i8> @vcmp_uge_v16i8(<16 x i8> %src, i8 %src2, <16 x i8> %a, <16 x i8> %b) {
389 ; CHECK-LABEL: vcmp_uge_v16i8:
390 ; CHECK: @ %bb.0: @ %entry
391 ; CHECK-NEXT: vcmp.u8 cs, q0, r0
392 ; CHECK-NEXT: vpsel q0, q1, q2
395 %i = insertelement <16 x i8> undef, i8 %src2, i32 0
396 %sp = shufflevector <16 x i8> %i, <16 x i8> undef, <16 x i32> zeroinitializer
397 %c = icmp uge <16 x i8> %src, %sp
398 %s = select <16 x i1> %c, <16 x i8> %a, <16 x i8> %b
402 define arm_aapcs_vfpcc <16 x i8> @vcmp_ult_v16i8(<16 x i8> %src, i8 %src2, <16 x i8> %a, <16 x i8> %b) {
403 ; CHECK-LABEL: vcmp_ult_v16i8:
404 ; CHECK: @ %bb.0: @ %entry
405 ; CHECK-NEXT: vdup.8 q3, r0
406 ; CHECK-NEXT: vcmp.u8 hi, q3, q0
407 ; CHECK-NEXT: vpsel q0, q1, q2
410 %i = insertelement <16 x i8> undef, i8 %src2, i32 0
411 %sp = shufflevector <16 x i8> %i, <16 x i8> undef, <16 x i32> zeroinitializer
412 %c = icmp ult <16 x i8> %src, %sp
413 %s = select <16 x i1> %c, <16 x i8> %a, <16 x i8> %b
417 define arm_aapcs_vfpcc <16 x i8> @vcmp_ule_v16i8(<16 x i8> %src, i8 %src2, <16 x i8> %a, <16 x i8> %b) {
418 ; CHECK-LABEL: vcmp_ule_v16i8:
419 ; CHECK: @ %bb.0: @ %entry
420 ; CHECK-NEXT: vdup.8 q3, r0
421 ; CHECK-NEXT: vcmp.u8 cs, q3, q0
422 ; CHECK-NEXT: vpsel q0, q1, q2
425 %i = insertelement <16 x i8> undef, i8 %src2, i32 0
426 %sp = shufflevector <16 x i8> %i, <16 x i8> undef, <16 x i32> zeroinitializer
427 %c = icmp ule <16 x i8> %src, %sp
428 %s = select <16 x i1> %c, <16 x i8> %a, <16 x i8> %b
433 define arm_aapcs_vfpcc <2 x i64> @vcmp_eq_v2i64(<2 x i64> %src, i64 %src2, <2 x i64> %a, <2 x i64> %b) {
434 ; CHECK-LABEL: vcmp_eq_v2i64:
435 ; CHECK: @ %bb.0: @ %entry
436 ; CHECK-NEXT: vmov r2, r3, d1
437 ; CHECK-NEXT: eors r3, r1
438 ; CHECK-NEXT: eors r2, r0
439 ; CHECK-NEXT: orrs r2, r3
440 ; CHECK-NEXT: vmov r12, r3, d0
441 ; CHECK-NEXT: cset r2, eq
442 ; CHECK-NEXT: cmp r2, #0
443 ; CHECK-NEXT: csetm r2, ne
444 ; CHECK-NEXT: eors r1, r3
445 ; CHECK-NEXT: eor.w r0, r0, r12
446 ; CHECK-NEXT: orrs r0, r1
447 ; CHECK-NEXT: cset r0, eq
448 ; CHECK-NEXT: cmp r0, #0
449 ; CHECK-NEXT: csetm r0, ne
450 ; CHECK-NEXT: vmov q0[2], q0[0], r0, r2
451 ; CHECK-NEXT: vmov q0[3], q0[1], r0, r2
452 ; CHECK-NEXT: vbic q2, q2, q0
453 ; CHECK-NEXT: vand q0, q1, q0
454 ; CHECK-NEXT: vorr q0, q0, q2
457 %i = insertelement <2 x i64> undef, i64 %src2, i32 0
458 %sp = shufflevector <2 x i64> %i, <2 x i64> undef, <2 x i32> zeroinitializer
459 %c = icmp eq <2 x i64> %src, %sp
460 %s = select <2 x i1> %c, <2 x i64> %a, <2 x i64> %b
464 define arm_aapcs_vfpcc <2 x i32> @vcmp_eq_v2i32(<2 x i64> %src, i64 %src2, <2 x i32> %a, <2 x i32> %b) {
465 ; CHECK-LABEL: vcmp_eq_v2i32:
466 ; CHECK: @ %bb.0: @ %entry
467 ; CHECK-NEXT: vmov r2, r3, d1
468 ; CHECK-NEXT: eors r3, r1
469 ; CHECK-NEXT: eors r2, r0
470 ; CHECK-NEXT: orrs r2, r3
471 ; CHECK-NEXT: vmov r12, r3, d0
472 ; CHECK-NEXT: cset r2, eq
473 ; CHECK-NEXT: cmp r2, #0
474 ; CHECK-NEXT: csetm r2, ne
475 ; CHECK-NEXT: eors r1, r3
476 ; CHECK-NEXT: eor.w r0, r0, r12
477 ; CHECK-NEXT: orrs r0, r1
478 ; CHECK-NEXT: cset r0, eq
479 ; CHECK-NEXT: cmp r0, #0
480 ; CHECK-NEXT: csetm r0, ne
481 ; CHECK-NEXT: vmov q0[2], q0[0], r0, r2
482 ; CHECK-NEXT: vmov q0[3], q0[1], r0, r2
483 ; CHECK-NEXT: vbic q2, q2, q0
484 ; CHECK-NEXT: vand q0, q1, q0
485 ; CHECK-NEXT: vorr q0, q0, q2
488 %i = insertelement <2 x i64> undef, i64 %src2, i32 0
489 %sp = shufflevector <2 x i64> %i, <2 x i64> undef, <2 x i32> zeroinitializer
490 %c = icmp eq <2 x i64> %src, %sp
491 %s = select <2 x i1> %c, <2 x i32> %a, <2 x i32> %b
495 define arm_aapcs_vfpcc <2 x i32> @vcmp_multi_v2i32(<2 x i64> %a, <2 x i32> %b, <2 x i32> %c) {
496 ; CHECK-LABEL: vcmp_multi_v2i32:
498 ; CHECK-NEXT: .save {r4, lr}
499 ; CHECK-NEXT: push {r4, lr}
500 ; CHECK-NEXT: .vsave {d8, d9}
501 ; CHECK-NEXT: vpush {d8, d9}
502 ; CHECK-NEXT: vmov r0, r1, d1
503 ; CHECK-NEXT: movs r3, #0
504 ; CHECK-NEXT: orrs r0, r1
505 ; CHECK-NEXT: vmov r1, r2, d0
506 ; CHECK-NEXT: cset r0, eq
507 ; CHECK-NEXT: cmp r0, #0
508 ; CHECK-NEXT: csetm r0, ne
509 ; CHECK-NEXT: orrs r1, r2
510 ; CHECK-NEXT: vmov r2, s10
511 ; CHECK-NEXT: cset r1, eq
512 ; CHECK-NEXT: cmp r1, #0
513 ; CHECK-NEXT: csetm r1, ne
514 ; CHECK-NEXT: vmov q0[2], q0[0], r1, r0
515 ; CHECK-NEXT: vmov q0[3], q0[1], r1, r0
516 ; CHECK-NEXT: vbic q0, q2, q0
517 ; CHECK-NEXT: vmov r0, s2
518 ; CHECK-NEXT: subs r1, r0, r2
519 ; CHECK-NEXT: asr.w r12, r0, #31
520 ; CHECK-NEXT: sbcs.w r1, r12, r2, asr #31
521 ; CHECK-NEXT: mov.w r1, #0
522 ; CHECK-NEXT: vmov r2, s0
524 ; CHECK-NEXT: movlt r1, #1
525 ; CHECK-NEXT: cmp r1, #0
526 ; CHECK-NEXT: vmov r1, s8
527 ; CHECK-NEXT: csetm lr, ne
528 ; CHECK-NEXT: asr.w r12, r2, #31
529 ; CHECK-NEXT: subs r4, r2, r1
530 ; CHECK-NEXT: sbcs.w r1, r12, r1, asr #31
532 ; CHECK-NEXT: movlt r3, #1
533 ; CHECK-NEXT: cmp r3, #0
534 ; CHECK-NEXT: csetm r1, ne
535 ; CHECK-NEXT: cmp r0, #0
536 ; CHECK-NEXT: cset r0, ne
537 ; CHECK-NEXT: vmov q3[2], q3[0], r1, lr
538 ; CHECK-NEXT: cmp r0, #0
539 ; CHECK-NEXT: vmov q3[3], q3[1], r1, lr
540 ; CHECK-NEXT: csetm r0, ne
541 ; CHECK-NEXT: cmp r2, #0
542 ; CHECK-NEXT: cset r1, ne
543 ; CHECK-NEXT: cmp r1, #0
544 ; CHECK-NEXT: csetm r1, ne
545 ; CHECK-NEXT: vmov q4[2], q4[0], r1, r0
546 ; CHECK-NEXT: vmov q4[3], q4[1], r1, r0
547 ; CHECK-NEXT: vmov r0, s6
548 ; CHECK-NEXT: vmov r1, s4
549 ; CHECK-NEXT: cmp r0, #0
550 ; CHECK-NEXT: cset r0, ne
551 ; CHECK-NEXT: cmp r0, #0
552 ; CHECK-NEXT: csetm r0, ne
553 ; CHECK-NEXT: cmp r1, #0
554 ; CHECK-NEXT: cset r1, ne
555 ; CHECK-NEXT: cmp r1, #0
556 ; CHECK-NEXT: csetm r1, ne
557 ; CHECK-NEXT: vmov q1[2], q1[0], r1, r0
558 ; CHECK-NEXT: vmov q1[3], q1[1], r1, r0
559 ; CHECK-NEXT: vand q1, q1, q4
560 ; CHECK-NEXT: vand q1, q3, q1
561 ; CHECK-NEXT: vbic q0, q0, q1
562 ; CHECK-NEXT: vand q1, q2, q1
563 ; CHECK-NEXT: vorr q0, q1, q0
564 ; CHECK-NEXT: vpop {d8, d9}
565 ; CHECK-NEXT: pop {r4, pc}
566 %a4 = icmp eq <2 x i64> %a, zeroinitializer
567 %a5 = select <2 x i1> %a4, <2 x i32> zeroinitializer, <2 x i32> %c
568 %a6 = icmp ne <2 x i32> %b, zeroinitializer
569 %a7 = icmp slt <2 x i32> %a5, %c
570 %a8 = icmp ne <2 x i32> %a5, zeroinitializer
571 %a9 = and <2 x i1> %a6, %a8
572 %a10 = and <2 x i1> %a7, %a9
573 %a11 = select <2 x i1> %a10, <2 x i32> %c, <2 x i32> %a5
579 define arm_aapcs_vfpcc <4 x i32> @vcmp_r_eq_v4i32(<4 x i32> %src, i32 %src2, <4 x i32> %a, <4 x i32> %b) {
580 ; CHECK-LABEL: vcmp_r_eq_v4i32:
581 ; CHECK: @ %bb.0: @ %entry
582 ; CHECK-NEXT: vcmp.i32 eq, q0, r0
583 ; CHECK-NEXT: vpsel q0, q1, q2
586 %i = insertelement <4 x i32> undef, i32 %src2, i32 0
587 %sp = shufflevector <4 x i32> %i, <4 x i32> undef, <4 x i32> zeroinitializer
588 %c = icmp eq <4 x i32> %sp, %src
589 %s = select <4 x i1> %c, <4 x i32> %a, <4 x i32> %b
593 define arm_aapcs_vfpcc <4 x i32> @vcmp_r_ne_v4i32(<4 x i32> %src, i32 %src2, <4 x i32> %a, <4 x i32> %b) {
594 ; CHECK-LABEL: vcmp_r_ne_v4i32:
595 ; CHECK: @ %bb.0: @ %entry
596 ; CHECK-NEXT: vcmp.i32 ne, q0, r0
597 ; CHECK-NEXT: vpsel q0, q1, q2
600 %i = insertelement <4 x i32> undef, i32 %src2, i32 0
601 %sp = shufflevector <4 x i32> %i, <4 x i32> undef, <4 x i32> zeroinitializer
602 %c = icmp ne <4 x i32> %sp, %src
603 %s = select <4 x i1> %c, <4 x i32> %a, <4 x i32> %b
607 define arm_aapcs_vfpcc <4 x i32> @vcmp_r_sgt_v4i32(<4 x i32> %src, i32 %src2, <4 x i32> %a, <4 x i32> %b) {
608 ; CHECK-LABEL: vcmp_r_sgt_v4i32:
609 ; CHECK: @ %bb.0: @ %entry
610 ; CHECK-NEXT: vcmp.s32 lt, q0, r0
611 ; CHECK-NEXT: vpsel q0, q1, q2
614 %i = insertelement <4 x i32> undef, i32 %src2, i32 0
615 %sp = shufflevector <4 x i32> %i, <4 x i32> undef, <4 x i32> zeroinitializer
616 %c = icmp sgt <4 x i32> %sp, %src
617 %s = select <4 x i1> %c, <4 x i32> %a, <4 x i32> %b
621 define arm_aapcs_vfpcc <4 x i32> @vcmp_r_sge_v4i32(<4 x i32> %src, i32 %src2, <4 x i32> %a, <4 x i32> %b) {
622 ; CHECK-LABEL: vcmp_r_sge_v4i32:
623 ; CHECK: @ %bb.0: @ %entry
624 ; CHECK-NEXT: vcmp.s32 le, q0, r0
625 ; CHECK-NEXT: vpsel q0, q1, q2
628 %i = insertelement <4 x i32> undef, i32 %src2, i32 0
629 %sp = shufflevector <4 x i32> %i, <4 x i32> undef, <4 x i32> zeroinitializer
630 %c = icmp sge <4 x i32> %sp, %src
631 %s = select <4 x i1> %c, <4 x i32> %a, <4 x i32> %b
635 define arm_aapcs_vfpcc <4 x i32> @vcmp_r_slt_v4i32(<4 x i32> %src, i32 %src2, <4 x i32> %a, <4 x i32> %b) {
636 ; CHECK-LABEL: vcmp_r_slt_v4i32:
637 ; CHECK: @ %bb.0: @ %entry
638 ; CHECK-NEXT: vcmp.s32 gt, q0, r0
639 ; CHECK-NEXT: vpsel q0, q1, q2
642 %i = insertelement <4 x i32> undef, i32 %src2, i32 0
643 %sp = shufflevector <4 x i32> %i, <4 x i32> undef, <4 x i32> zeroinitializer
644 %c = icmp slt <4 x i32> %sp, %src
645 %s = select <4 x i1> %c, <4 x i32> %a, <4 x i32> %b
649 define arm_aapcs_vfpcc <4 x i32> @vcmp_r_sle_v4i32(<4 x i32> %src, i32 %src2, <4 x i32> %a, <4 x i32> %b) {
650 ; CHECK-LABEL: vcmp_r_sle_v4i32:
651 ; CHECK: @ %bb.0: @ %entry
652 ; CHECK-NEXT: vcmp.s32 ge, q0, r0
653 ; CHECK-NEXT: vpsel q0, q1, q2
656 %i = insertelement <4 x i32> undef, i32 %src2, i32 0
657 %sp = shufflevector <4 x i32> %i, <4 x i32> undef, <4 x i32> zeroinitializer
658 %c = icmp sle <4 x i32> %sp, %src
659 %s = select <4 x i1> %c, <4 x i32> %a, <4 x i32> %b
663 define arm_aapcs_vfpcc <4 x i32> @vcmp_r_ugt_v4i32(<4 x i32> %src, i32 %src2, <4 x i32> %a, <4 x i32> %b) {
664 ; CHECK-LABEL: vcmp_r_ugt_v4i32:
665 ; CHECK: @ %bb.0: @ %entry
666 ; CHECK-NEXT: vdup.32 q3, r0
667 ; CHECK-NEXT: vcmp.u32 hi, q3, q0
668 ; CHECK-NEXT: vpsel q0, q1, q2
671 %i = insertelement <4 x i32> undef, i32 %src2, i32 0
672 %sp = shufflevector <4 x i32> %i, <4 x i32> undef, <4 x i32> zeroinitializer
673 %c = icmp ugt <4 x i32> %sp, %src
674 %s = select <4 x i1> %c, <4 x i32> %a, <4 x i32> %b
678 define arm_aapcs_vfpcc <4 x i32> @vcmp_r_uge_v4i32(<4 x i32> %src, i32 %src2, <4 x i32> %a, <4 x i32> %b) {
679 ; CHECK-LABEL: vcmp_r_uge_v4i32:
680 ; CHECK: @ %bb.0: @ %entry
681 ; CHECK-NEXT: vdup.32 q3, r0
682 ; CHECK-NEXT: vcmp.u32 cs, q3, q0
683 ; CHECK-NEXT: vpsel q0, q1, q2
686 %i = insertelement <4 x i32> undef, i32 %src2, i32 0
687 %sp = shufflevector <4 x i32> %i, <4 x i32> undef, <4 x i32> zeroinitializer
688 %c = icmp uge <4 x i32> %sp, %src
689 %s = select <4 x i1> %c, <4 x i32> %a, <4 x i32> %b
693 define arm_aapcs_vfpcc <4 x i32> @vcmp_r_ult_v4i32(<4 x i32> %src, i32 %src2, <4 x i32> %a, <4 x i32> %b) {
694 ; CHECK-LABEL: vcmp_r_ult_v4i32:
695 ; CHECK: @ %bb.0: @ %entry
696 ; CHECK-NEXT: vcmp.u32 hi, q0, r0
697 ; CHECK-NEXT: vpsel q0, q1, q2
700 %i = insertelement <4 x i32> undef, i32 %src2, i32 0
701 %sp = shufflevector <4 x i32> %i, <4 x i32> undef, <4 x i32> zeroinitializer
702 %c = icmp ult <4 x i32> %sp, %src
703 %s = select <4 x i1> %c, <4 x i32> %a, <4 x i32> %b
707 define arm_aapcs_vfpcc <4 x i32> @vcmp_r_ule_v4i32(<4 x i32> %src, i32 %src2, <4 x i32> %a, <4 x i32> %b) {
708 ; CHECK-LABEL: vcmp_r_ule_v4i32:
709 ; CHECK: @ %bb.0: @ %entry
710 ; CHECK-NEXT: vcmp.u32 cs, q0, r0
711 ; CHECK-NEXT: vpsel q0, q1, q2
714 %i = insertelement <4 x i32> undef, i32 %src2, i32 0
715 %sp = shufflevector <4 x i32> %i, <4 x i32> undef, <4 x i32> zeroinitializer
716 %c = icmp ule <4 x i32> %sp, %src
717 %s = select <4 x i1> %c, <4 x i32> %a, <4 x i32> %b
722 define arm_aapcs_vfpcc <8 x i16> @vcmp_r_eq_v8i16(<8 x i16> %src, i16 %src2, <8 x i16> %a, <8 x i16> %b) {
723 ; CHECK-LABEL: vcmp_r_eq_v8i16:
724 ; CHECK: @ %bb.0: @ %entry
725 ; CHECK-NEXT: vcmp.i16 eq, q0, r0
726 ; CHECK-NEXT: vpsel q0, q1, q2
729 %i = insertelement <8 x i16> undef, i16 %src2, i32 0
730 %sp = shufflevector <8 x i16> %i, <8 x i16> undef, <8 x i32> zeroinitializer
731 %c = icmp eq <8 x i16> %sp, %src
732 %s = select <8 x i1> %c, <8 x i16> %a, <8 x i16> %b
736 define arm_aapcs_vfpcc <8 x i16> @vcmp_r_ne_v8i16(<8 x i16> %src, i16 %src2, <8 x i16> %a, <8 x i16> %b) {
737 ; CHECK-LABEL: vcmp_r_ne_v8i16:
738 ; CHECK: @ %bb.0: @ %entry
739 ; CHECK-NEXT: vcmp.i16 ne, q0, r0
740 ; CHECK-NEXT: vpsel q0, q1, q2
743 %i = insertelement <8 x i16> undef, i16 %src2, i32 0
744 %sp = shufflevector <8 x i16> %i, <8 x i16> undef, <8 x i32> zeroinitializer
745 %c = icmp ne <8 x i16> %sp, %src
746 %s = select <8 x i1> %c, <8 x i16> %a, <8 x i16> %b
750 define arm_aapcs_vfpcc <8 x i16> @vcmp_r_sgt_v8i16(<8 x i16> %src, i16 %src2, <8 x i16> %a, <8 x i16> %b) {
751 ; CHECK-LABEL: vcmp_r_sgt_v8i16:
752 ; CHECK: @ %bb.0: @ %entry
753 ; CHECK-NEXT: vcmp.s16 lt, q0, r0
754 ; CHECK-NEXT: vpsel q0, q1, q2
757 %i = insertelement <8 x i16> undef, i16 %src2, i32 0
758 %sp = shufflevector <8 x i16> %i, <8 x i16> undef, <8 x i32> zeroinitializer
759 %c = icmp sgt <8 x i16> %sp, %src
760 %s = select <8 x i1> %c, <8 x i16> %a, <8 x i16> %b
764 define arm_aapcs_vfpcc <8 x i16> @vcmp_r_sge_v8i16(<8 x i16> %src, i16 %src2, <8 x i16> %a, <8 x i16> %b) {
765 ; CHECK-LABEL: vcmp_r_sge_v8i16:
766 ; CHECK: @ %bb.0: @ %entry
767 ; CHECK-NEXT: vcmp.s16 le, q0, r0
768 ; CHECK-NEXT: vpsel q0, q1, q2
771 %i = insertelement <8 x i16> undef, i16 %src2, i32 0
772 %sp = shufflevector <8 x i16> %i, <8 x i16> undef, <8 x i32> zeroinitializer
773 %c = icmp sge <8 x i16> %sp, %src
774 %s = select <8 x i1> %c, <8 x i16> %a, <8 x i16> %b
778 define arm_aapcs_vfpcc <8 x i16> @vcmp_r_slt_v8i16(<8 x i16> %src, i16 %src2, <8 x i16> %a, <8 x i16> %b) {
779 ; CHECK-LABEL: vcmp_r_slt_v8i16:
780 ; CHECK: @ %bb.0: @ %entry
781 ; CHECK-NEXT: vcmp.s16 gt, q0, r0
782 ; CHECK-NEXT: vpsel q0, q1, q2
785 %i = insertelement <8 x i16> undef, i16 %src2, i32 0
786 %sp = shufflevector <8 x i16> %i, <8 x i16> undef, <8 x i32> zeroinitializer
787 %c = icmp slt <8 x i16> %sp, %src
788 %s = select <8 x i1> %c, <8 x i16> %a, <8 x i16> %b
792 define arm_aapcs_vfpcc <8 x i16> @vcmp_r_sle_v8i16(<8 x i16> %src, i16 %src2, <8 x i16> %a, <8 x i16> %b) {
793 ; CHECK-LABEL: vcmp_r_sle_v8i16:
794 ; CHECK: @ %bb.0: @ %entry
795 ; CHECK-NEXT: vcmp.s16 ge, q0, r0
796 ; CHECK-NEXT: vpsel q0, q1, q2
799 %i = insertelement <8 x i16> undef, i16 %src2, i32 0
800 %sp = shufflevector <8 x i16> %i, <8 x i16> undef, <8 x i32> zeroinitializer
801 %c = icmp sle <8 x i16> %sp, %src
802 %s = select <8 x i1> %c, <8 x i16> %a, <8 x i16> %b
806 define arm_aapcs_vfpcc <8 x i16> @vcmp_r_ugt_v8i16(<8 x i16> %src, i16 %src2, <8 x i16> %a, <8 x i16> %b) {
807 ; CHECK-LABEL: vcmp_r_ugt_v8i16:
808 ; CHECK: @ %bb.0: @ %entry
809 ; CHECK-NEXT: vdup.16 q3, r0
810 ; CHECK-NEXT: vcmp.u16 hi, q3, q0
811 ; CHECK-NEXT: vpsel q0, q1, q2
814 %i = insertelement <8 x i16> undef, i16 %src2, i32 0
815 %sp = shufflevector <8 x i16> %i, <8 x i16> undef, <8 x i32> zeroinitializer
816 %c = icmp ugt <8 x i16> %sp, %src
817 %s = select <8 x i1> %c, <8 x i16> %a, <8 x i16> %b
821 define arm_aapcs_vfpcc <8 x i16> @vcmp_r_uge_v8i16(<8 x i16> %src, i16 %src2, <8 x i16> %a, <8 x i16> %b) {
822 ; CHECK-LABEL: vcmp_r_uge_v8i16:
823 ; CHECK: @ %bb.0: @ %entry
824 ; CHECK-NEXT: vdup.16 q3, r0
825 ; CHECK-NEXT: vcmp.u16 cs, q3, q0
826 ; CHECK-NEXT: vpsel q0, q1, q2
829 %i = insertelement <8 x i16> undef, i16 %src2, i32 0
830 %sp = shufflevector <8 x i16> %i, <8 x i16> undef, <8 x i32> zeroinitializer
831 %c = icmp uge <8 x i16> %sp, %src
832 %s = select <8 x i1> %c, <8 x i16> %a, <8 x i16> %b
836 define arm_aapcs_vfpcc <8 x i16> @vcmp_r_ult_v8i16(<8 x i16> %src, i16 %src2, <8 x i16> %a, <8 x i16> %b) {
837 ; CHECK-LABEL: vcmp_r_ult_v8i16:
838 ; CHECK: @ %bb.0: @ %entry
839 ; CHECK-NEXT: vcmp.u16 hi, q0, r0
840 ; CHECK-NEXT: vpsel q0, q1, q2
843 %i = insertelement <8 x i16> undef, i16 %src2, i32 0
844 %sp = shufflevector <8 x i16> %i, <8 x i16> undef, <8 x i32> zeroinitializer
845 %c = icmp ult <8 x i16> %sp, %src
846 %s = select <8 x i1> %c, <8 x i16> %a, <8 x i16> %b
850 define arm_aapcs_vfpcc <8 x i16> @vcmp_r_ule_v8i16(<8 x i16> %src, i16 %src2, <8 x i16> %a, <8 x i16> %b) {
851 ; CHECK-LABEL: vcmp_r_ule_v8i16:
852 ; CHECK: @ %bb.0: @ %entry
853 ; CHECK-NEXT: vcmp.u16 cs, q0, r0
854 ; CHECK-NEXT: vpsel q0, q1, q2
857 %i = insertelement <8 x i16> undef, i16 %src2, i32 0
858 %sp = shufflevector <8 x i16> %i, <8 x i16> undef, <8 x i32> zeroinitializer
859 %c = icmp ule <8 x i16> %sp, %src
860 %s = select <8 x i1> %c, <8 x i16> %a, <8 x i16> %b
865 define arm_aapcs_vfpcc <16 x i8> @vcmp_r_eq_v16i8(<16 x i8> %src, i8 %src2, <16 x i8> %a, <16 x i8> %b) {
866 ; CHECK-LABEL: vcmp_r_eq_v16i8:
867 ; CHECK: @ %bb.0: @ %entry
868 ; CHECK-NEXT: vcmp.i8 eq, q0, r0
869 ; CHECK-NEXT: vpsel q0, q1, q2
872 %i = insertelement <16 x i8> undef, i8 %src2, i32 0
873 %sp = shufflevector <16 x i8> %i, <16 x i8> undef, <16 x i32> zeroinitializer
874 %c = icmp eq <16 x i8> %sp, %src
875 %s = select <16 x i1> %c, <16 x i8> %a, <16 x i8> %b
879 define arm_aapcs_vfpcc <16 x i8> @vcmp_r_ne_v16i8(<16 x i8> %src, i8 %src2, <16 x i8> %a, <16 x i8> %b) {
880 ; CHECK-LABEL: vcmp_r_ne_v16i8:
881 ; CHECK: @ %bb.0: @ %entry
882 ; CHECK-NEXT: vcmp.i8 ne, q0, r0
883 ; CHECK-NEXT: vpsel q0, q1, q2
886 %i = insertelement <16 x i8> undef, i8 %src2, i32 0
887 %sp = shufflevector <16 x i8> %i, <16 x i8> undef, <16 x i32> zeroinitializer
888 %c = icmp ne <16 x i8> %sp, %src
889 %s = select <16 x i1> %c, <16 x i8> %a, <16 x i8> %b
893 define arm_aapcs_vfpcc <16 x i8> @vcmp_r_sgt_v16i8(<16 x i8> %src, i8 %src2, <16 x i8> %a, <16 x i8> %b) {
894 ; CHECK-LABEL: vcmp_r_sgt_v16i8:
895 ; CHECK: @ %bb.0: @ %entry
896 ; CHECK-NEXT: vcmp.s8 lt, q0, r0
897 ; CHECK-NEXT: vpsel q0, q1, q2
900 %i = insertelement <16 x i8> undef, i8 %src2, i32 0
901 %sp = shufflevector <16 x i8> %i, <16 x i8> undef, <16 x i32> zeroinitializer
902 %c = icmp sgt <16 x i8> %sp, %src
903 %s = select <16 x i1> %c, <16 x i8> %a, <16 x i8> %b
907 define arm_aapcs_vfpcc <16 x i8> @vcmp_r_sge_v16i8(<16 x i8> %src, i8 %src2, <16 x i8> %a, <16 x i8> %b) {
908 ; CHECK-LABEL: vcmp_r_sge_v16i8:
909 ; CHECK: @ %bb.0: @ %entry
910 ; CHECK-NEXT: vcmp.s8 le, q0, r0
911 ; CHECK-NEXT: vpsel q0, q1, q2
914 %i = insertelement <16 x i8> undef, i8 %src2, i32 0
915 %sp = shufflevector <16 x i8> %i, <16 x i8> undef, <16 x i32> zeroinitializer
916 %c = icmp sge <16 x i8> %sp, %src
917 %s = select <16 x i1> %c, <16 x i8> %a, <16 x i8> %b
921 define arm_aapcs_vfpcc <16 x i8> @vcmp_r_slt_v16i8(<16 x i8> %src, i8 %src2, <16 x i8> %a, <16 x i8> %b) {
922 ; CHECK-LABEL: vcmp_r_slt_v16i8:
923 ; CHECK: @ %bb.0: @ %entry
924 ; CHECK-NEXT: vcmp.s8 gt, q0, r0
925 ; CHECK-NEXT: vpsel q0, q1, q2
928 %i = insertelement <16 x i8> undef, i8 %src2, i32 0
929 %sp = shufflevector <16 x i8> %i, <16 x i8> undef, <16 x i32> zeroinitializer
930 %c = icmp slt <16 x i8> %sp, %src
931 %s = select <16 x i1> %c, <16 x i8> %a, <16 x i8> %b
935 define arm_aapcs_vfpcc <16 x i8> @vcmp_r_sle_v16i8(<16 x i8> %src, i8 %src2, <16 x i8> %a, <16 x i8> %b) {
936 ; CHECK-LABEL: vcmp_r_sle_v16i8:
937 ; CHECK: @ %bb.0: @ %entry
938 ; CHECK-NEXT: vcmp.s8 ge, q0, r0
939 ; CHECK-NEXT: vpsel q0, q1, q2
942 %i = insertelement <16 x i8> undef, i8 %src2, i32 0
943 %sp = shufflevector <16 x i8> %i, <16 x i8> undef, <16 x i32> zeroinitializer
944 %c = icmp sle <16 x i8> %sp, %src
945 %s = select <16 x i1> %c, <16 x i8> %a, <16 x i8> %b
949 define arm_aapcs_vfpcc <16 x i8> @vcmp_r_ugt_v16i8(<16 x i8> %src, i8 %src2, <16 x i8> %a, <16 x i8> %b) {
950 ; CHECK-LABEL: vcmp_r_ugt_v16i8:
951 ; CHECK: @ %bb.0: @ %entry
952 ; CHECK-NEXT: vdup.8 q3, r0
953 ; CHECK-NEXT: vcmp.u8 hi, q3, q0
954 ; CHECK-NEXT: vpsel q0, q1, q2
957 %i = insertelement <16 x i8> undef, i8 %src2, i32 0
958 %sp = shufflevector <16 x i8> %i, <16 x i8> undef, <16 x i32> zeroinitializer
959 %c = icmp ugt <16 x i8> %sp, %src
960 %s = select <16 x i1> %c, <16 x i8> %a, <16 x i8> %b
964 define arm_aapcs_vfpcc <16 x i8> @vcmp_r_uge_v16i8(<16 x i8> %src, i8 %src2, <16 x i8> %a, <16 x i8> %b) {
965 ; CHECK-LABEL: vcmp_r_uge_v16i8:
966 ; CHECK: @ %bb.0: @ %entry
967 ; CHECK-NEXT: vdup.8 q3, r0
968 ; CHECK-NEXT: vcmp.u8 cs, q3, q0
969 ; CHECK-NEXT: vpsel q0, q1, q2
972 %i = insertelement <16 x i8> undef, i8 %src2, i32 0
973 %sp = shufflevector <16 x i8> %i, <16 x i8> undef, <16 x i32> zeroinitializer
974 %c = icmp uge <16 x i8> %sp, %src
975 %s = select <16 x i1> %c, <16 x i8> %a, <16 x i8> %b
979 define arm_aapcs_vfpcc <16 x i8> @vcmp_r_ult_v16i8(<16 x i8> %src, i8 %src2, <16 x i8> %a, <16 x i8> %b) {
980 ; CHECK-LABEL: vcmp_r_ult_v16i8:
981 ; CHECK: @ %bb.0: @ %entry
982 ; CHECK-NEXT: vcmp.u8 hi, q0, r0
983 ; CHECK-NEXT: vpsel q0, q1, q2
986 %i = insertelement <16 x i8> undef, i8 %src2, i32 0
987 %sp = shufflevector <16 x i8> %i, <16 x i8> undef, <16 x i32> zeroinitializer
988 %c = icmp ult <16 x i8> %sp, %src
989 %s = select <16 x i1> %c, <16 x i8> %a, <16 x i8> %b
993 define arm_aapcs_vfpcc <16 x i8> @vcmp_r_ule_v16i8(<16 x i8> %src, i8 %src2, <16 x i8> %a, <16 x i8> %b) {
994 ; CHECK-LABEL: vcmp_r_ule_v16i8:
995 ; CHECK: @ %bb.0: @ %entry
996 ; CHECK-NEXT: vcmp.u8 cs, q0, r0
997 ; CHECK-NEXT: vpsel q0, q1, q2
1000 %i = insertelement <16 x i8> undef, i8 %src2, i32 0
1001 %sp = shufflevector <16 x i8> %i, <16 x i8> undef, <16 x i32> zeroinitializer
1002 %c = icmp ule <16 x i8> %sp, %src
1003 %s = select <16 x i1> %c, <16 x i8> %a, <16 x i8> %b
1008 define arm_aapcs_vfpcc <2 x i64> @vcmp_r_eq_v2i64(<2 x i64> %src, i64 %src2, <2 x i64> %a, <2 x i64> %b) {
1009 ; CHECK-LABEL: vcmp_r_eq_v2i64:
1010 ; CHECK: @ %bb.0: @ %entry
1011 ; CHECK-NEXT: vmov r2, r3, d1
1012 ; CHECK-NEXT: eors r3, r1
1013 ; CHECK-NEXT: eors r2, r0
1014 ; CHECK-NEXT: orrs r2, r3
1015 ; CHECK-NEXT: vmov r12, r3, d0
1016 ; CHECK-NEXT: cset r2, eq
1017 ; CHECK-NEXT: cmp r2, #0
1018 ; CHECK-NEXT: csetm r2, ne
1019 ; CHECK-NEXT: eors r1, r3
1020 ; CHECK-NEXT: eor.w r0, r0, r12
1021 ; CHECK-NEXT: orrs r0, r1
1022 ; CHECK-NEXT: cset r0, eq
1023 ; CHECK-NEXT: cmp r0, #0
1024 ; CHECK-NEXT: csetm r0, ne
1025 ; CHECK-NEXT: vmov q0[2], q0[0], r0, r2
1026 ; CHECK-NEXT: vmov q0[3], q0[1], r0, r2
1027 ; CHECK-NEXT: vbic q2, q2, q0
1028 ; CHECK-NEXT: vand q0, q1, q0
1029 ; CHECK-NEXT: vorr q0, q0, q2
1032 %i = insertelement <2 x i64> undef, i64 %src2, i32 0
1033 %sp = shufflevector <2 x i64> %i, <2 x i64> undef, <2 x i32> zeroinitializer
1034 %c = icmp eq <2 x i64> %sp, %src
1035 %s = select <2 x i1> %c, <2 x i64> %a, <2 x i64> %b
1039 define arm_aapcs_vfpcc <2 x i32> @vcmp_r_eq_v2i32(<2 x i64> %src, i64 %src2, <2 x i32> %a, <2 x i32> %b) {
1040 ; CHECK-LABEL: vcmp_r_eq_v2i32:
1041 ; CHECK: @ %bb.0: @ %entry
1042 ; CHECK-NEXT: vmov r2, r3, d1
1043 ; CHECK-NEXT: eors r3, r1
1044 ; CHECK-NEXT: eors r2, r0
1045 ; CHECK-NEXT: orrs r2, r3
1046 ; CHECK-NEXT: vmov r12, r3, d0
1047 ; CHECK-NEXT: cset r2, eq
1048 ; CHECK-NEXT: cmp r2, #0
1049 ; CHECK-NEXT: csetm r2, ne
1050 ; CHECK-NEXT: eors r1, r3
1051 ; CHECK-NEXT: eor.w r0, r0, r12
1052 ; CHECK-NEXT: orrs r0, r1
1053 ; CHECK-NEXT: cset r0, eq
1054 ; CHECK-NEXT: cmp r0, #0
1055 ; CHECK-NEXT: csetm r0, ne
1056 ; CHECK-NEXT: vmov q0[2], q0[0], r0, r2
1057 ; CHECK-NEXT: vmov q0[3], q0[1], r0, r2
1058 ; CHECK-NEXT: vbic q2, q2, q0
1059 ; CHECK-NEXT: vand q0, q1, q0
1060 ; CHECK-NEXT: vorr q0, q0, q2
1063 %i = insertelement <2 x i64> undef, i64 %src2, i32 0
1064 %sp = shufflevector <2 x i64> %i, <2 x i64> undef, <2 x i32> zeroinitializer
1065 %c = icmp eq <2 x i64> %sp, %src
1066 %s = select <2 x i1> %c, <2 x i32> %a, <2 x i32> %b
1070 define arm_aapcs_vfpcc <2 x i32> @vcmp_r_multi_v2i32(<2 x i64> %a, <2 x i32> %b, <2 x i32> %c) {
1071 ; CHECK-LABEL: vcmp_r_multi_v2i32:
1073 ; CHECK-NEXT: .save {r4, lr}
1074 ; CHECK-NEXT: push {r4, lr}
1075 ; CHECK-NEXT: .vsave {d8, d9}
1076 ; CHECK-NEXT: vpush {d8, d9}
1077 ; CHECK-NEXT: vmov r0, r1, d1
1078 ; CHECK-NEXT: movs r3, #0
1079 ; CHECK-NEXT: orrs r0, r1
1080 ; CHECK-NEXT: vmov r1, r2, d0
1081 ; CHECK-NEXT: cset r0, eq
1082 ; CHECK-NEXT: cmp r0, #0
1083 ; CHECK-NEXT: csetm r0, ne
1084 ; CHECK-NEXT: orrs r1, r2
1085 ; CHECK-NEXT: vmov r2, s10
1086 ; CHECK-NEXT: cset r1, eq
1087 ; CHECK-NEXT: cmp r1, #0
1088 ; CHECK-NEXT: csetm r1, ne
1089 ; CHECK-NEXT: vmov q0[2], q0[0], r1, r0
1090 ; CHECK-NEXT: vmov q0[3], q0[1], r1, r0
1091 ; CHECK-NEXT: vbic q0, q2, q0
1092 ; CHECK-NEXT: vmov r0, s2
1093 ; CHECK-NEXT: subs r1, r0, r2
1094 ; CHECK-NEXT: asr.w r12, r0, #31
1095 ; CHECK-NEXT: sbcs.w r1, r12, r2, asr #31
1096 ; CHECK-NEXT: mov.w r1, #0
1097 ; CHECK-NEXT: vmov r2, s0
1099 ; CHECK-NEXT: movlt r1, #1
1100 ; CHECK-NEXT: cmp r1, #0
1101 ; CHECK-NEXT: vmov r1, s8
1102 ; CHECK-NEXT: csetm lr, ne
1103 ; CHECK-NEXT: asr.w r12, r2, #31
1104 ; CHECK-NEXT: subs r4, r2, r1
1105 ; CHECK-NEXT: sbcs.w r1, r12, r1, asr #31
1107 ; CHECK-NEXT: movlt r3, #1
1108 ; CHECK-NEXT: cmp r3, #0
1109 ; CHECK-NEXT: csetm r1, ne
1110 ; CHECK-NEXT: cmp r0, #0
1111 ; CHECK-NEXT: cset r0, ne
1112 ; CHECK-NEXT: vmov q3[2], q3[0], r1, lr
1113 ; CHECK-NEXT: cmp r0, #0
1114 ; CHECK-NEXT: vmov q3[3], q3[1], r1, lr
1115 ; CHECK-NEXT: csetm r0, ne
1116 ; CHECK-NEXT: cmp r2, #0
1117 ; CHECK-NEXT: cset r1, ne
1118 ; CHECK-NEXT: cmp r1, #0
1119 ; CHECK-NEXT: csetm r1, ne
1120 ; CHECK-NEXT: vmov q4[2], q4[0], r1, r0
1121 ; CHECK-NEXT: vmov q4[3], q4[1], r1, r0
1122 ; CHECK-NEXT: vmov r0, s6
1123 ; CHECK-NEXT: vmov r1, s4
1124 ; CHECK-NEXT: cmp r0, #0
1125 ; CHECK-NEXT: cset r0, ne
1126 ; CHECK-NEXT: cmp r0, #0
1127 ; CHECK-NEXT: csetm r0, ne
1128 ; CHECK-NEXT: cmp r1, #0
1129 ; CHECK-NEXT: cset r1, ne
1130 ; CHECK-NEXT: cmp r1, #0
1131 ; CHECK-NEXT: csetm r1, ne
1132 ; CHECK-NEXT: vmov q1[2], q1[0], r1, r0
1133 ; CHECK-NEXT: vmov q1[3], q1[1], r1, r0
1134 ; CHECK-NEXT: vand q1, q1, q4
1135 ; CHECK-NEXT: vand q1, q3, q1
1136 ; CHECK-NEXT: vbic q0, q0, q1
1137 ; CHECK-NEXT: vand q1, q2, q1
1138 ; CHECK-NEXT: vorr q0, q1, q0
1139 ; CHECK-NEXT: vpop {d8, d9}
1140 ; CHECK-NEXT: pop {r4, pc}
1141 %a4 = icmp eq <2 x i64> %a, zeroinitializer
1142 %a5 = select <2 x i1> %a4, <2 x i32> zeroinitializer, <2 x i32> %c
1143 %a6 = icmp ne <2 x i32> %b, zeroinitializer
1144 %a7 = icmp slt <2 x i32> %a5, %c
1145 %a8 = icmp ne <2 x i32> %a5, zeroinitializer
1146 %a9 = and <2 x i1> %a6, %a8
1147 %a10 = and <2 x i1> %a7, %a9
1148 %a11 = select <2 x i1> %a10, <2 x i32> %c, <2 x i32> %a5