1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=thumbv8.1m.main-none-eabi -mattr=+mve --verify-machineinstrs %s -o - | FileCheck %s
4 declare i8 @llvm.smax.i8(i8 %a, i8 %b) readnone
6 define arm_aapcs_vfpcc i8 @smaxi8(i8 %a, i8 %b) {
9 ; CHECK-NEXT: sxtb r0, r0
10 ; CHECK-NEXT: sxtb r1, r1
11 ; CHECK-NEXT: cmp r0, r1
12 ; CHECK-NEXT: csel r0, r0, r1, gt
14 %c = call i8 @llvm.smax.i8(i8 %a, i8 %b)
18 declare i16 @llvm.smax.i16(i16 %a, i16 %b) readnone
20 define arm_aapcs_vfpcc i16 @smaxi16(i16 %a, i16 %b) {
21 ; CHECK-LABEL: smaxi16:
23 ; CHECK-NEXT: sxth r0, r0
24 ; CHECK-NEXT: sxth r1, r1
25 ; CHECK-NEXT: cmp r0, r1
26 ; CHECK-NEXT: csel r0, r0, r1, gt
28 %c = call i16 @llvm.smax.i16(i16 %a, i16 %b)
32 declare i32 @llvm.smax.i32(i32 %a, i32 %b) readnone
34 define arm_aapcs_vfpcc i32 @smaxi32(i32 %a, i32 %b) {
35 ; CHECK-LABEL: smaxi32:
37 ; CHECK-NEXT: cmp r0, r1
38 ; CHECK-NEXT: csel r0, r0, r1, gt
40 %c = call i32 @llvm.smax.i32(i32 %a, i32 %b)
44 declare i64 @llvm.smax.i64(i64 %a, i64 %b) readnone
46 define arm_aapcs_vfpcc i64 @smaxi64(i64 %a, i64 %b) {
47 ; CHECK-LABEL: smaxi64:
49 ; CHECK-NEXT: subs.w r12, r2, r0
50 ; CHECK-NEXT: sbcs.w r12, r3, r1
51 ; CHECK-NEXT: cset r12, lt
52 ; CHECK-NEXT: cmp.w r12, #0
53 ; CHECK-NEXT: csel r0, r0, r2, ne
54 ; CHECK-NEXT: csel r1, r1, r3, ne
56 %c = call i64 @llvm.smax.i64(i64 %a, i64 %b)
60 declare <8 x i8> @llvm.smax.v8i8(<8 x i8> %a, <8 x i8> %b) readnone
62 define arm_aapcs_vfpcc <8 x i8> @smax8i8(<8 x i8> %a, <8 x i8> %b) {
63 ; CHECK-LABEL: smax8i8:
65 ; CHECK-NEXT: vmovlb.s8 q1, q1
66 ; CHECK-NEXT: vmovlb.s8 q0, q0
67 ; CHECK-NEXT: vmax.s16 q0, q0, q1
69 %c = call <8 x i8> @llvm.smax.v8i8(<8 x i8> %a, <8 x i8> %b)
73 declare <16 x i8> @llvm.smax.v16i8(<16 x i8> %a, <16 x i8> %b) readnone
75 define arm_aapcs_vfpcc <16 x i8> @smax16i8(<16 x i8> %a, <16 x i8> %b) {
76 ; CHECK-LABEL: smax16i8:
78 ; CHECK-NEXT: vmax.s8 q0, q0, q1
80 %c = call <16 x i8> @llvm.smax.v16i8(<16 x i8> %a, <16 x i8> %b)
84 declare <32 x i8> @llvm.smax.v32i8(<32 x i8> %a, <32 x i8> %b) readnone
86 define arm_aapcs_vfpcc void @smax32i8(<32 x i8> %a, <32 x i8> %b, ptr %p) {
87 ; CHECK-LABEL: smax32i8:
89 ; CHECK-NEXT: vmax.s8 q1, q1, q3
90 ; CHECK-NEXT: vmax.s8 q0, q0, q2
91 ; CHECK-NEXT: vstrw.32 q1, [r0, #16]
92 ; CHECK-NEXT: vstrw.32 q0, [r0]
94 %c = call <32 x i8> @llvm.smax.v32i8(<32 x i8> %a, <32 x i8> %b)
95 store <32 x i8> %c, ptr %p
99 declare <4 x i16> @llvm.smax.v4i16(<4 x i16> %a, <4 x i16> %b) readnone
101 define arm_aapcs_vfpcc <4 x i16> @smax4i16(<4 x i16> %a, <4 x i16> %b) {
102 ; CHECK-LABEL: smax4i16:
104 ; CHECK-NEXT: vmovlb.s16 q1, q1
105 ; CHECK-NEXT: vmovlb.s16 q0, q0
106 ; CHECK-NEXT: vmax.s32 q0, q0, q1
108 %c = call <4 x i16> @llvm.smax.v4i16(<4 x i16> %a, <4 x i16> %b)
112 declare <8 x i16> @llvm.smax.v8i16(<8 x i16> %a, <8 x i16> %b) readnone
114 define arm_aapcs_vfpcc <8 x i16> @smax8i16(<8 x i16> %a, <8 x i16> %b) {
115 ; CHECK-LABEL: smax8i16:
117 ; CHECK-NEXT: vmax.s16 q0, q0, q1
119 %c = call <8 x i16> @llvm.smax.v8i16(<8 x i16> %a, <8 x i16> %b)
123 declare <16 x i16> @llvm.smax.v16i16(<16 x i16> %a, <16 x i16> %b) readnone
125 define arm_aapcs_vfpcc void @smax16i16(<16 x i16> %a, <16 x i16> %b, ptr %p) {
126 ; CHECK-LABEL: smax16i16:
128 ; CHECK-NEXT: vmax.s16 q1, q1, q3
129 ; CHECK-NEXT: vmax.s16 q0, q0, q2
130 ; CHECK-NEXT: vstrw.32 q1, [r0, #16]
131 ; CHECK-NEXT: vstrw.32 q0, [r0]
133 %c = call <16 x i16> @llvm.smax.v16i16(<16 x i16> %a, <16 x i16> %b)
134 store <16 x i16> %c, ptr %p
138 declare <2 x i32> @llvm.smax.v2i32(<2 x i32> %a, <2 x i32> %b) readnone
140 define arm_aapcs_vfpcc <2 x i32> @smax2i32(<2 x i32> %a, <2 x i32> %b) {
141 ; CHECK-LABEL: smax2i32:
143 ; CHECK-NEXT: .save {r4, r5, r7, lr}
144 ; CHECK-NEXT: push {r4, r5, r7, lr}
145 ; CHECK-NEXT: vmov r1, s4
146 ; CHECK-NEXT: vmov r3, s0
147 ; CHECK-NEXT: vmov r0, s6
148 ; CHECK-NEXT: vmov r2, s2
149 ; CHECK-NEXT: vmov q1[2], q1[0], r1, r0
150 ; CHECK-NEXT: vmov q0[2], q0[0], r3, r2
151 ; CHECK-NEXT: asr.w lr, r1, #31
152 ; CHECK-NEXT: subs r1, r1, r3
153 ; CHECK-NEXT: sbcs.w r1, lr, r3, asr #31
154 ; CHECK-NEXT: asr.w r5, r3, #31
155 ; CHECK-NEXT: asr.w r12, r0, #31
156 ; CHECK-NEXT: csetm r1, lt
157 ; CHECK-NEXT: subs r0, r0, r2
158 ; CHECK-NEXT: mov.w r3, #0
159 ; CHECK-NEXT: sbcs.w r0, r12, r2, asr #31
160 ; CHECK-NEXT: bfi r3, r1, #0, #8
161 ; CHECK-NEXT: csetm r0, lt
162 ; CHECK-NEXT: asrs r4, r2, #31
163 ; CHECK-NEXT: bfi r3, r0, #8, #8
164 ; CHECK-NEXT: vmov q1[3], q1[1], lr, r12
165 ; CHECK-NEXT: vmov q0[3], q0[1], r5, r4
166 ; CHECK-NEXT: vmsr p0, r3
167 ; CHECK-NEXT: vpsel q0, q0, q1
168 ; CHECK-NEXT: pop {r4, r5, r7, pc}
169 %c = call <2 x i32> @llvm.smax.v2i32(<2 x i32> %a, <2 x i32> %b)
173 declare <4 x i32> @llvm.smax.v4i32(<4 x i32> %a, <4 x i32> %b) readnone
175 define arm_aapcs_vfpcc <4 x i32> @smax4i32(<4 x i32> %a, <4 x i32> %b) {
176 ; CHECK-LABEL: smax4i32:
178 ; CHECK-NEXT: vmax.s32 q0, q0, q1
180 %c = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %a, <4 x i32> %b)
184 declare <8 x i32> @llvm.smax.v8i32(<8 x i32> %a, <8 x i32> %b) readnone
186 define arm_aapcs_vfpcc void @smax8i32(<8 x i32> %a, <8 x i32> %b, ptr %p) {
187 ; CHECK-LABEL: smax8i32:
189 ; CHECK-NEXT: vmax.s32 q1, q1, q3
190 ; CHECK-NEXT: vmax.s32 q0, q0, q2
191 ; CHECK-NEXT: vstrw.32 q1, [r0, #16]
192 ; CHECK-NEXT: vstrw.32 q0, [r0]
194 %c = call <8 x i32>@llvm.smax.v8i32(<8 x i32> %a, <8 x i32> %b)
195 store <8 x i32> %c, ptr %p
199 declare <1 x i64> @llvm.smax.v1i64(<1 x i64> %a, <1 x i64> %b) readnone
201 define arm_aapcs_vfpcc <1 x i64> @smax1i64(<1 x i64> %a, <1 x i64> %b) {
202 ; CHECK-LABEL: smax1i64:
204 ; CHECK-NEXT: .pad #8
205 ; CHECK-NEXT: sub sp, #8
206 ; CHECK-NEXT: subs.w r12, r2, r0
207 ; CHECK-NEXT: sbcs.w r12, r3, r1
208 ; CHECK-NEXT: cset r12, lt
209 ; CHECK-NEXT: cmp.w r12, #0
210 ; CHECK-NEXT: csel r1, r1, r3, ne
211 ; CHECK-NEXT: csel r0, r0, r2, ne
212 ; CHECK-NEXT: vmov q0[2], q0[0], r0, r1
213 ; CHECK-NEXT: vmov r0, s0
214 ; CHECK-NEXT: add sp, #8
216 %c = call <1 x i64> @llvm.smax.v1i64(<1 x i64> %a, <1 x i64> %b)
220 declare <2 x i64> @llvm.smax.v2i64(<2 x i64> %a, <2 x i64> %b) readnone
222 define arm_aapcs_vfpcc <2 x i64> @smax2i64(<2 x i64> %a, <2 x i64> %b) {
223 ; CHECK-LABEL: smax2i64:
225 ; CHECK-NEXT: vmov r0, r1, d0
226 ; CHECK-NEXT: vmov r2, r3, d2
227 ; CHECK-NEXT: subs r0, r2, r0
228 ; CHECK-NEXT: sbcs.w r0, r3, r1
229 ; CHECK-NEXT: mov.w r1, #0
230 ; CHECK-NEXT: csetm r0, lt
231 ; CHECK-NEXT: vmov r3, r2, d3
232 ; CHECK-NEXT: bfi r1, r0, #0, #8
233 ; CHECK-NEXT: vmov r0, r12, d1
234 ; CHECK-NEXT: subs r0, r3, r0
235 ; CHECK-NEXT: sbcs.w r0, r2, r12
236 ; CHECK-NEXT: csetm r0, lt
237 ; CHECK-NEXT: bfi r1, r0, #8, #8
238 ; CHECK-NEXT: vmsr p0, r1
239 ; CHECK-NEXT: vpsel q0, q0, q1
241 %c = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %a, <2 x i64> %b)
245 declare <4 x i64> @llvm.smax.v4i64(<4 x i64> %a, <4 x i64> %b) readnone
247 define arm_aapcs_vfpcc void @smax4i64(<4 x i64> %a, <4 x i64> %b, ptr %p) {
248 ; CHECK-LABEL: smax4i64:
250 ; CHECK-NEXT: .save {r4, lr}
251 ; CHECK-NEXT: push {r4, lr}
252 ; CHECK-NEXT: vmov r1, r12, d2
253 ; CHECK-NEXT: vmov r3, r2, d6
254 ; CHECK-NEXT: subs r1, r3, r1
255 ; CHECK-NEXT: mov.w r3, #0
256 ; CHECK-NEXT: sbcs.w r1, r2, r12
257 ; CHECK-NEXT: vmov lr, r12, d3
258 ; CHECK-NEXT: csetm r2, lt
259 ; CHECK-NEXT: movs r1, #0
260 ; CHECK-NEXT: bfi r3, r2, #0, #8
261 ; CHECK-NEXT: vmov r2, r4, d7
262 ; CHECK-NEXT: subs.w r2, r2, lr
263 ; CHECK-NEXT: sbcs.w r2, r4, r12
264 ; CHECK-NEXT: csetm r2, lt
265 ; CHECK-NEXT: bfi r3, r2, #8, #8
266 ; CHECK-NEXT: vmov r2, r12, d0
267 ; CHECK-NEXT: vmsr p0, r3
268 ; CHECK-NEXT: vmov r4, r3, d4
269 ; CHECK-NEXT: vpsel q1, q1, q3
270 ; CHECK-NEXT: vstrw.32 q1, [r0, #16]
271 ; CHECK-NEXT: subs r2, r4, r2
272 ; CHECK-NEXT: sbcs.w r2, r3, r12
273 ; CHECK-NEXT: vmov r4, r3, d5
274 ; CHECK-NEXT: csetm r2, lt
275 ; CHECK-NEXT: bfi r1, r2, #0, #8
276 ; CHECK-NEXT: vmov r2, r12, d1
277 ; CHECK-NEXT: subs r2, r4, r2
278 ; CHECK-NEXT: sbcs.w r2, r3, r12
279 ; CHECK-NEXT: csetm r2, lt
280 ; CHECK-NEXT: bfi r1, r2, #8, #8
281 ; CHECK-NEXT: vmsr p0, r1
282 ; CHECK-NEXT: vpsel q0, q0, q2
283 ; CHECK-NEXT: vstrw.32 q0, [r0]
284 ; CHECK-NEXT: pop {r4, pc}
285 %c = call <4 x i64> @llvm.smax.v4i64(<4 x i64> %a, <4 x i64> %b)
286 store <4 x i64> %c, ptr %p
290 declare i8 @llvm.umax.i8(i8 %a, i8 %b) readnone
292 define arm_aapcs_vfpcc i8 @umaxi8(i8 %a, i8 %b) {
293 ; CHECK-LABEL: umaxi8:
295 ; CHECK-NEXT: uxtb r0, r0
296 ; CHECK-NEXT: uxtb r1, r1
297 ; CHECK-NEXT: cmp r0, r1
298 ; CHECK-NEXT: csel r0, r0, r1, hi
300 %c = call i8 @llvm.umax.i8(i8 %a, i8 %b)
304 declare i16 @llvm.umax.i16(i16 %a, i16 %b) readnone
306 define arm_aapcs_vfpcc i16 @umaxi16(i16 %a, i16 %b) {
307 ; CHECK-LABEL: umaxi16:
309 ; CHECK-NEXT: uxth r0, r0
310 ; CHECK-NEXT: uxth r1, r1
311 ; CHECK-NEXT: cmp r0, r1
312 ; CHECK-NEXT: csel r0, r0, r1, hi
314 %c = call i16 @llvm.umax.i16(i16 %a, i16 %b)
318 declare i32 @llvm.umax.i32(i32 %a, i32 %b) readnone
320 define arm_aapcs_vfpcc i32 @umaxi32(i32 %a, i32 %b) {
321 ; CHECK-LABEL: umaxi32:
323 ; CHECK-NEXT: cmp r0, r1
324 ; CHECK-NEXT: csel r0, r0, r1, hi
326 %c = call i32 @llvm.umax.i32(i32 %a, i32 %b)
330 declare i64 @llvm.umax.i64(i64 %a, i64 %b) readnone
332 define arm_aapcs_vfpcc i64 @umaxi64(i64 %a, i64 %b) {
333 ; CHECK-LABEL: umaxi64:
335 ; CHECK-NEXT: subs.w r12, r2, r0
336 ; CHECK-NEXT: sbcs.w r12, r3, r1
337 ; CHECK-NEXT: cset r12, lo
338 ; CHECK-NEXT: cmp.w r12, #0
339 ; CHECK-NEXT: csel r0, r0, r2, ne
340 ; CHECK-NEXT: csel r1, r1, r3, ne
342 %c = call i64 @llvm.umax.i64(i64 %a, i64 %b)
346 declare <8 x i8> @llvm.umax.v8i8(<8 x i8> %a, <8 x i8> %b) readnone
348 define arm_aapcs_vfpcc <8 x i8> @umax8i8(<8 x i8> %a, <8 x i8> %b) {
349 ; CHECK-LABEL: umax8i8:
351 ; CHECK-NEXT: vmovlb.u8 q1, q1
352 ; CHECK-NEXT: vmovlb.u8 q0, q0
353 ; CHECK-NEXT: vmax.u16 q0, q0, q1
355 %c = call <8 x i8> @llvm.umax.v8i8(<8 x i8> %a, <8 x i8> %b)
359 declare <16 x i8> @llvm.umax.v16i8(<16 x i8> %a, <16 x i8> %b) readnone
361 define arm_aapcs_vfpcc <16 x i8> @umax16i8(<16 x i8> %a, <16 x i8> %b) {
362 ; CHECK-LABEL: umax16i8:
364 ; CHECK-NEXT: vmax.u8 q0, q0, q1
366 %c = call <16 x i8> @llvm.umax.v16i8(<16 x i8> %a, <16 x i8> %b)
370 declare <32 x i8> @llvm.umax.v32i8(<32 x i8> %a, <32 x i8> %b) readnone
372 define arm_aapcs_vfpcc void @umax32i8(<32 x i8> %a, <32 x i8> %b, ptr %p) {
373 ; CHECK-LABEL: umax32i8:
375 ; CHECK-NEXT: vmax.u8 q1, q1, q3
376 ; CHECK-NEXT: vmax.u8 q0, q0, q2
377 ; CHECK-NEXT: vstrw.32 q1, [r0, #16]
378 ; CHECK-NEXT: vstrw.32 q0, [r0]
380 %c = call <32 x i8> @llvm.umax.v32i8(<32 x i8> %a, <32 x i8> %b)
381 store <32 x i8> %c, ptr %p
385 declare <4 x i16> @llvm.umax.v4i16(<4 x i16> %a, <4 x i16> %b) readnone
387 define arm_aapcs_vfpcc <4 x i16> @umax4i16(<4 x i16> %a, <4 x i16> %b) {
388 ; CHECK-LABEL: umax4i16:
390 ; CHECK-NEXT: vmovlb.u16 q1, q1
391 ; CHECK-NEXT: vmovlb.u16 q0, q0
392 ; CHECK-NEXT: vmax.u32 q0, q0, q1
394 %c = call <4 x i16> @llvm.umax.v4i16(<4 x i16> %a, <4 x i16> %b)
398 declare <8 x i16> @llvm.umax.v8i16(<8 x i16> %a, <8 x i16> %b) readnone
400 define arm_aapcs_vfpcc <8 x i16> @umax8i16(<8 x i16> %a, <8 x i16> %b) {
401 ; CHECK-LABEL: umax8i16:
403 ; CHECK-NEXT: vmax.u16 q0, q0, q1
405 %c = call <8 x i16> @llvm.umax.v8i16(<8 x i16> %a, <8 x i16> %b)
409 declare <16 x i16> @llvm.umax.v16i16(<16 x i16> %a, <16 x i16> %b) readnone
411 define arm_aapcs_vfpcc void @umax16i16(<16 x i16> %a, <16 x i16> %b, ptr %p) {
412 ; CHECK-LABEL: umax16i16:
414 ; CHECK-NEXT: vmax.u16 q1, q1, q3
415 ; CHECK-NEXT: vmax.u16 q0, q0, q2
416 ; CHECK-NEXT: vstrw.32 q1, [r0, #16]
417 ; CHECK-NEXT: vstrw.32 q0, [r0]
419 %c = call <16 x i16> @llvm.umax.v16i16(<16 x i16> %a, <16 x i16> %b)
420 store <16 x i16> %c, ptr %p
424 declare <2 x i32> @llvm.umax.v2i32(<2 x i32> %a, <2 x i32> %b) readnone
426 define arm_aapcs_vfpcc <2 x i32> @umax2i32(<2 x i32> %a, <2 x i32> %b) {
427 ; CHECK-LABEL: umax2i32:
429 ; CHECK-NEXT: vmov.i64 q2, #0xffffffff
430 ; CHECK-NEXT: vand q0, q0, q2
431 ; CHECK-NEXT: vand q1, q1, q2
432 ; CHECK-NEXT: vmov r0, r1, d0
433 ; CHECK-NEXT: vmov r2, r3, d2
434 ; CHECK-NEXT: subs r0, r2, r0
435 ; CHECK-NEXT: sbcs.w r0, r3, r1
436 ; CHECK-NEXT: mov.w r1, #0
437 ; CHECK-NEXT: csetm r0, lo
438 ; CHECK-NEXT: vmov r3, r2, d3
439 ; CHECK-NEXT: bfi r1, r0, #0, #8
440 ; CHECK-NEXT: vmov r0, r12, d1
441 ; CHECK-NEXT: subs r0, r3, r0
442 ; CHECK-NEXT: sbcs.w r0, r2, r12
443 ; CHECK-NEXT: csetm r0, lo
444 ; CHECK-NEXT: bfi r1, r0, #8, #8
445 ; CHECK-NEXT: vmsr p0, r1
446 ; CHECK-NEXT: vpsel q0, q0, q1
448 %c = call <2 x i32> @llvm.umax.v2i32(<2 x i32> %a, <2 x i32> %b)
452 declare <4 x i32> @llvm.umax.v4i32(<4 x i32> %a, <4 x i32> %b) readnone
454 define arm_aapcs_vfpcc <4 x i32> @umax4i32(<4 x i32> %a, <4 x i32> %b) {
455 ; CHECK-LABEL: umax4i32:
457 ; CHECK-NEXT: vmax.u32 q0, q0, q1
459 %c = call <4 x i32> @llvm.umax.v4i32(<4 x i32> %a, <4 x i32> %b)
463 declare <8 x i32> @llvm.umax.v8i32(<8 x i32> %a, <8 x i32> %b) readnone
465 define arm_aapcs_vfpcc void @umax8i32(<8 x i32> %a, <8 x i32> %b, ptr %p) {
466 ; CHECK-LABEL: umax8i32:
468 ; CHECK-NEXT: vmax.u32 q1, q1, q3
469 ; CHECK-NEXT: vmax.u32 q0, q0, q2
470 ; CHECK-NEXT: vstrw.32 q1, [r0, #16]
471 ; CHECK-NEXT: vstrw.32 q0, [r0]
473 %c = call <8 x i32>@llvm.umax.v8i32(<8 x i32> %a, <8 x i32> %b)
474 store <8 x i32> %c, ptr %p
478 declare <1 x i64> @llvm.umax.v1i64(<1 x i64> %a, <1 x i64> %b) readnone
480 define arm_aapcs_vfpcc <1 x i64> @umax1i64(<1 x i64> %a, <1 x i64> %b) {
481 ; CHECK-LABEL: umax1i64:
483 ; CHECK-NEXT: .pad #8
484 ; CHECK-NEXT: sub sp, #8
485 ; CHECK-NEXT: subs.w r12, r2, r0
486 ; CHECK-NEXT: sbcs.w r12, r3, r1
487 ; CHECK-NEXT: cset r12, lo
488 ; CHECK-NEXT: cmp.w r12, #0
489 ; CHECK-NEXT: csel r1, r1, r3, ne
490 ; CHECK-NEXT: csel r0, r0, r2, ne
491 ; CHECK-NEXT: vmov q0[2], q0[0], r0, r1
492 ; CHECK-NEXT: vmov r0, s0
493 ; CHECK-NEXT: add sp, #8
495 %c = call <1 x i64> @llvm.umax.v1i64(<1 x i64> %a, <1 x i64> %b)
499 declare <2 x i64> @llvm.umax.v2i64(<2 x i64> %a, <2 x i64> %b) readnone
501 define arm_aapcs_vfpcc <2 x i64> @umax2i64(<2 x i64> %a, <2 x i64> %b) {
502 ; CHECK-LABEL: umax2i64:
504 ; CHECK-NEXT: vmov r0, r1, d0
505 ; CHECK-NEXT: vmov r2, r3, d2
506 ; CHECK-NEXT: subs r0, r2, r0
507 ; CHECK-NEXT: sbcs.w r0, r3, r1
508 ; CHECK-NEXT: mov.w r1, #0
509 ; CHECK-NEXT: csetm r0, lo
510 ; CHECK-NEXT: vmov r3, r2, d3
511 ; CHECK-NEXT: bfi r1, r0, #0, #8
512 ; CHECK-NEXT: vmov r0, r12, d1
513 ; CHECK-NEXT: subs r0, r3, r0
514 ; CHECK-NEXT: sbcs.w r0, r2, r12
515 ; CHECK-NEXT: csetm r0, lo
516 ; CHECK-NEXT: bfi r1, r0, #8, #8
517 ; CHECK-NEXT: vmsr p0, r1
518 ; CHECK-NEXT: vpsel q0, q0, q1
520 %c = call <2 x i64> @llvm.umax.v2i64(<2 x i64> %a, <2 x i64> %b)
524 declare <4 x i64> @llvm.umax.v4i64(<4 x i64> %a, <4 x i64> %b) readnone
526 define arm_aapcs_vfpcc void @umax4i64(<4 x i64> %a, <4 x i64> %b, ptr %p) {
527 ; CHECK-LABEL: umax4i64:
529 ; CHECK-NEXT: .save {r4, lr}
530 ; CHECK-NEXT: push {r4, lr}
531 ; CHECK-NEXT: vmov r1, r12, d2
532 ; CHECK-NEXT: vmov r3, r2, d6
533 ; CHECK-NEXT: subs r1, r3, r1
534 ; CHECK-NEXT: mov.w r3, #0
535 ; CHECK-NEXT: sbcs.w r1, r2, r12
536 ; CHECK-NEXT: vmov lr, r12, d3
537 ; CHECK-NEXT: csetm r2, lo
538 ; CHECK-NEXT: movs r1, #0
539 ; CHECK-NEXT: bfi r3, r2, #0, #8
540 ; CHECK-NEXT: vmov r2, r4, d7
541 ; CHECK-NEXT: subs.w r2, r2, lr
542 ; CHECK-NEXT: sbcs.w r2, r4, r12
543 ; CHECK-NEXT: csetm r2, lo
544 ; CHECK-NEXT: bfi r3, r2, #8, #8
545 ; CHECK-NEXT: vmov r2, r12, d0
546 ; CHECK-NEXT: vmsr p0, r3
547 ; CHECK-NEXT: vmov r4, r3, d4
548 ; CHECK-NEXT: vpsel q1, q1, q3
549 ; CHECK-NEXT: vstrw.32 q1, [r0, #16]
550 ; CHECK-NEXT: subs r2, r4, r2
551 ; CHECK-NEXT: sbcs.w r2, r3, r12
552 ; CHECK-NEXT: vmov r4, r3, d5
553 ; CHECK-NEXT: csetm r2, lo
554 ; CHECK-NEXT: bfi r1, r2, #0, #8
555 ; CHECK-NEXT: vmov r2, r12, d1
556 ; CHECK-NEXT: subs r2, r4, r2
557 ; CHECK-NEXT: sbcs.w r2, r3, r12
558 ; CHECK-NEXT: csetm r2, lo
559 ; CHECK-NEXT: bfi r1, r2, #8, #8
560 ; CHECK-NEXT: vmsr p0, r1
561 ; CHECK-NEXT: vpsel q0, q0, q2
562 ; CHECK-NEXT: vstrw.32 q0, [r0]
563 ; CHECK-NEXT: pop {r4, pc}
564 %c = call <4 x i64> @llvm.umax.v4i64(<4 x i64> %a, <4 x i64> %b)
565 store <4 x i64> %c, ptr %p
569 declare i8 @llvm.smin.i8(i8 %a, i8 %b) readnone
571 define arm_aapcs_vfpcc i8 @smini8(i8 %a, i8 %b) {
572 ; CHECK-LABEL: smini8:
574 ; CHECK-NEXT: sxtb r0, r0
575 ; CHECK-NEXT: sxtb r1, r1
576 ; CHECK-NEXT: cmp r0, r1
577 ; CHECK-NEXT: csel r0, r0, r1, lt
579 %c = call i8 @llvm.smin.i8(i8 %a, i8 %b)
583 declare i16 @llvm.smin.i16(i16 %a, i16 %b) readnone
585 define arm_aapcs_vfpcc i16 @smini16(i16 %a, i16 %b) {
586 ; CHECK-LABEL: smini16:
588 ; CHECK-NEXT: sxth r0, r0
589 ; CHECK-NEXT: sxth r1, r1
590 ; CHECK-NEXT: cmp r0, r1
591 ; CHECK-NEXT: csel r0, r0, r1, lt
593 %c = call i16 @llvm.smin.i16(i16 %a, i16 %b)
597 declare i32 @llvm.smin.i32(i32 %a, i32 %b) readnone
599 define arm_aapcs_vfpcc i32 @smini32(i32 %a, i32 %b) {
600 ; CHECK-LABEL: smini32:
602 ; CHECK-NEXT: cmp r0, r1
603 ; CHECK-NEXT: csel r0, r0, r1, lt
605 %c = call i32 @llvm.smin.i32(i32 %a, i32 %b)
609 declare i64 @llvm.smin.i64(i64 %a, i64 %b) readnone
611 define arm_aapcs_vfpcc i64 @smini64(i64 %a, i64 %b) {
612 ; CHECK-LABEL: smini64:
614 ; CHECK-NEXT: subs.w r12, r0, r2
615 ; CHECK-NEXT: sbcs.w r12, r1, r3
616 ; CHECK-NEXT: cset r12, lt
617 ; CHECK-NEXT: cmp.w r12, #0
618 ; CHECK-NEXT: csel r0, r0, r2, ne
619 ; CHECK-NEXT: csel r1, r1, r3, ne
621 %c = call i64 @llvm.smin.i64(i64 %a, i64 %b)
625 declare <8 x i8> @llvm.smin.v8i8(<8 x i8> %a, <8 x i8> %b) readnone
627 define arm_aapcs_vfpcc <8 x i8> @smin8i8(<8 x i8> %a, <8 x i8> %b) {
628 ; CHECK-LABEL: smin8i8:
630 ; CHECK-NEXT: vmovlb.s8 q1, q1
631 ; CHECK-NEXT: vmovlb.s8 q0, q0
632 ; CHECK-NEXT: vmin.s16 q0, q0, q1
634 %c = call <8 x i8> @llvm.smin.v8i8(<8 x i8> %a, <8 x i8> %b)
638 declare <16 x i8> @llvm.smin.v16i8(<16 x i8> %a, <16 x i8> %b) readnone
640 define arm_aapcs_vfpcc <16 x i8> @smin16i8(<16 x i8> %a, <16 x i8> %b) {
641 ; CHECK-LABEL: smin16i8:
643 ; CHECK-NEXT: vmin.s8 q0, q0, q1
645 %c = call <16 x i8> @llvm.smin.v16i8(<16 x i8> %a, <16 x i8> %b)
649 declare <32 x i8> @llvm.smin.v32i8(<32 x i8> %a, <32 x i8> %b) readnone
651 define arm_aapcs_vfpcc void @smin32i8(<32 x i8> %a, <32 x i8> %b, ptr %p) {
652 ; CHECK-LABEL: smin32i8:
654 ; CHECK-NEXT: vmin.s8 q1, q1, q3
655 ; CHECK-NEXT: vmin.s8 q0, q0, q2
656 ; CHECK-NEXT: vstrw.32 q1, [r0, #16]
657 ; CHECK-NEXT: vstrw.32 q0, [r0]
659 %c = call <32 x i8> @llvm.smin.v32i8(<32 x i8> %a, <32 x i8> %b)
660 store <32 x i8> %c, ptr %p
664 declare <4 x i16> @llvm.smin.v4i16(<4 x i16> %a, <4 x i16> %b) readnone
666 define arm_aapcs_vfpcc <4 x i16> @smin4i16(<4 x i16> %a, <4 x i16> %b) {
667 ; CHECK-LABEL: smin4i16:
669 ; CHECK-NEXT: vmovlb.s16 q1, q1
670 ; CHECK-NEXT: vmovlb.s16 q0, q0
671 ; CHECK-NEXT: vmin.s32 q0, q0, q1
673 %c = call <4 x i16> @llvm.smin.v4i16(<4 x i16> %a, <4 x i16> %b)
677 declare <8 x i16> @llvm.smin.v8i16(<8 x i16> %a, <8 x i16> %b) readnone
679 define arm_aapcs_vfpcc <8 x i16> @smin8i16(<8 x i16> %a, <8 x i16> %b) {
680 ; CHECK-LABEL: smin8i16:
682 ; CHECK-NEXT: vmin.s16 q0, q0, q1
684 %c = call <8 x i16> @llvm.smin.v8i16(<8 x i16> %a, <8 x i16> %b)
688 declare <16 x i16> @llvm.smin.v16i16(<16 x i16> %a, <16 x i16> %b) readnone
690 define arm_aapcs_vfpcc void @smin16i16(<16 x i16> %a, <16 x i16> %b, ptr %p) {
691 ; CHECK-LABEL: smin16i16:
693 ; CHECK-NEXT: vmin.s16 q1, q1, q3
694 ; CHECK-NEXT: vmin.s16 q0, q0, q2
695 ; CHECK-NEXT: vstrw.32 q1, [r0, #16]
696 ; CHECK-NEXT: vstrw.32 q0, [r0]
698 %c = call <16 x i16> @llvm.smin.v16i16(<16 x i16> %a, <16 x i16> %b)
699 store <16 x i16> %c, ptr %p
703 declare <2 x i32> @llvm.smin.v2i32(<2 x i32> %a, <2 x i32> %b) readnone
705 define arm_aapcs_vfpcc <2 x i32> @smin2i32(<2 x i32> %a, <2 x i32> %b) {
706 ; CHECK-LABEL: smin2i32:
708 ; CHECK-NEXT: .save {r7, lr}
709 ; CHECK-NEXT: push {r7, lr}
710 ; CHECK-NEXT: vmov r0, s6
711 ; CHECK-NEXT: vmov r1, s4
712 ; CHECK-NEXT: vmov q1[2], q1[0], r1, r0
713 ; CHECK-NEXT: asrs r2, r0, #31
714 ; CHECK-NEXT: asrs r3, r1, #31
715 ; CHECK-NEXT: vmov q1[3], q1[1], r3, r2
716 ; CHECK-NEXT: vmov r3, s0
717 ; CHECK-NEXT: vmov r2, s2
718 ; CHECK-NEXT: vmov q0[2], q0[0], r3, r2
719 ; CHECK-NEXT: asr.w lr, r3, #31
720 ; CHECK-NEXT: subs r3, r3, r1
721 ; CHECK-NEXT: sbcs.w r1, lr, r1, asr #31
722 ; CHECK-NEXT: mov.w r3, #0
723 ; CHECK-NEXT: csetm r1, lt
724 ; CHECK-NEXT: asr.w r12, r2, #31
725 ; CHECK-NEXT: bfi r3, r1, #0, #8
726 ; CHECK-NEXT: subs r1, r2, r0
727 ; CHECK-NEXT: sbcs.w r0, r12, r0, asr #31
728 ; CHECK-NEXT: vmov q0[3], q0[1], lr, r12
729 ; CHECK-NEXT: csetm r0, lt
730 ; CHECK-NEXT: bfi r3, r0, #8, #8
731 ; CHECK-NEXT: vmsr p0, r3
732 ; CHECK-NEXT: vpsel q0, q0, q1
733 ; CHECK-NEXT: pop {r7, pc}
734 %c = call <2 x i32> @llvm.smin.v2i32(<2 x i32> %a, <2 x i32> %b)
738 declare <4 x i32> @llvm.smin.v4i32(<4 x i32> %a, <4 x i32> %b) readnone
740 define arm_aapcs_vfpcc <4 x i32> @smin4i32(<4 x i32> %a, <4 x i32> %b) {
741 ; CHECK-LABEL: smin4i32:
743 ; CHECK-NEXT: vmin.s32 q0, q0, q1
745 %c = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %a, <4 x i32> %b)
749 declare <8 x i32> @llvm.smin.v8i32(<8 x i32> %a, <8 x i32> %b) readnone
751 define arm_aapcs_vfpcc void @smin8i32(<8 x i32> %a, <8 x i32> %b, ptr %p) {
752 ; CHECK-LABEL: smin8i32:
754 ; CHECK-NEXT: vmin.s32 q1, q1, q3
755 ; CHECK-NEXT: vmin.s32 q0, q0, q2
756 ; CHECK-NEXT: vstrw.32 q1, [r0, #16]
757 ; CHECK-NEXT: vstrw.32 q0, [r0]
759 %c = call <8 x i32>@llvm.smin.v8i32(<8 x i32> %a, <8 x i32> %b)
760 store <8 x i32> %c, ptr %p
764 declare <1 x i64> @llvm.smin.v1i64(<1 x i64> %a, <1 x i64> %b) readnone
766 define arm_aapcs_vfpcc <1 x i64> @smin1i64(<1 x i64> %a, <1 x i64> %b) {
767 ; CHECK-LABEL: smin1i64:
769 ; CHECK-NEXT: .pad #8
770 ; CHECK-NEXT: sub sp, #8
771 ; CHECK-NEXT: subs.w r12, r0, r2
772 ; CHECK-NEXT: sbcs.w r12, r1, r3
773 ; CHECK-NEXT: cset r12, lt
774 ; CHECK-NEXT: cmp.w r12, #0
775 ; CHECK-NEXT: csel r1, r1, r3, ne
776 ; CHECK-NEXT: csel r0, r0, r2, ne
777 ; CHECK-NEXT: vmov q0[2], q0[0], r0, r1
778 ; CHECK-NEXT: vmov r0, s0
779 ; CHECK-NEXT: add sp, #8
781 %c = call <1 x i64> @llvm.smin.v1i64(<1 x i64> %a, <1 x i64> %b)
785 declare <2 x i64> @llvm.smin.v2i64(<2 x i64> %a, <2 x i64> %b) readnone
787 define arm_aapcs_vfpcc <2 x i64> @smin2i64(<2 x i64> %a, <2 x i64> %b) {
788 ; CHECK-LABEL: smin2i64:
790 ; CHECK-NEXT: vmov r0, r1, d2
791 ; CHECK-NEXT: vmov r2, r3, d0
792 ; CHECK-NEXT: subs r0, r2, r0
793 ; CHECK-NEXT: sbcs.w r0, r3, r1
794 ; CHECK-NEXT: mov.w r1, #0
795 ; CHECK-NEXT: csetm r0, lt
796 ; CHECK-NEXT: vmov r3, r2, d1
797 ; CHECK-NEXT: bfi r1, r0, #0, #8
798 ; CHECK-NEXT: vmov r0, r12, d3
799 ; CHECK-NEXT: subs r0, r3, r0
800 ; CHECK-NEXT: sbcs.w r0, r2, r12
801 ; CHECK-NEXT: csetm r0, lt
802 ; CHECK-NEXT: bfi r1, r0, #8, #8
803 ; CHECK-NEXT: vmsr p0, r1
804 ; CHECK-NEXT: vpsel q0, q0, q1
806 %c = call <2 x i64> @llvm.smin.v2i64(<2 x i64> %a, <2 x i64> %b)
810 declare <4 x i64> @llvm.smin.v4i64(<4 x i64> %a, <4 x i64> %b) readnone
812 define arm_aapcs_vfpcc void @smin4i64(<4 x i64> %a, <4 x i64> %b, ptr %p) {
813 ; CHECK-LABEL: smin4i64:
815 ; CHECK-NEXT: .save {r4, lr}
816 ; CHECK-NEXT: push {r4, lr}
817 ; CHECK-NEXT: vmov r1, r12, d6
818 ; CHECK-NEXT: vmov r3, r2, d2
819 ; CHECK-NEXT: subs r1, r3, r1
820 ; CHECK-NEXT: mov.w r3, #0
821 ; CHECK-NEXT: sbcs.w r1, r2, r12
822 ; CHECK-NEXT: vmov lr, r12, d7
823 ; CHECK-NEXT: csetm r2, lt
824 ; CHECK-NEXT: movs r1, #0
825 ; CHECK-NEXT: bfi r3, r2, #0, #8
826 ; CHECK-NEXT: vmov r2, r4, d3
827 ; CHECK-NEXT: subs.w r2, r2, lr
828 ; CHECK-NEXT: sbcs.w r2, r4, r12
829 ; CHECK-NEXT: csetm r2, lt
830 ; CHECK-NEXT: bfi r3, r2, #8, #8
831 ; CHECK-NEXT: vmov r2, r12, d4
832 ; CHECK-NEXT: vmsr p0, r3
833 ; CHECK-NEXT: vmov r4, r3, d0
834 ; CHECK-NEXT: vpsel q1, q1, q3
835 ; CHECK-NEXT: vstrw.32 q1, [r0, #16]
836 ; CHECK-NEXT: subs r2, r4, r2
837 ; CHECK-NEXT: sbcs.w r2, r3, r12
838 ; CHECK-NEXT: vmov r4, r3, d1
839 ; CHECK-NEXT: csetm r2, lt
840 ; CHECK-NEXT: bfi r1, r2, #0, #8
841 ; CHECK-NEXT: vmov r2, r12, d5
842 ; CHECK-NEXT: subs r2, r4, r2
843 ; CHECK-NEXT: sbcs.w r2, r3, r12
844 ; CHECK-NEXT: csetm r2, lt
845 ; CHECK-NEXT: bfi r1, r2, #8, #8
846 ; CHECK-NEXT: vmsr p0, r1
847 ; CHECK-NEXT: vpsel q0, q0, q2
848 ; CHECK-NEXT: vstrw.32 q0, [r0]
849 ; CHECK-NEXT: pop {r4, pc}
850 %c = call <4 x i64> @llvm.smin.v4i64(<4 x i64> %a, <4 x i64> %b)
851 store <4 x i64> %c, ptr %p
855 declare i8 @llvm.umin.i8(i8 %a, i8 %b) readnone
857 define arm_aapcs_vfpcc i8 @umini8(i8 %a, i8 %b) {
858 ; CHECK-LABEL: umini8:
860 ; CHECK-NEXT: uxtb r0, r0
861 ; CHECK-NEXT: uxtb r1, r1
862 ; CHECK-NEXT: cmp r0, r1
863 ; CHECK-NEXT: csel r0, r0, r1, lo
865 %c = call i8 @llvm.umin.i8(i8 %a, i8 %b)
869 declare i16 @llvm.umin.i16(i16 %a, i16 %b) readnone
871 define arm_aapcs_vfpcc i16 @umini16(i16 %a, i16 %b) {
872 ; CHECK-LABEL: umini16:
874 ; CHECK-NEXT: uxth r0, r0
875 ; CHECK-NEXT: uxth r1, r1
876 ; CHECK-NEXT: cmp r0, r1
877 ; CHECK-NEXT: csel r0, r0, r1, lo
879 %c = call i16 @llvm.umin.i16(i16 %a, i16 %b)
883 declare i32 @llvm.umin.i32(i32 %a, i32 %b) readnone
885 define arm_aapcs_vfpcc i32 @umini32(i32 %a, i32 %b) {
886 ; CHECK-LABEL: umini32:
888 ; CHECK-NEXT: cmp r0, r1
889 ; CHECK-NEXT: csel r0, r0, r1, lo
891 %c = call i32 @llvm.umin.i32(i32 %a, i32 %b)
895 declare i64 @llvm.umin.i64(i64 %a, i64 %b) readnone
897 define arm_aapcs_vfpcc i64 @umini64(i64 %a, i64 %b) {
898 ; CHECK-LABEL: umini64:
900 ; CHECK-NEXT: subs.w r12, r0, r2
901 ; CHECK-NEXT: sbcs.w r12, r1, r3
902 ; CHECK-NEXT: cset r12, lo
903 ; CHECK-NEXT: cmp.w r12, #0
904 ; CHECK-NEXT: csel r0, r0, r2, ne
905 ; CHECK-NEXT: csel r1, r1, r3, ne
907 %c = call i64 @llvm.umin.i64(i64 %a, i64 %b)
911 declare <8 x i8> @llvm.umin.v8i8(<8 x i8> %a, <8 x i8> %b) readnone
913 define arm_aapcs_vfpcc <8 x i8> @umin8i8(<8 x i8> %a, <8 x i8> %b) {
914 ; CHECK-LABEL: umin8i8:
916 ; CHECK-NEXT: vmovlb.u8 q1, q1
917 ; CHECK-NEXT: vmovlb.u8 q0, q0
918 ; CHECK-NEXT: vmin.u16 q0, q0, q1
920 %c = call <8 x i8> @llvm.umin.v8i8(<8 x i8> %a, <8 x i8> %b)
924 declare <16 x i8> @llvm.umin.v16i8(<16 x i8> %a, <16 x i8> %b) readnone
926 define arm_aapcs_vfpcc <16 x i8> @umin16i8(<16 x i8> %a, <16 x i8> %b) {
927 ; CHECK-LABEL: umin16i8:
929 ; CHECK-NEXT: vmin.u8 q0, q0, q1
931 %c = call <16 x i8> @llvm.umin.v16i8(<16 x i8> %a, <16 x i8> %b)
935 declare <32 x i8> @llvm.umin.v32i8(<32 x i8> %a, <32 x i8> %b) readnone
937 define arm_aapcs_vfpcc void @umin32i8(<32 x i8> %a, <32 x i8> %b, ptr %p) {
938 ; CHECK-LABEL: umin32i8:
940 ; CHECK-NEXT: vmin.u8 q1, q1, q3
941 ; CHECK-NEXT: vmin.u8 q0, q0, q2
942 ; CHECK-NEXT: vstrw.32 q1, [r0, #16]
943 ; CHECK-NEXT: vstrw.32 q0, [r0]
945 %c = call <32 x i8> @llvm.umin.v32i8(<32 x i8> %a, <32 x i8> %b)
946 store <32 x i8> %c, ptr %p
950 declare <4 x i16> @llvm.umin.v4i16(<4 x i16> %a, <4 x i16> %b) readnone
952 define arm_aapcs_vfpcc <4 x i16> @umin4i16(<4 x i16> %a, <4 x i16> %b) {
953 ; CHECK-LABEL: umin4i16:
955 ; CHECK-NEXT: vmovlb.u16 q1, q1
956 ; CHECK-NEXT: vmovlb.u16 q0, q0
957 ; CHECK-NEXT: vmin.u32 q0, q0, q1
959 %c = call <4 x i16> @llvm.umin.v4i16(<4 x i16> %a, <4 x i16> %b)
963 declare <8 x i16> @llvm.umin.v8i16(<8 x i16> %a, <8 x i16> %b) readnone
965 define arm_aapcs_vfpcc <8 x i16> @umin8i16(<8 x i16> %a, <8 x i16> %b) {
966 ; CHECK-LABEL: umin8i16:
968 ; CHECK-NEXT: vmin.u16 q0, q0, q1
970 %c = call <8 x i16> @llvm.umin.v8i16(<8 x i16> %a, <8 x i16> %b)
974 declare <16 x i16> @llvm.umin.v16i16(<16 x i16> %a, <16 x i16> %b) readnone
976 define arm_aapcs_vfpcc void @umin16i16(<16 x i16> %a, <16 x i16> %b, ptr %p) {
977 ; CHECK-LABEL: umin16i16:
979 ; CHECK-NEXT: vmin.u16 q1, q1, q3
980 ; CHECK-NEXT: vmin.u16 q0, q0, q2
981 ; CHECK-NEXT: vstrw.32 q1, [r0, #16]
982 ; CHECK-NEXT: vstrw.32 q0, [r0]
984 %c = call <16 x i16> @llvm.umin.v16i16(<16 x i16> %a, <16 x i16> %b)
985 store <16 x i16> %c, ptr %p
989 declare <2 x i32> @llvm.umin.v2i32(<2 x i32> %a, <2 x i32> %b) readnone
991 define arm_aapcs_vfpcc <2 x i32> @umin2i32(<2 x i32> %a, <2 x i32> %b) {
992 ; CHECK-LABEL: umin2i32:
994 ; CHECK-NEXT: vmov.i64 q2, #0xffffffff
995 ; CHECK-NEXT: vand q1, q1, q2
996 ; CHECK-NEXT: vand q0, q0, q2
997 ; CHECK-NEXT: vmov r0, r1, d2
998 ; CHECK-NEXT: vmov r2, r3, d0
999 ; CHECK-NEXT: subs r0, r2, r0
1000 ; CHECK-NEXT: sbcs.w r0, r3, r1
1001 ; CHECK-NEXT: mov.w r1, #0
1002 ; CHECK-NEXT: csetm r0, lo
1003 ; CHECK-NEXT: vmov r3, r2, d1
1004 ; CHECK-NEXT: bfi r1, r0, #0, #8
1005 ; CHECK-NEXT: vmov r0, r12, d3
1006 ; CHECK-NEXT: subs r0, r3, r0
1007 ; CHECK-NEXT: sbcs.w r0, r2, r12
1008 ; CHECK-NEXT: csetm r0, lo
1009 ; CHECK-NEXT: bfi r1, r0, #8, #8
1010 ; CHECK-NEXT: vmsr p0, r1
1011 ; CHECK-NEXT: vpsel q0, q0, q1
1013 %c = call <2 x i32> @llvm.umin.v2i32(<2 x i32> %a, <2 x i32> %b)
1017 declare <4 x i32> @llvm.umin.v4i32(<4 x i32> %a, <4 x i32> %b) readnone
1019 define arm_aapcs_vfpcc <4 x i32> @umin4i32(<4 x i32> %a, <4 x i32> %b) {
1020 ; CHECK-LABEL: umin4i32:
1022 ; CHECK-NEXT: vmin.u32 q0, q0, q1
1024 %c = call <4 x i32> @llvm.umin.v4i32(<4 x i32> %a, <4 x i32> %b)
1028 declare <8 x i32> @llvm.umin.v8i32(<8 x i32> %a, <8 x i32> %b) readnone
1030 define arm_aapcs_vfpcc void @umin8i32(<8 x i32> %a, <8 x i32> %b, ptr %p) {
1031 ; CHECK-LABEL: umin8i32:
1033 ; CHECK-NEXT: vmin.u32 q1, q1, q3
1034 ; CHECK-NEXT: vmin.u32 q0, q0, q2
1035 ; CHECK-NEXT: vstrw.32 q1, [r0, #16]
1036 ; CHECK-NEXT: vstrw.32 q0, [r0]
1038 %c = call <8 x i32>@llvm.umin.v8i32(<8 x i32> %a, <8 x i32> %b)
1039 store <8 x i32> %c, ptr %p
1043 declare <1 x i64> @llvm.umin.v1i64(<1 x i64> %a, <1 x i64> %b) readnone
1045 define arm_aapcs_vfpcc <1 x i64> @umin1i64(<1 x i64> %a, <1 x i64> %b) {
1046 ; CHECK-LABEL: umin1i64:
1048 ; CHECK-NEXT: .pad #8
1049 ; CHECK-NEXT: sub sp, #8
1050 ; CHECK-NEXT: subs.w r12, r0, r2
1051 ; CHECK-NEXT: sbcs.w r12, r1, r3
1052 ; CHECK-NEXT: cset r12, lo
1053 ; CHECK-NEXT: cmp.w r12, #0
1054 ; CHECK-NEXT: csel r1, r1, r3, ne
1055 ; CHECK-NEXT: csel r0, r0, r2, ne
1056 ; CHECK-NEXT: vmov q0[2], q0[0], r0, r1
1057 ; CHECK-NEXT: vmov r0, s0
1058 ; CHECK-NEXT: add sp, #8
1060 %c = call <1 x i64> @llvm.umin.v1i64(<1 x i64> %a, <1 x i64> %b)
1064 declare <2 x i64> @llvm.umin.v2i64(<2 x i64> %a, <2 x i64> %b) readnone
1066 define arm_aapcs_vfpcc <2 x i64> @umin2i64(<2 x i64> %a, <2 x i64> %b) {
1067 ; CHECK-LABEL: umin2i64:
1069 ; CHECK-NEXT: vmov r0, r1, d2
1070 ; CHECK-NEXT: vmov r2, r3, d0
1071 ; CHECK-NEXT: subs r0, r2, r0
1072 ; CHECK-NEXT: sbcs.w r0, r3, r1
1073 ; CHECK-NEXT: mov.w r1, #0
1074 ; CHECK-NEXT: csetm r0, lo
1075 ; CHECK-NEXT: vmov r3, r2, d1
1076 ; CHECK-NEXT: bfi r1, r0, #0, #8
1077 ; CHECK-NEXT: vmov r0, r12, d3
1078 ; CHECK-NEXT: subs r0, r3, r0
1079 ; CHECK-NEXT: sbcs.w r0, r2, r12
1080 ; CHECK-NEXT: csetm r0, lo
1081 ; CHECK-NEXT: bfi r1, r0, #8, #8
1082 ; CHECK-NEXT: vmsr p0, r1
1083 ; CHECK-NEXT: vpsel q0, q0, q1
1085 %c = call <2 x i64> @llvm.umin.v2i64(<2 x i64> %a, <2 x i64> %b)
1089 declare <4 x i64> @llvm.umin.v4i64(<4 x i64> %a, <4 x i64> %b) readnone
1091 define arm_aapcs_vfpcc void @umin4i64(<4 x i64> %a, <4 x i64> %b, ptr %p) {
1092 ; CHECK-LABEL: umin4i64:
1094 ; CHECK-NEXT: .save {r4, lr}
1095 ; CHECK-NEXT: push {r4, lr}
1096 ; CHECK-NEXT: vmov r1, r12, d6
1097 ; CHECK-NEXT: vmov r3, r2, d2
1098 ; CHECK-NEXT: subs r1, r3, r1
1099 ; CHECK-NEXT: mov.w r3, #0
1100 ; CHECK-NEXT: sbcs.w r1, r2, r12
1101 ; CHECK-NEXT: vmov lr, r12, d7
1102 ; CHECK-NEXT: csetm r2, lo
1103 ; CHECK-NEXT: movs r1, #0
1104 ; CHECK-NEXT: bfi r3, r2, #0, #8
1105 ; CHECK-NEXT: vmov r2, r4, d3
1106 ; CHECK-NEXT: subs.w r2, r2, lr
1107 ; CHECK-NEXT: sbcs.w r2, r4, r12
1108 ; CHECK-NEXT: csetm r2, lo
1109 ; CHECK-NEXT: bfi r3, r2, #8, #8
1110 ; CHECK-NEXT: vmov r2, r12, d4
1111 ; CHECK-NEXT: vmsr p0, r3
1112 ; CHECK-NEXT: vmov r4, r3, d0
1113 ; CHECK-NEXT: vpsel q1, q1, q3
1114 ; CHECK-NEXT: vstrw.32 q1, [r0, #16]
1115 ; CHECK-NEXT: subs r2, r4, r2
1116 ; CHECK-NEXT: sbcs.w r2, r3, r12
1117 ; CHECK-NEXT: vmov r4, r3, d1
1118 ; CHECK-NEXT: csetm r2, lo
1119 ; CHECK-NEXT: bfi r1, r2, #0, #8
1120 ; CHECK-NEXT: vmov r2, r12, d5
1121 ; CHECK-NEXT: subs r2, r4, r2
1122 ; CHECK-NEXT: sbcs.w r2, r3, r12
1123 ; CHECK-NEXT: csetm r2, lo
1124 ; CHECK-NEXT: bfi r1, r2, #8, #8
1125 ; CHECK-NEXT: vmsr p0, r1
1126 ; CHECK-NEXT: vpsel q0, q0, q2
1127 ; CHECK-NEXT: vstrw.32 q0, [r0]
1128 ; CHECK-NEXT: pop {r4, pc}
1129 %c = call <4 x i64> @llvm.umin.v4i64(<4 x i64> %a, <4 x i64> %b)
1130 store <4 x i64> %c, ptr %p