1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=thumbv8.1m.main-none-none-eabi -mattr=+mve.fp | FileCheck %s
6 define arm_aapcs_vfpcc <2 x i32> @stest_f64i32(<2 x double> %x) {
7 ; CHECK-LABEL: stest_f64i32:
8 ; CHECK: @ %bb.0: @ %entry
9 ; CHECK-NEXT: .save {r4, r5, r7, lr}
10 ; CHECK-NEXT: push {r4, r5, r7, lr}
11 ; CHECK-NEXT: .vsave {d8, d9}
12 ; CHECK-NEXT: vpush {d8, d9}
13 ; CHECK-NEXT: vmov q4, q0
14 ; CHECK-NEXT: vmov r0, r1, d8
15 ; CHECK-NEXT: bl __aeabi_d2lz
16 ; CHECK-NEXT: mov r4, r0
17 ; CHECK-NEXT: mov r5, r1
18 ; CHECK-NEXT: vmov r0, r1, d9
19 ; CHECK-NEXT: bl __aeabi_d2lz
20 ; CHECK-NEXT: adr r3, .LCPI0_0
21 ; CHECK-NEXT: mvn r12, #-2147483648
22 ; CHECK-NEXT: vldrw.u32 q0, [r3]
23 ; CHECK-NEXT: subs.w r3, r4, r12
24 ; CHECK-NEXT: sbcs r3, r5, #0
25 ; CHECK-NEXT: vmov q1[2], q1[0], r4, r0
26 ; CHECK-NEXT: csetm r3, lt
27 ; CHECK-NEXT: subs.w r0, r0, r12
28 ; CHECK-NEXT: sbcs r0, r1, #0
29 ; CHECK-NEXT: vmov q1[3], q1[1], r5, r1
30 ; CHECK-NEXT: mov.w r5, #0
31 ; CHECK-NEXT: csetm r0, lt
32 ; CHECK-NEXT: bfi r5, r3, #0, #8
33 ; CHECK-NEXT: mov.w r12, #-1
34 ; CHECK-NEXT: bfi r5, r0, #8, #8
35 ; CHECK-NEXT: movs r2, #0
36 ; CHECK-NEXT: vmsr p0, r5
37 ; CHECK-NEXT: adr r4, .LCPI0_1
38 ; CHECK-NEXT: vpsel q0, q1, q0
39 ; CHECK-NEXT: vldrw.u32 q1, [r4]
40 ; CHECK-NEXT: vmov r0, r1, d0
41 ; CHECK-NEXT: vmov r3, r5, d1
42 ; CHECK-NEXT: rsbs.w r0, r0, #-2147483648
43 ; CHECK-NEXT: sbcs.w r0, r12, r1
44 ; CHECK-NEXT: csetm r0, lt
45 ; CHECK-NEXT: bfi r2, r0, #0, #8
46 ; CHECK-NEXT: rsbs.w r0, r3, #-2147483648
47 ; CHECK-NEXT: sbcs.w r0, r12, r5
48 ; CHECK-NEXT: csetm r0, lt
49 ; CHECK-NEXT: bfi r2, r0, #8, #8
50 ; CHECK-NEXT: vmsr p0, r2
51 ; CHECK-NEXT: vpsel q0, q0, q1
52 ; CHECK-NEXT: vpop {d8, d9}
53 ; CHECK-NEXT: pop {r4, r5, r7, pc}
54 ; CHECK-NEXT: .p2align 4
55 ; CHECK-NEXT: @ %bb.1:
56 ; CHECK-NEXT: .LCPI0_0:
57 ; CHECK-NEXT: .long 2147483647 @ 0x7fffffff
58 ; CHECK-NEXT: .long 0 @ 0x0
59 ; CHECK-NEXT: .long 2147483647 @ 0x7fffffff
60 ; CHECK-NEXT: .long 0 @ 0x0
61 ; CHECK-NEXT: .LCPI0_1:
62 ; CHECK-NEXT: .long 2147483648 @ 0x80000000
63 ; CHECK-NEXT: .long 4294967295 @ 0xffffffff
64 ; CHECK-NEXT: .long 2147483648 @ 0x80000000
65 ; CHECK-NEXT: .long 4294967295 @ 0xffffffff
67 %conv = fptosi <2 x double> %x to <2 x i64>
68 %0 = icmp slt <2 x i64> %conv, <i64 2147483647, i64 2147483647>
69 %spec.store.select = select <2 x i1> %0, <2 x i64> %conv, <2 x i64> <i64 2147483647, i64 2147483647>
70 %1 = icmp sgt <2 x i64> %spec.store.select, <i64 -2147483648, i64 -2147483648>
71 %spec.store.select7 = select <2 x i1> %1, <2 x i64> %spec.store.select, <2 x i64> <i64 -2147483648, i64 -2147483648>
72 %conv6 = trunc <2 x i64> %spec.store.select7 to <2 x i32>
76 define arm_aapcs_vfpcc <2 x i32> @utest_f64i32(<2 x double> %x) {
77 ; CHECK-LABEL: utest_f64i32:
78 ; CHECK: @ %bb.0: @ %entry
79 ; CHECK-NEXT: .save {r4, r5, r7, lr}
80 ; CHECK-NEXT: push {r4, r5, r7, lr}
81 ; CHECK-NEXT: .vsave {d8, d9}
82 ; CHECK-NEXT: vpush {d8, d9}
83 ; CHECK-NEXT: vmov q4, q0
84 ; CHECK-NEXT: vmov r0, r1, d8
85 ; CHECK-NEXT: bl __aeabi_d2ulz
86 ; CHECK-NEXT: mov r4, r0
87 ; CHECK-NEXT: mov r5, r1
88 ; CHECK-NEXT: vmov r0, r1, d9
89 ; CHECK-NEXT: bl __aeabi_d2ulz
90 ; CHECK-NEXT: subs.w r3, r4, #-1
91 ; CHECK-NEXT: vmov q1[2], q1[0], r4, r0
92 ; CHECK-NEXT: sbcs r3, r5, #0
93 ; CHECK-NEXT: mov.w r2, #0
94 ; CHECK-NEXT: csetm r3, lo
95 ; CHECK-NEXT: subs.w r0, r0, #-1
96 ; CHECK-NEXT: sbcs r0, r1, #0
97 ; CHECK-NEXT: bfi r2, r3, #0, #8
98 ; CHECK-NEXT: csetm r0, lo
99 ; CHECK-NEXT: vmov.i64 q0, #0xffffffff
100 ; CHECK-NEXT: bfi r2, r0, #8, #8
101 ; CHECK-NEXT: vmov q1[3], q1[1], r5, r1
102 ; CHECK-NEXT: vmsr p0, r2
103 ; CHECK-NEXT: vpsel q0, q1, q0
104 ; CHECK-NEXT: vpop {d8, d9}
105 ; CHECK-NEXT: pop {r4, r5, r7, pc}
107 %conv = fptoui <2 x double> %x to <2 x i64>
108 %0 = icmp ult <2 x i64> %conv, <i64 4294967295, i64 4294967295>
109 %spec.store.select = select <2 x i1> %0, <2 x i64> %conv, <2 x i64> <i64 4294967295, i64 4294967295>
110 %conv6 = trunc <2 x i64> %spec.store.select to <2 x i32>
114 define arm_aapcs_vfpcc <2 x i32> @ustest_f64i32(<2 x double> %x) {
115 ; CHECK-LABEL: ustest_f64i32:
116 ; CHECK: @ %bb.0: @ %entry
117 ; CHECK-NEXT: .save {r4, r5, r7, lr}
118 ; CHECK-NEXT: push {r4, r5, r7, lr}
119 ; CHECK-NEXT: .vsave {d8, d9}
120 ; CHECK-NEXT: vpush {d8, d9}
121 ; CHECK-NEXT: vmov q4, q0
122 ; CHECK-NEXT: vmov r0, r1, d8
123 ; CHECK-NEXT: bl __aeabi_d2lz
124 ; CHECK-NEXT: mov r4, r0
125 ; CHECK-NEXT: mov r5, r1
126 ; CHECK-NEXT: vmov r0, r1, d9
127 ; CHECK-NEXT: bl __aeabi_d2lz
128 ; CHECK-NEXT: subs.w r3, r4, #-1
129 ; CHECK-NEXT: vmov q1[2], q1[0], r4, r0
130 ; CHECK-NEXT: sbcs r3, r5, #0
131 ; CHECK-NEXT: vmov q1[3], q1[1], r5, r1
132 ; CHECK-NEXT: csetm r3, lt
133 ; CHECK-NEXT: subs.w r0, r0, #-1
134 ; CHECK-NEXT: mov.w r5, #0
135 ; CHECK-NEXT: sbcs r0, r1, #0
136 ; CHECK-NEXT: bfi r5, r3, #0, #8
137 ; CHECK-NEXT: csetm r0, lt
138 ; CHECK-NEXT: bfi r5, r0, #8, #8
139 ; CHECK-NEXT: vmov.i64 q0, #0xffffffff
140 ; CHECK-NEXT: vmsr p0, r5
141 ; CHECK-NEXT: movs r2, #0
142 ; CHECK-NEXT: vpsel q0, q1, q0
143 ; CHECK-NEXT: vmov.i32 q1, #0x0
144 ; CHECK-NEXT: vmov r0, r1, d0
145 ; CHECK-NEXT: vmov r3, r5, d1
146 ; CHECK-NEXT: rsbs r0, r0, #0
147 ; CHECK-NEXT: sbcs.w r0, r2, r1
148 ; CHECK-NEXT: csetm r0, lt
149 ; CHECK-NEXT: rsbs r1, r3, #0
150 ; CHECK-NEXT: sbcs.w r1, r2, r5
151 ; CHECK-NEXT: bfi r2, r0, #0, #8
152 ; CHECK-NEXT: csetm r0, lt
153 ; CHECK-NEXT: bfi r2, r0, #8, #8
154 ; CHECK-NEXT: vmsr p0, r2
155 ; CHECK-NEXT: vpsel q0, q0, q1
156 ; CHECK-NEXT: vpop {d8, d9}
157 ; CHECK-NEXT: pop {r4, r5, r7, pc}
159 %conv = fptosi <2 x double> %x to <2 x i64>
160 %0 = icmp slt <2 x i64> %conv, <i64 4294967295, i64 4294967295>
161 %spec.store.select = select <2 x i1> %0, <2 x i64> %conv, <2 x i64> <i64 4294967295, i64 4294967295>
162 %1 = icmp sgt <2 x i64> %spec.store.select, zeroinitializer
163 %spec.store.select7 = select <2 x i1> %1, <2 x i64> %spec.store.select, <2 x i64> zeroinitializer
164 %conv6 = trunc <2 x i64> %spec.store.select7 to <2 x i32>
168 define arm_aapcs_vfpcc <4 x i32> @stest_f32i32(<4 x float> %x) {
169 ; CHECK-LABEL: stest_f32i32:
170 ; CHECK: @ %bb.0: @ %entry
171 ; CHECK-NEXT: vcvt.s32.f32 q0, q0
174 %conv = fptosi <4 x float> %x to <4 x i64>
175 %0 = icmp slt <4 x i64> %conv, <i64 2147483647, i64 2147483647, i64 2147483647, i64 2147483647>
176 %spec.store.select = select <4 x i1> %0, <4 x i64> %conv, <4 x i64> <i64 2147483647, i64 2147483647, i64 2147483647, i64 2147483647>
177 %1 = icmp sgt <4 x i64> %spec.store.select, <i64 -2147483648, i64 -2147483648, i64 -2147483648, i64 -2147483648>
178 %spec.store.select7 = select <4 x i1> %1, <4 x i64> %spec.store.select, <4 x i64> <i64 -2147483648, i64 -2147483648, i64 -2147483648, i64 -2147483648>
179 %conv6 = trunc <4 x i64> %spec.store.select7 to <4 x i32>
183 define arm_aapcs_vfpcc <4 x i32> @utest_f32i32(<4 x float> %x) {
184 ; CHECK-LABEL: utest_f32i32:
185 ; CHECK: @ %bb.0: @ %entry
186 ; CHECK-NEXT: vcvt.u32.f32 q0, q0
189 %conv = fptoui <4 x float> %x to <4 x i64>
190 %0 = icmp ult <4 x i64> %conv, <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>
191 %spec.store.select = select <4 x i1> %0, <4 x i64> %conv, <4 x i64> <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>
192 %conv6 = trunc <4 x i64> %spec.store.select to <4 x i32>
196 define arm_aapcs_vfpcc <4 x i32> @ustest_f32i32(<4 x float> %x) {
197 ; CHECK-LABEL: ustest_f32i32:
198 ; CHECK: @ %bb.0: @ %entry
199 ; CHECK-NEXT: vcvt.u32.f32 q0, q0
202 %conv = fptosi <4 x float> %x to <4 x i64>
203 %0 = icmp slt <4 x i64> %conv, <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>
204 %spec.store.select = select <4 x i1> %0, <4 x i64> %conv, <4 x i64> <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>
205 %1 = icmp sgt <4 x i64> %spec.store.select, zeroinitializer
206 %spec.store.select7 = select <4 x i1> %1, <4 x i64> %spec.store.select, <4 x i64> zeroinitializer
207 %conv6 = trunc <4 x i64> %spec.store.select7 to <4 x i32>
211 define arm_aapcs_vfpcc <4 x i32> @stest_f16i32(<4 x half> %x) {
212 ; CHECK-LABEL: stest_f16i32:
213 ; CHECK: @ %bb.0: @ %entry
214 ; CHECK-NEXT: .save {r4, r5, r7, lr}
215 ; CHECK-NEXT: push {r4, r5, r7, lr}
216 ; CHECK-NEXT: .vsave {d8, d9, d10, d11}
217 ; CHECK-NEXT: vpush {d8, d9, d10, d11}
218 ; CHECK-NEXT: vmov.u16 r0, q0[3]
219 ; CHECK-NEXT: vmov q4, q0
220 ; CHECK-NEXT: bl __fixhfdi
221 ; CHECK-NEXT: mov r4, r0
222 ; CHECK-NEXT: vmov.u16 r0, q4[0]
223 ; CHECK-NEXT: bl __fixhfdi
224 ; CHECK-NEXT: mov r5, r0
225 ; CHECK-NEXT: vmov.u16 r0, q4[2]
226 ; CHECK-NEXT: bl __fixhfdi
227 ; CHECK-NEXT: vmov q5[2], q5[0], r5, r0
228 ; CHECK-NEXT: vmov.u16 r0, q4[1]
229 ; CHECK-NEXT: bl __fixhfdi
230 ; CHECK-NEXT: vmov q5[3], q5[1], r0, r4
231 ; CHECK-NEXT: vmov q0, q5
232 ; CHECK-NEXT: vpop {d8, d9, d10, d11}
233 ; CHECK-NEXT: pop {r4, r5, r7, pc}
235 %conv = fptosi <4 x half> %x to <4 x i64>
236 %0 = icmp slt <4 x i64> %conv, <i64 2147483647, i64 2147483647, i64 2147483647, i64 2147483647>
237 %spec.store.select = select <4 x i1> %0, <4 x i64> %conv, <4 x i64> <i64 2147483647, i64 2147483647, i64 2147483647, i64 2147483647>
238 %1 = icmp sgt <4 x i64> %spec.store.select, <i64 -2147483648, i64 -2147483648, i64 -2147483648, i64 -2147483648>
239 %spec.store.select7 = select <4 x i1> %1, <4 x i64> %spec.store.select, <4 x i64> <i64 -2147483648, i64 -2147483648, i64 -2147483648, i64 -2147483648>
240 %conv6 = trunc <4 x i64> %spec.store.select7 to <4 x i32>
244 define arm_aapcs_vfpcc <4 x i32> @utesth_f16i32(<4 x half> %x) {
245 ; CHECK-LABEL: utesth_f16i32:
246 ; CHECK: @ %bb.0: @ %entry
247 ; CHECK-NEXT: .save {r4, r5, r7, lr}
248 ; CHECK-NEXT: push {r4, r5, r7, lr}
249 ; CHECK-NEXT: .vsave {d8, d9, d10, d11}
250 ; CHECK-NEXT: vpush {d8, d9, d10, d11}
251 ; CHECK-NEXT: vmov.u16 r0, q0[3]
252 ; CHECK-NEXT: vmov q4, q0
253 ; CHECK-NEXT: bl __fixunshfdi
254 ; CHECK-NEXT: mov r4, r0
255 ; CHECK-NEXT: vmov.u16 r0, q4[0]
256 ; CHECK-NEXT: bl __fixunshfdi
257 ; CHECK-NEXT: mov r5, r0
258 ; CHECK-NEXT: vmov.u16 r0, q4[2]
259 ; CHECK-NEXT: bl __fixunshfdi
260 ; CHECK-NEXT: vmov q5[2], q5[0], r5, r0
261 ; CHECK-NEXT: vmov.u16 r0, q4[1]
262 ; CHECK-NEXT: bl __fixunshfdi
263 ; CHECK-NEXT: vmov q5[3], q5[1], r0, r4
264 ; CHECK-NEXT: vmov q0, q5
265 ; CHECK-NEXT: vpop {d8, d9, d10, d11}
266 ; CHECK-NEXT: pop {r4, r5, r7, pc}
268 %conv = fptoui <4 x half> %x to <4 x i64>
269 %0 = icmp ult <4 x i64> %conv, <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>
270 %spec.store.select = select <4 x i1> %0, <4 x i64> %conv, <4 x i64> <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>
271 %conv6 = trunc <4 x i64> %spec.store.select to <4 x i32>
275 define arm_aapcs_vfpcc <4 x i32> @ustest_f16i32(<4 x half> %x) {
276 ; CHECK-LABEL: ustest_f16i32:
277 ; CHECK: @ %bb.0: @ %entry
278 ; CHECK-NEXT: .save {r4, r5, r6, lr}
279 ; CHECK-NEXT: push {r4, r5, r6, lr}
280 ; CHECK-NEXT: .vsave {d8, d9, d10, d11, d12, d13}
281 ; CHECK-NEXT: vpush {d8, d9, d10, d11, d12, d13}
282 ; CHECK-NEXT: vmov.u16 r0, q0[3]
283 ; CHECK-NEXT: vmov q4, q0
284 ; CHECK-NEXT: bl __fixhfdi
285 ; CHECK-NEXT: mov r4, r0
286 ; CHECK-NEXT: vmov.u16 r0, q4[2]
287 ; CHECK-NEXT: mov r5, r1
288 ; CHECK-NEXT: bl __fixhfdi
289 ; CHECK-NEXT: rsbs r2, r0, #0
290 ; CHECK-NEXT: mov.w r6, #0
291 ; CHECK-NEXT: vmov q0[2], q0[0], r0, r4
292 ; CHECK-NEXT: sbcs.w r0, r6, r1
293 ; CHECK-NEXT: csetm r0, lt
294 ; CHECK-NEXT: movs r1, #0
295 ; CHECK-NEXT: bfi r1, r0, #0, #8
296 ; CHECK-NEXT: rsbs r0, r4, #0
297 ; CHECK-NEXT: sbcs.w r0, r6, r5
298 ; CHECK-NEXT: vmov.i32 q5, #0x0
299 ; CHECK-NEXT: csetm r0, lt
300 ; CHECK-NEXT: bfi r1, r0, #8, #8
301 ; CHECK-NEXT: vmov.u16 r0, q4[1]
302 ; CHECK-NEXT: vmsr p0, r1
303 ; CHECK-NEXT: vpsel q6, q0, q5
304 ; CHECK-NEXT: bl __fixhfdi
305 ; CHECK-NEXT: mov r4, r0
306 ; CHECK-NEXT: vmov.u16 r0, q4[0]
307 ; CHECK-NEXT: mov r5, r1
308 ; CHECK-NEXT: bl __fixhfdi
309 ; CHECK-NEXT: rsbs r2, r0, #0
310 ; CHECK-NEXT: vmov q0[2], q0[0], r0, r4
311 ; CHECK-NEXT: sbcs.w r0, r6, r1
312 ; CHECK-NEXT: csetm r0, lt
313 ; CHECK-NEXT: rsbs r1, r4, #0
314 ; CHECK-NEXT: sbcs.w r1, r6, r5
315 ; CHECK-NEXT: bfi r6, r0, #0, #8
316 ; CHECK-NEXT: csetm r0, lt
317 ; CHECK-NEXT: bfi r6, r0, #8, #8
318 ; CHECK-NEXT: vmsr p0, r6
319 ; CHECK-NEXT: vpsel q0, q0, q5
320 ; CHECK-NEXT: vmov.f32 s1, s2
321 ; CHECK-NEXT: vmov.f32 s2, s24
322 ; CHECK-NEXT: vmov.f32 s3, s26
323 ; CHECK-NEXT: vpop {d8, d9, d10, d11, d12, d13}
324 ; CHECK-NEXT: pop {r4, r5, r6, pc}
326 %conv = fptosi <4 x half> %x to <4 x i64>
327 %0 = icmp slt <4 x i64> %conv, <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>
328 %spec.store.select = select <4 x i1> %0, <4 x i64> %conv, <4 x i64> <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>
329 %1 = icmp sgt <4 x i64> %spec.store.select, zeroinitializer
330 %spec.store.select7 = select <4 x i1> %1, <4 x i64> %spec.store.select, <4 x i64> zeroinitializer
331 %conv6 = trunc <4 x i64> %spec.store.select7 to <4 x i32>
337 define arm_aapcs_vfpcc <2 x i16> @stest_f64i16(<2 x double> %x) {
338 ; CHECK-LABEL: stest_f64i16:
339 ; CHECK: @ %bb.0: @ %entry
340 ; CHECK-NEXT: .save {r4, r5, r7, lr}
341 ; CHECK-NEXT: push {r4, r5, r7, lr}
342 ; CHECK-NEXT: .vsave {d8, d9}
343 ; CHECK-NEXT: vpush {d8, d9}
344 ; CHECK-NEXT: vmov q4, q0
345 ; CHECK-NEXT: vmov r0, r1, d9
346 ; CHECK-NEXT: bl __aeabi_d2lz
347 ; CHECK-NEXT: mov r4, r0
348 ; CHECK-NEXT: mov r5, r1
349 ; CHECK-NEXT: vmov r0, r1, d8
350 ; CHECK-NEXT: bl __aeabi_d2lz
351 ; CHECK-NEXT: vmov q0[2], q0[0], r0, r4
352 ; CHECK-NEXT: movw r4, #32767
353 ; CHECK-NEXT: vmov q0[3], q0[1], r1, r5
354 ; CHECK-NEXT: adr.w r12, .LCPI9_0
355 ; CHECK-NEXT: vmov r1, r2, d0
356 ; CHECK-NEXT: vldrw.u32 q1, [r12]
357 ; CHECK-NEXT: vmov r3, r5, d1
358 ; CHECK-NEXT: movw lr, #32768
359 ; CHECK-NEXT: movt lr, #65535
360 ; CHECK-NEXT: mov.w r12, #-1
361 ; CHECK-NEXT: movs r0, #0
362 ; CHECK-NEXT: subs r1, r1, r4
363 ; CHECK-NEXT: sbcs r1, r2, #0
364 ; CHECK-NEXT: mov.w r2, #0
365 ; CHECK-NEXT: csetm r1, lt
366 ; CHECK-NEXT: bfi r2, r1, #0, #8
367 ; CHECK-NEXT: subs r1, r3, r4
368 ; CHECK-NEXT: sbcs r1, r5, #0
369 ; CHECK-NEXT: adr r4, .LCPI9_1
370 ; CHECK-NEXT: csetm r1, lt
371 ; CHECK-NEXT: bfi r2, r1, #8, #8
372 ; CHECK-NEXT: vmsr p0, r2
373 ; CHECK-NEXT: vpsel q0, q0, q1
374 ; CHECK-NEXT: vldrw.u32 q1, [r4]
375 ; CHECK-NEXT: vmov r1, r2, d0
376 ; CHECK-NEXT: vmov r3, r5, d1
377 ; CHECK-NEXT: subs.w r1, lr, r1
378 ; CHECK-NEXT: sbcs.w r1, r12, r2
379 ; CHECK-NEXT: csetm r1, lt
380 ; CHECK-NEXT: bfi r0, r1, #0, #8
381 ; CHECK-NEXT: subs.w r1, lr, r3
382 ; CHECK-NEXT: sbcs.w r1, r12, r5
383 ; CHECK-NEXT: csetm r1, lt
384 ; CHECK-NEXT: bfi r0, r1, #8, #8
385 ; CHECK-NEXT: vmsr p0, r0
386 ; CHECK-NEXT: vpsel q0, q0, q1
387 ; CHECK-NEXT: vpop {d8, d9}
388 ; CHECK-NEXT: pop {r4, r5, r7, pc}
389 ; CHECK-NEXT: .p2align 4
390 ; CHECK-NEXT: @ %bb.1:
391 ; CHECK-NEXT: .LCPI9_0:
392 ; CHECK-NEXT: .long 32767 @ 0x7fff
393 ; CHECK-NEXT: .long 0 @ 0x0
394 ; CHECK-NEXT: .long 32767 @ 0x7fff
395 ; CHECK-NEXT: .long 0 @ 0x0
396 ; CHECK-NEXT: .LCPI9_1:
397 ; CHECK-NEXT: .long 4294934528 @ 0xffff8000
398 ; CHECK-NEXT: .long 0 @ 0x0
399 ; CHECK-NEXT: .long 4294934528 @ 0xffff8000
400 ; CHECK-NEXT: .long 0 @ 0x0
402 %conv = fptosi <2 x double> %x to <2 x i32>
403 %0 = icmp slt <2 x i32> %conv, <i32 32767, i32 32767>
404 %spec.store.select = select <2 x i1> %0, <2 x i32> %conv, <2 x i32> <i32 32767, i32 32767>
405 %1 = icmp sgt <2 x i32> %spec.store.select, <i32 -32768, i32 -32768>
406 %spec.store.select7 = select <2 x i1> %1, <2 x i32> %spec.store.select, <2 x i32> <i32 -32768, i32 -32768>
407 %conv6 = trunc <2 x i32> %spec.store.select7 to <2 x i16>
411 define arm_aapcs_vfpcc <2 x i16> @utest_f64i16(<2 x double> %x) {
412 ; CHECK-LABEL: utest_f64i16:
413 ; CHECK: @ %bb.0: @ %entry
414 ; CHECK-NEXT: .save {r4, r5, r7, lr}
415 ; CHECK-NEXT: push {r4, r5, r7, lr}
416 ; CHECK-NEXT: .vsave {d8, d9}
417 ; CHECK-NEXT: vpush {d8, d9}
418 ; CHECK-NEXT: vmov q4, q0
419 ; CHECK-NEXT: vmov r0, r1, d9
420 ; CHECK-NEXT: bl __aeabi_d2ulz
421 ; CHECK-NEXT: mov r4, r0
422 ; CHECK-NEXT: mov r5, r1
423 ; CHECK-NEXT: vmov r0, r1, d8
424 ; CHECK-NEXT: bl __aeabi_d2ulz
425 ; CHECK-NEXT: vmov q0[2], q0[0], r0, r4
426 ; CHECK-NEXT: movw r4, #65535
427 ; CHECK-NEXT: vmov q0[3], q0[1], r1, r5
428 ; CHECK-NEXT: movs r5, #0
429 ; CHECK-NEXT: vmov r0, r1, d0
430 ; CHECK-NEXT: vmov.i64 q1, #0xffff
431 ; CHECK-NEXT: vmov r2, r3, d1
432 ; CHECK-NEXT: subs r0, r0, r4
433 ; CHECK-NEXT: sbcs r0, r1, #0
434 ; CHECK-NEXT: csetm r0, lo
435 ; CHECK-NEXT: bfi r5, r0, #0, #8
436 ; CHECK-NEXT: subs r0, r2, r4
437 ; CHECK-NEXT: sbcs r0, r3, #0
438 ; CHECK-NEXT: csetm r0, lo
439 ; CHECK-NEXT: bfi r5, r0, #8, #8
440 ; CHECK-NEXT: vmsr p0, r5
441 ; CHECK-NEXT: vpsel q0, q0, q1
442 ; CHECK-NEXT: vpop {d8, d9}
443 ; CHECK-NEXT: pop {r4, r5, r7, pc}
445 %conv = fptoui <2 x double> %x to <2 x i32>
446 %0 = icmp ult <2 x i32> %conv, <i32 65535, i32 65535>
447 %spec.store.select = select <2 x i1> %0, <2 x i32> %conv, <2 x i32> <i32 65535, i32 65535>
448 %conv6 = trunc <2 x i32> %spec.store.select to <2 x i16>
452 define arm_aapcs_vfpcc <2 x i16> @ustest_f64i16(<2 x double> %x) {
453 ; CHECK-LABEL: ustest_f64i16:
454 ; CHECK: @ %bb.0: @ %entry
455 ; CHECK-NEXT: .save {r4, r5, r7, lr}
456 ; CHECK-NEXT: push {r4, r5, r7, lr}
457 ; CHECK-NEXT: .vsave {d8, d9}
458 ; CHECK-NEXT: vpush {d8, d9}
459 ; CHECK-NEXT: vmov q4, q0
460 ; CHECK-NEXT: vmov r0, r1, d9
461 ; CHECK-NEXT: bl __aeabi_d2lz
462 ; CHECK-NEXT: mov r4, r0
463 ; CHECK-NEXT: mov r5, r1
464 ; CHECK-NEXT: vmov r0, r1, d8
465 ; CHECK-NEXT: bl __aeabi_d2lz
466 ; CHECK-NEXT: vmov q0[2], q0[0], r0, r4
467 ; CHECK-NEXT: movw r4, #65535
468 ; CHECK-NEXT: vmov q0[3], q0[1], r1, r5
469 ; CHECK-NEXT: vmov.i64 q1, #0xffff
470 ; CHECK-NEXT: vmov r1, r2, d0
471 ; CHECK-NEXT: movs r0, #0
472 ; CHECK-NEXT: vmov r3, r5, d1
473 ; CHECK-NEXT: subs r1, r1, r4
474 ; CHECK-NEXT: sbcs r1, r2, #0
475 ; CHECK-NEXT: mov.w r2, #0
476 ; CHECK-NEXT: csetm r1, lt
477 ; CHECK-NEXT: bfi r2, r1, #0, #8
478 ; CHECK-NEXT: subs r1, r3, r4
479 ; CHECK-NEXT: sbcs r1, r5, #0
480 ; CHECK-NEXT: csetm r1, lt
481 ; CHECK-NEXT: bfi r2, r1, #8, #8
482 ; CHECK-NEXT: vmsr p0, r2
483 ; CHECK-NEXT: vpsel q0, q0, q1
484 ; CHECK-NEXT: vmov.i32 q1, #0x0
485 ; CHECK-NEXT: vmov r1, r2, d0
486 ; CHECK-NEXT: vmov r3, r5, d1
487 ; CHECK-NEXT: rsbs r1, r1, #0
488 ; CHECK-NEXT: sbcs.w r1, r0, r2
489 ; CHECK-NEXT: csetm r1, lt
490 ; CHECK-NEXT: rsbs r2, r3, #0
491 ; CHECK-NEXT: sbcs.w r2, r0, r5
492 ; CHECK-NEXT: bfi r0, r1, #0, #8
493 ; CHECK-NEXT: csetm r1, lt
494 ; CHECK-NEXT: bfi r0, r1, #8, #8
495 ; CHECK-NEXT: vmsr p0, r0
496 ; CHECK-NEXT: vpsel q0, q0, q1
497 ; CHECK-NEXT: vpop {d8, d9}
498 ; CHECK-NEXT: pop {r4, r5, r7, pc}
500 %conv = fptosi <2 x double> %x to <2 x i32>
501 %0 = icmp slt <2 x i32> %conv, <i32 65535, i32 65535>
502 %spec.store.select = select <2 x i1> %0, <2 x i32> %conv, <2 x i32> <i32 65535, i32 65535>
503 %1 = icmp sgt <2 x i32> %spec.store.select, zeroinitializer
504 %spec.store.select7 = select <2 x i1> %1, <2 x i32> %spec.store.select, <2 x i32> zeroinitializer
505 %conv6 = trunc <2 x i32> %spec.store.select7 to <2 x i16>
509 define arm_aapcs_vfpcc <4 x i16> @stest_f32i16(<4 x float> %x) {
510 ; CHECK-LABEL: stest_f32i16:
511 ; CHECK: @ %bb.0: @ %entry
512 ; CHECK-NEXT: vcvt.s32.f32 q0, q0
513 ; CHECK-NEXT: vqmovnb.s32 q0, q0
514 ; CHECK-NEXT: vmovlb.s16 q0, q0
517 %conv = fptosi <4 x float> %x to <4 x i32>
518 %0 = icmp slt <4 x i32> %conv, <i32 32767, i32 32767, i32 32767, i32 32767>
519 %spec.store.select = select <4 x i1> %0, <4 x i32> %conv, <4 x i32> <i32 32767, i32 32767, i32 32767, i32 32767>
520 %1 = icmp sgt <4 x i32> %spec.store.select, <i32 -32768, i32 -32768, i32 -32768, i32 -32768>
521 %spec.store.select7 = select <4 x i1> %1, <4 x i32> %spec.store.select, <4 x i32> <i32 -32768, i32 -32768, i32 -32768, i32 -32768>
522 %conv6 = trunc <4 x i32> %spec.store.select7 to <4 x i16>
526 define arm_aapcs_vfpcc <4 x i16> @utest_f32i16(<4 x float> %x) {
527 ; CHECK-LABEL: utest_f32i16:
528 ; CHECK: @ %bb.0: @ %entry
529 ; CHECK-NEXT: vcvt.u32.f32 q0, q0
530 ; CHECK-NEXT: vqmovnb.u32 q0, q0
531 ; CHECK-NEXT: vmovlb.u16 q0, q0
534 %conv = fptoui <4 x float> %x to <4 x i32>
535 %0 = icmp ult <4 x i32> %conv, <i32 65535, i32 65535, i32 65535, i32 65535>
536 %spec.store.select = select <4 x i1> %0, <4 x i32> %conv, <4 x i32> <i32 65535, i32 65535, i32 65535, i32 65535>
537 %conv6 = trunc <4 x i32> %spec.store.select to <4 x i16>
541 define arm_aapcs_vfpcc <4 x i16> @ustest_f32i16(<4 x float> %x) {
542 ; CHECK-LABEL: ustest_f32i16:
543 ; CHECK: @ %bb.0: @ %entry
544 ; CHECK-NEXT: vmov.i32 q1, #0xffff
545 ; CHECK-NEXT: vcvt.s32.f32 q0, q0
546 ; CHECK-NEXT: vmov.i32 q2, #0x0
547 ; CHECK-NEXT: vmin.s32 q0, q0, q1
548 ; CHECK-NEXT: vmax.s32 q0, q0, q2
551 %conv = fptosi <4 x float> %x to <4 x i32>
552 %0 = icmp slt <4 x i32> %conv, <i32 65535, i32 65535, i32 65535, i32 65535>
553 %spec.store.select = select <4 x i1> %0, <4 x i32> %conv, <4 x i32> <i32 65535, i32 65535, i32 65535, i32 65535>
554 %1 = icmp sgt <4 x i32> %spec.store.select, zeroinitializer
555 %spec.store.select7 = select <4 x i1> %1, <4 x i32> %spec.store.select, <4 x i32> zeroinitializer
556 %conv6 = trunc <4 x i32> %spec.store.select7 to <4 x i16>
560 define arm_aapcs_vfpcc <8 x i16> @stest_f16i16(<8 x half> %x) {
561 ; CHECK-LABEL: stest_f16i16:
562 ; CHECK: @ %bb.0: @ %entry
563 ; CHECK-NEXT: vcvt.s16.f16 q0, q0
566 %conv = fptosi <8 x half> %x to <8 x i32>
567 %0 = icmp slt <8 x i32> %conv, <i32 32767, i32 32767, i32 32767, i32 32767, i32 32767, i32 32767, i32 32767, i32 32767>
568 %spec.store.select = select <8 x i1> %0, <8 x i32> %conv, <8 x i32> <i32 32767, i32 32767, i32 32767, i32 32767, i32 32767, i32 32767, i32 32767, i32 32767>
569 %1 = icmp sgt <8 x i32> %spec.store.select, <i32 -32768, i32 -32768, i32 -32768, i32 -32768, i32 -32768, i32 -32768, i32 -32768, i32 -32768>
570 %spec.store.select7 = select <8 x i1> %1, <8 x i32> %spec.store.select, <8 x i32> <i32 -32768, i32 -32768, i32 -32768, i32 -32768, i32 -32768, i32 -32768, i32 -32768, i32 -32768>
571 %conv6 = trunc <8 x i32> %spec.store.select7 to <8 x i16>
575 define arm_aapcs_vfpcc <8 x i16> @utesth_f16i16(<8 x half> %x) {
576 ; CHECK-LABEL: utesth_f16i16:
577 ; CHECK: @ %bb.0: @ %entry
578 ; CHECK-NEXT: vmovx.f16 s6, s2
579 ; CHECK-NEXT: vcvt.u32.f16 s12, s2
580 ; CHECK-NEXT: vmovx.f16 s2, s0
581 ; CHECK-NEXT: vcvt.u32.f16 s0, s0
582 ; CHECK-NEXT: vcvt.u32.f16 s14, s2
583 ; CHECK-NEXT: vmov r0, s0
584 ; CHECK-NEXT: vmovx.f16 s4, s3
585 ; CHECK-NEXT: vmovx.f16 s10, s1
586 ; CHECK-NEXT: vcvt.u32.f16 s8, s3
587 ; CHECK-NEXT: vcvt.u32.f16 s5, s1
588 ; CHECK-NEXT: vmov.16 q0[0], r0
589 ; CHECK-NEXT: vmov r0, s14
590 ; CHECK-NEXT: vmov.16 q0[1], r0
591 ; CHECK-NEXT: vmov r0, s5
592 ; CHECK-NEXT: vcvt.u32.f16 s10, s10
593 ; CHECK-NEXT: vmov.16 q0[2], r0
594 ; CHECK-NEXT: vmov r0, s10
595 ; CHECK-NEXT: vcvt.u32.f16 s6, s6
596 ; CHECK-NEXT: vmov.16 q0[3], r0
597 ; CHECK-NEXT: vmov r0, s12
598 ; CHECK-NEXT: vmov.16 q0[4], r0
599 ; CHECK-NEXT: vmov r0, s6
600 ; CHECK-NEXT: vmov.16 q0[5], r0
601 ; CHECK-NEXT: vmov r0, s8
602 ; CHECK-NEXT: vcvt.u32.f16 s4, s4
603 ; CHECK-NEXT: vmov.16 q0[6], r0
604 ; CHECK-NEXT: vmov r0, s4
605 ; CHECK-NEXT: vmov.16 q0[7], r0
608 %conv = fptoui <8 x half> %x to <8 x i32>
609 %0 = icmp ult <8 x i32> %conv, <i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535>
610 %spec.store.select = select <8 x i1> %0, <8 x i32> %conv, <8 x i32> <i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535>
611 %conv6 = trunc <8 x i32> %spec.store.select to <8 x i16>
615 define arm_aapcs_vfpcc <8 x i16> @ustest_f16i16(<8 x half> %x) {
616 ; CHECK-LABEL: ustest_f16i16:
617 ; CHECK: @ %bb.0: @ %entry
618 ; CHECK-NEXT: .vsave {d8, d9}
619 ; CHECK-NEXT: vpush {d8, d9}
620 ; CHECK-NEXT: .pad #16
621 ; CHECK-NEXT: sub sp, #16
622 ; CHECK-NEXT: vmovx.f16 s6, s0
623 ; CHECK-NEXT: vcvt.s32.f16 s10, s0
624 ; CHECK-NEXT: vmovx.f16 s0, s3
625 ; CHECK-NEXT: vcvt.s32.f16 s5, s3
626 ; CHECK-NEXT: vcvt.s32.f16 s12, s0
627 ; CHECK-NEXT: vmovx.f16 s0, s2
628 ; CHECK-NEXT: vcvt.s32.f16 s7, s2
629 ; CHECK-NEXT: vcvt.s32.f16 s14, s0
630 ; CHECK-NEXT: vmov r1, s5
631 ; CHECK-NEXT: vmovx.f16 s4, s1
632 ; CHECK-NEXT: vmov r2, s7
633 ; CHECK-NEXT: vcvt.s32.f16 s8, s1
634 ; CHECK-NEXT: vmov q4[2], q4[0], r2, r1
635 ; CHECK-NEXT: vmov r1, s12
636 ; CHECK-NEXT: vmov r2, s14
637 ; CHECK-NEXT: vcvt.s32.f16 s4, s4
638 ; CHECK-NEXT: vmov q4[3], q4[1], r2, r1
639 ; CHECK-NEXT: vcvt.s32.f16 s6, s6
640 ; CHECK-NEXT: vmov r1, s8
641 ; CHECK-NEXT: vmov.i32 q0, #0x0
642 ; CHECK-NEXT: vmov r2, s10
643 ; CHECK-NEXT: mov r0, sp
644 ; CHECK-NEXT: vmov q2[2], q2[0], r2, r1
645 ; CHECK-NEXT: vmov r1, s4
646 ; CHECK-NEXT: vmov r2, s6
647 ; CHECK-NEXT: vmax.s32 q3, q4, q0
648 ; CHECK-NEXT: vmov q2[3], q2[1], r2, r1
649 ; CHECK-NEXT: vstrh.32 q3, [r0, #8]
650 ; CHECK-NEXT: vmax.s32 q0, q2, q0
651 ; CHECK-NEXT: vstrh.32 q0, [r0]
652 ; CHECK-NEXT: vldrw.u32 q0, [r0]
653 ; CHECK-NEXT: add sp, #16
654 ; CHECK-NEXT: vpop {d8, d9}
657 %conv = fptosi <8 x half> %x to <8 x i32>
658 %0 = icmp slt <8 x i32> %conv, <i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535>
659 %spec.store.select = select <8 x i1> %0, <8 x i32> %conv, <8 x i32> <i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535>
660 %1 = icmp sgt <8 x i32> %spec.store.select, zeroinitializer
661 %spec.store.select7 = select <8 x i1> %1, <8 x i32> %spec.store.select, <8 x i32> zeroinitializer
662 %conv6 = trunc <8 x i32> %spec.store.select7 to <8 x i16>
668 define arm_aapcs_vfpcc <2 x i64> @stest_f64i64(<2 x double> %x) {
669 ; CHECK-LABEL: stest_f64i64:
670 ; CHECK: @ %bb.0: @ %entry
671 ; CHECK-NEXT: .save {r4, r5, r6, r7, r8, r9, lr}
672 ; CHECK-NEXT: push.w {r4, r5, r6, r7, r8, r9, lr}
673 ; CHECK-NEXT: .pad #4
674 ; CHECK-NEXT: sub sp, #4
675 ; CHECK-NEXT: .vsave {d8, d9}
676 ; CHECK-NEXT: vpush {d8, d9}
677 ; CHECK-NEXT: vmov q4, q0
678 ; CHECK-NEXT: vmov r0, r1, d8
679 ; CHECK-NEXT: bl __fixdfti
680 ; CHECK-NEXT: vmov r12, lr, d9
681 ; CHECK-NEXT: subs.w r5, r0, #-1
682 ; CHECK-NEXT: mvn r4, #-2147483648
683 ; CHECK-NEXT: sbcs.w r5, r1, r4
684 ; CHECK-NEXT: sbcs r5, r2, #0
685 ; CHECK-NEXT: mov.w r7, #-2147483648
686 ; CHECK-NEXT: sbcs r5, r3, #0
687 ; CHECK-NEXT: cset r5, lt
688 ; CHECK-NEXT: cmp r5, #0
689 ; CHECK-NEXT: csel r3, r3, r5, ne
690 ; CHECK-NEXT: csel r2, r2, r5, ne
691 ; CHECK-NEXT: mov.w r5, #-1
692 ; CHECK-NEXT: csel r1, r1, r4, ne
693 ; CHECK-NEXT: csel r0, r0, r5, ne
694 ; CHECK-NEXT: rsbs r6, r0, #0
695 ; CHECK-NEXT: sbcs.w r6, r7, r1
696 ; CHECK-NEXT: sbcs.w r2, r5, r2
697 ; CHECK-NEXT: sbcs.w r2, r5, r3
698 ; CHECK-NEXT: csel r8, r1, r7, lt
699 ; CHECK-NEXT: cset r1, lt
700 ; CHECK-NEXT: cmp r1, #0
701 ; CHECK-NEXT: csel r9, r0, r1, ne
702 ; CHECK-NEXT: mov r0, r12
703 ; CHECK-NEXT: mov r1, lr
704 ; CHECK-NEXT: bl __fixdfti
705 ; CHECK-NEXT: subs.w r6, r0, #-1
706 ; CHECK-NEXT: sbcs.w r6, r1, r4
707 ; CHECK-NEXT: sbcs r6, r2, #0
708 ; CHECK-NEXT: sbcs r6, r3, #0
709 ; CHECK-NEXT: cset r6, lt
710 ; CHECK-NEXT: cmp r6, #0
711 ; CHECK-NEXT: csel r0, r0, r5, ne
712 ; CHECK-NEXT: csel r3, r3, r6, ne
713 ; CHECK-NEXT: csel r2, r2, r6, ne
714 ; CHECK-NEXT: csel r1, r1, r4, ne
715 ; CHECK-NEXT: rsbs r6, r0, #0
716 ; CHECK-NEXT: sbcs.w r6, r7, r1
717 ; CHECK-NEXT: sbcs.w r2, r5, r2
718 ; CHECK-NEXT: sbcs.w r2, r5, r3
719 ; CHECK-NEXT: cset r2, lt
720 ; CHECK-NEXT: csel r1, r1, r7, lt
721 ; CHECK-NEXT: cmp r2, #0
722 ; CHECK-NEXT: csel r0, r0, r2, ne
723 ; CHECK-NEXT: vmov q0[2], q0[0], r9, r0
724 ; CHECK-NEXT: vmov q0[3], q0[1], r8, r1
725 ; CHECK-NEXT: vpop {d8, d9}
726 ; CHECK-NEXT: add sp, #4
727 ; CHECK-NEXT: pop.w {r4, r5, r6, r7, r8, r9, pc}
729 %conv = fptosi <2 x double> %x to <2 x i128>
730 %0 = icmp slt <2 x i128> %conv, <i128 9223372036854775807, i128 9223372036854775807>
731 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 9223372036854775807, i128 9223372036854775807>
732 %1 = icmp sgt <2 x i128> %spec.store.select, <i128 -9223372036854775808, i128 -9223372036854775808>
733 %spec.store.select7 = select <2 x i1> %1, <2 x i128> %spec.store.select, <2 x i128> <i128 -9223372036854775808, i128 -9223372036854775808>
734 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
738 define arm_aapcs_vfpcc <2 x i64> @utest_f64i64(<2 x double> %x) {
739 ; CHECK-LABEL: utest_f64i64:
740 ; CHECK: @ %bb.0: @ %entry
741 ; CHECK-NEXT: .save {r4, r5, r7, lr}
742 ; CHECK-NEXT: push {r4, r5, r7, lr}
743 ; CHECK-NEXT: .vsave {d8, d9}
744 ; CHECK-NEXT: vpush {d8, d9}
745 ; CHECK-NEXT: vmov q4, q0
746 ; CHECK-NEXT: vmov r0, r1, d9
747 ; CHECK-NEXT: bl __fixunsdfti
748 ; CHECK-NEXT: vmov r12, lr, d8
749 ; CHECK-NEXT: subs r2, #1
750 ; CHECK-NEXT: sbcs r2, r3, #0
751 ; CHECK-NEXT: cset r2, lo
752 ; CHECK-NEXT: cmp r2, #0
753 ; CHECK-NEXT: csel r4, r1, r2, ne
754 ; CHECK-NEXT: csel r5, r0, r2, ne
755 ; CHECK-NEXT: mov r0, r12
756 ; CHECK-NEXT: mov r1, lr
757 ; CHECK-NEXT: bl __fixunsdfti
758 ; CHECK-NEXT: subs r2, #1
759 ; CHECK-NEXT: sbcs r2, r3, #0
760 ; CHECK-NEXT: cset r2, lo
761 ; CHECK-NEXT: cmp r2, #0
762 ; CHECK-NEXT: csel r0, r0, r2, ne
763 ; CHECK-NEXT: csel r1, r1, r2, ne
764 ; CHECK-NEXT: vmov q0[2], q0[0], r0, r5
765 ; CHECK-NEXT: vmov q0[3], q0[1], r1, r4
766 ; CHECK-NEXT: vpop {d8, d9}
767 ; CHECK-NEXT: pop {r4, r5, r7, pc}
769 %conv = fptoui <2 x double> %x to <2 x i128>
770 %0 = icmp ult <2 x i128> %conv, <i128 18446744073709551616, i128 18446744073709551616>
771 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>
772 %conv6 = trunc <2 x i128> %spec.store.select to <2 x i64>
776 define arm_aapcs_vfpcc <2 x i64> @ustest_f64i64(<2 x double> %x) {
777 ; CHECK-LABEL: ustest_f64i64:
778 ; CHECK: @ %bb.0: @ %entry
779 ; CHECK-NEXT: .save {r4, r5, r6, r7, r8, lr}
780 ; CHECK-NEXT: push.w {r4, r5, r6, r7, r8, lr}
781 ; CHECK-NEXT: .vsave {d8, d9}
782 ; CHECK-NEXT: vpush {d8, d9}
783 ; CHECK-NEXT: vmov q4, q0
784 ; CHECK-NEXT: vmov r0, r1, d9
785 ; CHECK-NEXT: bl __fixdfti
786 ; CHECK-NEXT: vmov r12, lr, d8
787 ; CHECK-NEXT: subs r4, r2, #1
788 ; CHECK-NEXT: sbcs r4, r3, #0
789 ; CHECK-NEXT: mov.w r8, #1
790 ; CHECK-NEXT: cset r4, lt
791 ; CHECK-NEXT: cmp r4, #0
792 ; CHECK-NEXT: csel r0, r0, r4, ne
793 ; CHECK-NEXT: csel r3, r3, r4, ne
794 ; CHECK-NEXT: csel r1, r1, r4, ne
795 ; CHECK-NEXT: csel r2, r2, r8, ne
796 ; CHECK-NEXT: rsbs r5, r0, #0
797 ; CHECK-NEXT: mov.w r4, #0
798 ; CHECK-NEXT: sbcs.w r5, r4, r1
799 ; CHECK-NEXT: sbcs.w r2, r4, r2
800 ; CHECK-NEXT: sbcs.w r2, r4, r3
801 ; CHECK-NEXT: cset r2, lt
802 ; CHECK-NEXT: cmp r2, #0
803 ; CHECK-NEXT: csel r5, r1, r2, ne
804 ; CHECK-NEXT: csel r7, r0, r2, ne
805 ; CHECK-NEXT: mov r0, r12
806 ; CHECK-NEXT: mov r1, lr
807 ; CHECK-NEXT: bl __fixdfti
808 ; CHECK-NEXT: subs r6, r2, #1
809 ; CHECK-NEXT: sbcs r6, r3, #0
810 ; CHECK-NEXT: cset r6, lt
811 ; CHECK-NEXT: cmp r6, #0
812 ; CHECK-NEXT: csel r0, r0, r6, ne
813 ; CHECK-NEXT: csel r3, r3, r6, ne
814 ; CHECK-NEXT: csel r1, r1, r6, ne
815 ; CHECK-NEXT: csel r2, r2, r8, ne
816 ; CHECK-NEXT: rsbs r6, r0, #0
817 ; CHECK-NEXT: sbcs.w r6, r4, r1
818 ; CHECK-NEXT: sbcs.w r2, r4, r2
819 ; CHECK-NEXT: sbcs.w r2, r4, r3
820 ; CHECK-NEXT: cset r2, lt
821 ; CHECK-NEXT: cmp r2, #0
822 ; CHECK-NEXT: csel r0, r0, r2, ne
823 ; CHECK-NEXT: csel r1, r1, r2, ne
824 ; CHECK-NEXT: vmov q0[2], q0[0], r0, r7
825 ; CHECK-NEXT: vmov q0[3], q0[1], r1, r5
826 ; CHECK-NEXT: vpop {d8, d9}
827 ; CHECK-NEXT: pop.w {r4, r5, r6, r7, r8, pc}
829 %conv = fptosi <2 x double> %x to <2 x i128>
830 %0 = icmp slt <2 x i128> %conv, <i128 18446744073709551616, i128 18446744073709551616>
831 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>
832 %1 = icmp sgt <2 x i128> %spec.store.select, zeroinitializer
833 %spec.store.select7 = select <2 x i1> %1, <2 x i128> %spec.store.select, <2 x i128> zeroinitializer
834 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
838 define arm_aapcs_vfpcc <2 x i64> @stest_f32i64(<2 x float> %x) {
839 ; CHECK-LABEL: stest_f32i64:
840 ; CHECK: @ %bb.0: @ %entry
841 ; CHECK-NEXT: .save {r4, r5, r6, r7, r8, r9, r10, lr}
842 ; CHECK-NEXT: push.w {r4, r5, r6, r7, r8, r9, r10, lr}
843 ; CHECK-NEXT: vmov r0, r9, d0
844 ; CHECK-NEXT: bl __fixsfti
845 ; CHECK-NEXT: subs.w r7, r0, #-1
846 ; CHECK-NEXT: mvn r5, #-2147483648
847 ; CHECK-NEXT: sbcs.w r7, r1, r5
848 ; CHECK-NEXT: mov.w r6, #-1
849 ; CHECK-NEXT: sbcs r7, r2, #0
850 ; CHECK-NEXT: sbcs r7, r3, #0
851 ; CHECK-NEXT: cset r7, lt
852 ; CHECK-NEXT: cmp r7, #0
853 ; CHECK-NEXT: csel r0, r0, r6, ne
854 ; CHECK-NEXT: csel r3, r3, r7, ne
855 ; CHECK-NEXT: csel r2, r2, r7, ne
856 ; CHECK-NEXT: csel r1, r1, r5, ne
857 ; CHECK-NEXT: rsbs r4, r0, #0
858 ; CHECK-NEXT: mov.w r7, #-2147483648
859 ; CHECK-NEXT: sbcs.w r4, r7, r1
860 ; CHECK-NEXT: sbcs.w r2, r6, r2
861 ; CHECK-NEXT: sbcs.w r2, r6, r3
862 ; CHECK-NEXT: csel r8, r1, r7, lt
863 ; CHECK-NEXT: cset r1, lt
864 ; CHECK-NEXT: cmp r1, #0
865 ; CHECK-NEXT: csel r10, r0, r1, ne
866 ; CHECK-NEXT: mov r0, r9
867 ; CHECK-NEXT: bl __fixsfti
868 ; CHECK-NEXT: subs.w r4, r0, #-1
869 ; CHECK-NEXT: sbcs.w r4, r1, r5
870 ; CHECK-NEXT: sbcs r4, r2, #0
871 ; CHECK-NEXT: sbcs r4, r3, #0
872 ; CHECK-NEXT: cset r4, lt
873 ; CHECK-NEXT: cmp r4, #0
874 ; CHECK-NEXT: csel r0, r0, r6, ne
875 ; CHECK-NEXT: csel r3, r3, r4, ne
876 ; CHECK-NEXT: csel r2, r2, r4, ne
877 ; CHECK-NEXT: csel r1, r1, r5, ne
878 ; CHECK-NEXT: rsbs r5, r0, #0
879 ; CHECK-NEXT: sbcs.w r5, r7, r1
880 ; CHECK-NEXT: sbcs.w r2, r6, r2
881 ; CHECK-NEXT: sbcs.w r2, r6, r3
882 ; CHECK-NEXT: cset r2, lt
883 ; CHECK-NEXT: csel r1, r1, r7, lt
884 ; CHECK-NEXT: cmp r2, #0
885 ; CHECK-NEXT: csel r0, r0, r2, ne
886 ; CHECK-NEXT: vmov q0[2], q0[0], r10, r0
887 ; CHECK-NEXT: vmov q0[3], q0[1], r8, r1
888 ; CHECK-NEXT: pop.w {r4, r5, r6, r7, r8, r9, r10, pc}
890 %conv = fptosi <2 x float> %x to <2 x i128>
891 %0 = icmp slt <2 x i128> %conv, <i128 9223372036854775807, i128 9223372036854775807>
892 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 9223372036854775807, i128 9223372036854775807>
893 %1 = icmp sgt <2 x i128> %spec.store.select, <i128 -9223372036854775808, i128 -9223372036854775808>
894 %spec.store.select7 = select <2 x i1> %1, <2 x i128> %spec.store.select, <2 x i128> <i128 -9223372036854775808, i128 -9223372036854775808>
895 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
899 define arm_aapcs_vfpcc <2 x i64> @utest_f32i64(<2 x float> %x) {
900 ; CHECK-LABEL: utest_f32i64:
901 ; CHECK: @ %bb.0: @ %entry
902 ; CHECK-NEXT: .save {r4, r5, r6, lr}
903 ; CHECK-NEXT: push {r4, r5, r6, lr}
904 ; CHECK-NEXT: vmov r4, r0, d0
905 ; CHECK-NEXT: bl __fixunssfti
906 ; CHECK-NEXT: subs r2, #1
907 ; CHECK-NEXT: sbcs r2, r3, #0
908 ; CHECK-NEXT: cset r2, lo
909 ; CHECK-NEXT: cmp r2, #0
910 ; CHECK-NEXT: csel r6, r0, r2, ne
911 ; CHECK-NEXT: mov r0, r4
912 ; CHECK-NEXT: csel r5, r1, r2, ne
913 ; CHECK-NEXT: bl __fixunssfti
914 ; CHECK-NEXT: subs r2, #1
915 ; CHECK-NEXT: sbcs r2, r3, #0
916 ; CHECK-NEXT: cset r2, lo
917 ; CHECK-NEXT: cmp r2, #0
918 ; CHECK-NEXT: csel r0, r0, r2, ne
919 ; CHECK-NEXT: csel r1, r1, r2, ne
920 ; CHECK-NEXT: vmov q0[2], q0[0], r0, r6
921 ; CHECK-NEXT: vmov q0[3], q0[1], r1, r5
922 ; CHECK-NEXT: pop {r4, r5, r6, pc}
924 %conv = fptoui <2 x float> %x to <2 x i128>
925 %0 = icmp ult <2 x i128> %conv, <i128 18446744073709551616, i128 18446744073709551616>
926 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>
927 %conv6 = trunc <2 x i128> %spec.store.select to <2 x i64>
931 define arm_aapcs_vfpcc <2 x i64> @ustest_f32i64(<2 x float> %x) {
932 ; CHECK-LABEL: ustest_f32i64:
933 ; CHECK: @ %bb.0: @ %entry
934 ; CHECK-NEXT: .save {r4, r5, r6, r7, r8, lr}
935 ; CHECK-NEXT: push.w {r4, r5, r6, r7, r8, lr}
936 ; CHECK-NEXT: vmov r5, r0, d0
937 ; CHECK-NEXT: bl __fixsfti
938 ; CHECK-NEXT: subs r4, r2, #1
939 ; CHECK-NEXT: mov.w r8, #1
940 ; CHECK-NEXT: sbcs r4, r3, #0
941 ; CHECK-NEXT: mov.w r6, #0
942 ; CHECK-NEXT: cset r4, lt
943 ; CHECK-NEXT: cmp r4, #0
944 ; CHECK-NEXT: csel r0, r0, r4, ne
945 ; CHECK-NEXT: csel r3, r3, r4, ne
946 ; CHECK-NEXT: csel r1, r1, r4, ne
947 ; CHECK-NEXT: csel r2, r2, r8, ne
948 ; CHECK-NEXT: rsbs r4, r0, #0
949 ; CHECK-NEXT: sbcs.w r4, r6, r1
950 ; CHECK-NEXT: sbcs.w r2, r6, r2
951 ; CHECK-NEXT: sbcs.w r2, r6, r3
952 ; CHECK-NEXT: cset r2, lt
953 ; CHECK-NEXT: cmp r2, #0
954 ; CHECK-NEXT: csel r7, r0, r2, ne
955 ; CHECK-NEXT: mov r0, r5
956 ; CHECK-NEXT: csel r4, r1, r2, ne
957 ; CHECK-NEXT: bl __fixsfti
958 ; CHECK-NEXT: subs r5, r2, #1
959 ; CHECK-NEXT: sbcs r5, r3, #0
960 ; CHECK-NEXT: cset r5, lt
961 ; CHECK-NEXT: cmp r5, #0
962 ; CHECK-NEXT: csel r0, r0, r5, ne
963 ; CHECK-NEXT: csel r3, r3, r5, ne
964 ; CHECK-NEXT: csel r1, r1, r5, ne
965 ; CHECK-NEXT: csel r2, r2, r8, ne
966 ; CHECK-NEXT: rsbs r5, r0, #0
967 ; CHECK-NEXT: sbcs.w r5, r6, r1
968 ; CHECK-NEXT: sbcs.w r2, r6, r2
969 ; CHECK-NEXT: sbcs.w r2, r6, r3
970 ; CHECK-NEXT: cset r2, lt
971 ; CHECK-NEXT: cmp r2, #0
972 ; CHECK-NEXT: csel r0, r0, r2, ne
973 ; CHECK-NEXT: csel r1, r1, r2, ne
974 ; CHECK-NEXT: vmov q0[2], q0[0], r0, r7
975 ; CHECK-NEXT: vmov q0[3], q0[1], r1, r4
976 ; CHECK-NEXT: pop.w {r4, r5, r6, r7, r8, pc}
978 %conv = fptosi <2 x float> %x to <2 x i128>
979 %0 = icmp slt <2 x i128> %conv, <i128 18446744073709551616, i128 18446744073709551616>
980 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>
981 %1 = icmp sgt <2 x i128> %spec.store.select, zeroinitializer
982 %spec.store.select7 = select <2 x i1> %1, <2 x i128> %spec.store.select, <2 x i128> zeroinitializer
983 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
987 define arm_aapcs_vfpcc <2 x i64> @stest_f16i64(<2 x half> %x) {
988 ; CHECK-LABEL: stest_f16i64:
989 ; CHECK: @ %bb.0: @ %entry
990 ; CHECK-NEXT: .save {r4, r5, r7, lr}
991 ; CHECK-NEXT: push {r4, r5, r7, lr}
992 ; CHECK-NEXT: .vsave {d8, d9}
993 ; CHECK-NEXT: vpush {d8, d9}
994 ; CHECK-NEXT: vmov.u16 r0, q0[1]
995 ; CHECK-NEXT: vmov q4, q0
996 ; CHECK-NEXT: bl __fixhfti
997 ; CHECK-NEXT: mov r4, r0
998 ; CHECK-NEXT: vmov.u16 r0, q4[0]
999 ; CHECK-NEXT: mov r5, r1
1000 ; CHECK-NEXT: bl __fixhfti
1001 ; CHECK-NEXT: vmov q0[2], q0[0], r0, r4
1002 ; CHECK-NEXT: vmov q0[3], q0[1], r1, r5
1003 ; CHECK-NEXT: vpop {d8, d9}
1004 ; CHECK-NEXT: pop {r4, r5, r7, pc}
1006 %conv = fptosi <2 x half> %x to <2 x i128>
1007 %0 = icmp slt <2 x i128> %conv, <i128 9223372036854775807, i128 9223372036854775807>
1008 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 9223372036854775807, i128 9223372036854775807>
1009 %1 = icmp sgt <2 x i128> %spec.store.select, <i128 -9223372036854775808, i128 -9223372036854775808>
1010 %spec.store.select7 = select <2 x i1> %1, <2 x i128> %spec.store.select, <2 x i128> <i128 -9223372036854775808, i128 -9223372036854775808>
1011 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
1012 ret <2 x i64> %conv6
1015 define arm_aapcs_vfpcc <2 x i64> @utesth_f16i64(<2 x half> %x) {
1016 ; CHECK-LABEL: utesth_f16i64:
1017 ; CHECK: @ %bb.0: @ %entry
1018 ; CHECK-NEXT: .save {r4, r5, r7, lr}
1019 ; CHECK-NEXT: push {r4, r5, r7, lr}
1020 ; CHECK-NEXT: .vsave {d8, d9}
1021 ; CHECK-NEXT: vpush {d8, d9}
1022 ; CHECK-NEXT: vmov.u16 r0, q0[1]
1023 ; CHECK-NEXT: vmov q4, q0
1024 ; CHECK-NEXT: bl __fixunshfti
1025 ; CHECK-NEXT: mov r4, r0
1026 ; CHECK-NEXT: vmov.u16 r0, q4[0]
1027 ; CHECK-NEXT: mov r5, r1
1028 ; CHECK-NEXT: bl __fixunshfti
1029 ; CHECK-NEXT: vmov q0[2], q0[0], r0, r4
1030 ; CHECK-NEXT: vmov q0[3], q0[1], r1, r5
1031 ; CHECK-NEXT: vpop {d8, d9}
1032 ; CHECK-NEXT: pop {r4, r5, r7, pc}
1034 %conv = fptoui <2 x half> %x to <2 x i128>
1035 %0 = icmp ult <2 x i128> %conv, <i128 18446744073709551616, i128 18446744073709551616>
1036 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>
1037 %conv6 = trunc <2 x i128> %spec.store.select to <2 x i64>
1038 ret <2 x i64> %conv6
1041 define arm_aapcs_vfpcc <2 x i64> @ustest_f16i64(<2 x half> %x) {
1042 ; CHECK-LABEL: ustest_f16i64:
1043 ; CHECK: @ %bb.0: @ %entry
1044 ; CHECK-NEXT: .save {r4, r5, r6, r7, lr}
1045 ; CHECK-NEXT: push {r4, r5, r6, r7, lr}
1046 ; CHECK-NEXT: .pad #4
1047 ; CHECK-NEXT: sub sp, #4
1048 ; CHECK-NEXT: .vsave {d8, d9}
1049 ; CHECK-NEXT: vpush {d8, d9}
1050 ; CHECK-NEXT: vmov.u16 r0, q0[1]
1051 ; CHECK-NEXT: vmov q4, q0
1052 ; CHECK-NEXT: bl __fixhfti
1053 ; CHECK-NEXT: rsbs r4, r0, #0
1054 ; CHECK-NEXT: mov.w r5, #0
1055 ; CHECK-NEXT: sbcs.w r4, r5, r1
1056 ; CHECK-NEXT: sbcs.w r2, r5, r2
1057 ; CHECK-NEXT: sbcs.w r2, r5, r3
1058 ; CHECK-NEXT: cset r2, lt
1059 ; CHECK-NEXT: cmp r2, #0
1060 ; CHECK-NEXT: csel r6, r0, r2, ne
1061 ; CHECK-NEXT: vmov.u16 r0, q4[0]
1062 ; CHECK-NEXT: csel r7, r1, r2, ne
1063 ; CHECK-NEXT: bl __fixhfti
1064 ; CHECK-NEXT: rsbs r4, r0, #0
1065 ; CHECK-NEXT: sbcs.w r4, r5, r1
1066 ; CHECK-NEXT: sbcs.w r2, r5, r2
1067 ; CHECK-NEXT: sbcs.w r2, r5, r3
1068 ; CHECK-NEXT: cset r2, lt
1069 ; CHECK-NEXT: cmp r2, #0
1070 ; CHECK-NEXT: csel r0, r0, r2, ne
1071 ; CHECK-NEXT: csel r1, r1, r2, ne
1072 ; CHECK-NEXT: vmov q0[2], q0[0], r0, r6
1073 ; CHECK-NEXT: vmov q0[3], q0[1], r1, r7
1074 ; CHECK-NEXT: vpop {d8, d9}
1075 ; CHECK-NEXT: add sp, #4
1076 ; CHECK-NEXT: pop {r4, r5, r6, r7, pc}
1078 %conv = fptosi <2 x half> %x to <2 x i128>
1079 %0 = icmp slt <2 x i128> %conv, <i128 18446744073709551616, i128 18446744073709551616>
1080 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>
1081 %1 = icmp sgt <2 x i128> %spec.store.select, zeroinitializer
1082 %spec.store.select7 = select <2 x i1> %1, <2 x i128> %spec.store.select, <2 x i128> zeroinitializer
1083 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
1084 ret <2 x i64> %conv6
1091 define arm_aapcs_vfpcc <2 x i32> @stest_f64i32_mm(<2 x double> %x) {
1092 ; CHECK-LABEL: stest_f64i32_mm:
1093 ; CHECK: @ %bb.0: @ %entry
1094 ; CHECK-NEXT: .save {r4, r5, r7, lr}
1095 ; CHECK-NEXT: push {r4, r5, r7, lr}
1096 ; CHECK-NEXT: .vsave {d8, d9}
1097 ; CHECK-NEXT: vpush {d8, d9}
1098 ; CHECK-NEXT: vmov q4, q0
1099 ; CHECK-NEXT: vmov r0, r1, d8
1100 ; CHECK-NEXT: bl __aeabi_d2lz
1101 ; CHECK-NEXT: mov r4, r0
1102 ; CHECK-NEXT: mov r5, r1
1103 ; CHECK-NEXT: vmov r0, r1, d9
1104 ; CHECK-NEXT: bl __aeabi_d2lz
1105 ; CHECK-NEXT: adr r3, .LCPI27_0
1106 ; CHECK-NEXT: mvn r12, #-2147483648
1107 ; CHECK-NEXT: vldrw.u32 q0, [r3]
1108 ; CHECK-NEXT: subs.w r3, r4, r12
1109 ; CHECK-NEXT: sbcs r3, r5, #0
1110 ; CHECK-NEXT: vmov q1[2], q1[0], r4, r0
1111 ; CHECK-NEXT: csetm r3, lt
1112 ; CHECK-NEXT: subs.w r0, r0, r12
1113 ; CHECK-NEXT: sbcs r0, r1, #0
1114 ; CHECK-NEXT: vmov q1[3], q1[1], r5, r1
1115 ; CHECK-NEXT: mov.w r5, #0
1116 ; CHECK-NEXT: csetm r0, lt
1117 ; CHECK-NEXT: bfi r5, r3, #0, #8
1118 ; CHECK-NEXT: mov.w r12, #-1
1119 ; CHECK-NEXT: bfi r5, r0, #8, #8
1120 ; CHECK-NEXT: movs r2, #0
1121 ; CHECK-NEXT: vmsr p0, r5
1122 ; CHECK-NEXT: adr r4, .LCPI27_1
1123 ; CHECK-NEXT: vpsel q0, q1, q0
1124 ; CHECK-NEXT: vldrw.u32 q1, [r4]
1125 ; CHECK-NEXT: vmov r0, r1, d0
1126 ; CHECK-NEXT: vmov r3, r5, d1
1127 ; CHECK-NEXT: rsbs.w r0, r0, #-2147483648
1128 ; CHECK-NEXT: sbcs.w r0, r12, r1
1129 ; CHECK-NEXT: csetm r0, lt
1130 ; CHECK-NEXT: bfi r2, r0, #0, #8
1131 ; CHECK-NEXT: rsbs.w r0, r3, #-2147483648
1132 ; CHECK-NEXT: sbcs.w r0, r12, r5
1133 ; CHECK-NEXT: csetm r0, lt
1134 ; CHECK-NEXT: bfi r2, r0, #8, #8
1135 ; CHECK-NEXT: vmsr p0, r2
1136 ; CHECK-NEXT: vpsel q0, q0, q1
1137 ; CHECK-NEXT: vpop {d8, d9}
1138 ; CHECK-NEXT: pop {r4, r5, r7, pc}
1139 ; CHECK-NEXT: .p2align 4
1140 ; CHECK-NEXT: @ %bb.1:
1141 ; CHECK-NEXT: .LCPI27_0:
1142 ; CHECK-NEXT: .long 2147483647 @ 0x7fffffff
1143 ; CHECK-NEXT: .long 0 @ 0x0
1144 ; CHECK-NEXT: .long 2147483647 @ 0x7fffffff
1145 ; CHECK-NEXT: .long 0 @ 0x0
1146 ; CHECK-NEXT: .LCPI27_1:
1147 ; CHECK-NEXT: .long 2147483648 @ 0x80000000
1148 ; CHECK-NEXT: .long 4294967295 @ 0xffffffff
1149 ; CHECK-NEXT: .long 2147483648 @ 0x80000000
1150 ; CHECK-NEXT: .long 4294967295 @ 0xffffffff
1152 %conv = fptosi <2 x double> %x to <2 x i64>
1153 %spec.store.select = call <2 x i64> @llvm.smin.v2i64(<2 x i64> %conv, <2 x i64> <i64 2147483647, i64 2147483647>)
1154 %spec.store.select7 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %spec.store.select, <2 x i64> <i64 -2147483648, i64 -2147483648>)
1155 %conv6 = trunc <2 x i64> %spec.store.select7 to <2 x i32>
1156 ret <2 x i32> %conv6
1159 define arm_aapcs_vfpcc <2 x i32> @utest_f64i32_mm(<2 x double> %x) {
1160 ; CHECK-LABEL: utest_f64i32_mm:
1161 ; CHECK: @ %bb.0: @ %entry
1162 ; CHECK-NEXT: .save {r4, r5, r7, lr}
1163 ; CHECK-NEXT: push {r4, r5, r7, lr}
1164 ; CHECK-NEXT: .vsave {d8, d9}
1165 ; CHECK-NEXT: vpush {d8, d9}
1166 ; CHECK-NEXT: vmov q4, q0
1167 ; CHECK-NEXT: vmov r0, r1, d8
1168 ; CHECK-NEXT: bl __aeabi_d2ulz
1169 ; CHECK-NEXT: mov r4, r0
1170 ; CHECK-NEXT: mov r5, r1
1171 ; CHECK-NEXT: vmov r0, r1, d9
1172 ; CHECK-NEXT: bl __aeabi_d2ulz
1173 ; CHECK-NEXT: subs.w r3, r4, #-1
1174 ; CHECK-NEXT: vmov q1[2], q1[0], r4, r0
1175 ; CHECK-NEXT: sbcs r3, r5, #0
1176 ; CHECK-NEXT: mov.w r2, #0
1177 ; CHECK-NEXT: csetm r3, lo
1178 ; CHECK-NEXT: subs.w r0, r0, #-1
1179 ; CHECK-NEXT: sbcs r0, r1, #0
1180 ; CHECK-NEXT: bfi r2, r3, #0, #8
1181 ; CHECK-NEXT: csetm r0, lo
1182 ; CHECK-NEXT: vmov.i64 q0, #0xffffffff
1183 ; CHECK-NEXT: bfi r2, r0, #8, #8
1184 ; CHECK-NEXT: vmov q1[3], q1[1], r5, r1
1185 ; CHECK-NEXT: vmsr p0, r2
1186 ; CHECK-NEXT: vpsel q0, q1, q0
1187 ; CHECK-NEXT: vpop {d8, d9}
1188 ; CHECK-NEXT: pop {r4, r5, r7, pc}
1190 %conv = fptoui <2 x double> %x to <2 x i64>
1191 %spec.store.select = call <2 x i64> @llvm.umin.v2i64(<2 x i64> %conv, <2 x i64> <i64 4294967295, i64 4294967295>)
1192 %conv6 = trunc <2 x i64> %spec.store.select to <2 x i32>
1193 ret <2 x i32> %conv6
1196 define arm_aapcs_vfpcc <2 x i32> @ustest_f64i32_mm(<2 x double> %x) {
1197 ; CHECK-LABEL: ustest_f64i32_mm:
1198 ; CHECK: @ %bb.0: @ %entry
1199 ; CHECK-NEXT: .save {r4, r5, r7, lr}
1200 ; CHECK-NEXT: push {r4, r5, r7, lr}
1201 ; CHECK-NEXT: .vsave {d8, d9}
1202 ; CHECK-NEXT: vpush {d8, d9}
1203 ; CHECK-NEXT: vmov q4, q0
1204 ; CHECK-NEXT: vmov r0, r1, d8
1205 ; CHECK-NEXT: bl __aeabi_d2lz
1206 ; CHECK-NEXT: mov r4, r0
1207 ; CHECK-NEXT: mov r5, r1
1208 ; CHECK-NEXT: vmov r0, r1, d9
1209 ; CHECK-NEXT: bl __aeabi_d2lz
1210 ; CHECK-NEXT: subs.w r3, r4, #-1
1211 ; CHECK-NEXT: vmov q1[2], q1[0], r4, r0
1212 ; CHECK-NEXT: sbcs r3, r5, #0
1213 ; CHECK-NEXT: vmov q1[3], q1[1], r5, r1
1214 ; CHECK-NEXT: csetm r3, lt
1215 ; CHECK-NEXT: subs.w r0, r0, #-1
1216 ; CHECK-NEXT: mov.w r5, #0
1217 ; CHECK-NEXT: sbcs r0, r1, #0
1218 ; CHECK-NEXT: bfi r5, r3, #0, #8
1219 ; CHECK-NEXT: csetm r0, lt
1220 ; CHECK-NEXT: bfi r5, r0, #8, #8
1221 ; CHECK-NEXT: vmov.i64 q0, #0xffffffff
1222 ; CHECK-NEXT: vmsr p0, r5
1223 ; CHECK-NEXT: movs r2, #0
1224 ; CHECK-NEXT: vpsel q0, q1, q0
1225 ; CHECK-NEXT: vmov.i32 q1, #0x0
1226 ; CHECK-NEXT: vmov r0, r1, d0
1227 ; CHECK-NEXT: vmov r3, r5, d1
1228 ; CHECK-NEXT: rsbs r0, r0, #0
1229 ; CHECK-NEXT: sbcs.w r0, r2, r1
1230 ; CHECK-NEXT: csetm r0, lt
1231 ; CHECK-NEXT: rsbs r1, r3, #0
1232 ; CHECK-NEXT: sbcs.w r1, r2, r5
1233 ; CHECK-NEXT: bfi r2, r0, #0, #8
1234 ; CHECK-NEXT: csetm r0, lt
1235 ; CHECK-NEXT: bfi r2, r0, #8, #8
1236 ; CHECK-NEXT: vmsr p0, r2
1237 ; CHECK-NEXT: vpsel q0, q0, q1
1238 ; CHECK-NEXT: vpop {d8, d9}
1239 ; CHECK-NEXT: pop {r4, r5, r7, pc}
1241 %conv = fptosi <2 x double> %x to <2 x i64>
1242 %spec.store.select = call <2 x i64> @llvm.smin.v2i64(<2 x i64> %conv, <2 x i64> <i64 4294967295, i64 4294967295>)
1243 %spec.store.select7 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %spec.store.select, <2 x i64> zeroinitializer)
1244 %conv6 = trunc <2 x i64> %spec.store.select7 to <2 x i32>
1245 ret <2 x i32> %conv6
1248 define arm_aapcs_vfpcc <4 x i32> @stest_f32i32_mm(<4 x float> %x) {
1249 ; CHECK-LABEL: stest_f32i32_mm:
1250 ; CHECK: @ %bb.0: @ %entry
1251 ; CHECK-NEXT: vcvt.s32.f32 q0, q0
1254 %conv = fptosi <4 x float> %x to <4 x i64>
1255 %spec.store.select = call <4 x i64> @llvm.smin.v4i64(<4 x i64> %conv, <4 x i64> <i64 2147483647, i64 2147483647, i64 2147483647, i64 2147483647>)
1256 %spec.store.select7 = call <4 x i64> @llvm.smax.v4i64(<4 x i64> %spec.store.select, <4 x i64> <i64 -2147483648, i64 -2147483648, i64 -2147483648, i64 -2147483648>)
1257 %conv6 = trunc <4 x i64> %spec.store.select7 to <4 x i32>
1258 ret <4 x i32> %conv6
1261 define arm_aapcs_vfpcc <4 x i32> @utest_f32i32_mm(<4 x float> %x) {
1262 ; CHECK-LABEL: utest_f32i32_mm:
1263 ; CHECK: @ %bb.0: @ %entry
1264 ; CHECK-NEXT: vcvt.u32.f32 q0, q0
1267 %conv = fptoui <4 x float> %x to <4 x i64>
1268 %spec.store.select = call <4 x i64> @llvm.umin.v4i64(<4 x i64> %conv, <4 x i64> <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>)
1269 %conv6 = trunc <4 x i64> %spec.store.select to <4 x i32>
1270 ret <4 x i32> %conv6
1273 define arm_aapcs_vfpcc <4 x i32> @ustest_f32i32_mm(<4 x float> %x) {
1274 ; CHECK-LABEL: ustest_f32i32_mm:
1275 ; CHECK: @ %bb.0: @ %entry
1276 ; CHECK-NEXT: vcvt.u32.f32 q0, q0
1279 %conv = fptosi <4 x float> %x to <4 x i64>
1280 %spec.store.select = call <4 x i64> @llvm.smin.v4i64(<4 x i64> %conv, <4 x i64> <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>)
1281 %spec.store.select7 = call <4 x i64> @llvm.smax.v4i64(<4 x i64> %spec.store.select, <4 x i64> zeroinitializer)
1282 %conv6 = trunc <4 x i64> %spec.store.select7 to <4 x i32>
1283 ret <4 x i32> %conv6
1286 define arm_aapcs_vfpcc <4 x i32> @stest_f16i32_mm(<4 x half> %x) {
1287 ; CHECK-LABEL: stest_f16i32_mm:
1288 ; CHECK: @ %bb.0: @ %entry
1289 ; CHECK-NEXT: .save {r4, r5, r7, lr}
1290 ; CHECK-NEXT: push {r4, r5, r7, lr}
1291 ; CHECK-NEXT: .vsave {d8, d9, d10, d11}
1292 ; CHECK-NEXT: vpush {d8, d9, d10, d11}
1293 ; CHECK-NEXT: vmov.u16 r0, q0[3]
1294 ; CHECK-NEXT: vmov q4, q0
1295 ; CHECK-NEXT: bl __fixhfdi
1296 ; CHECK-NEXT: mov r4, r0
1297 ; CHECK-NEXT: vmov.u16 r0, q4[0]
1298 ; CHECK-NEXT: bl __fixhfdi
1299 ; CHECK-NEXT: mov r5, r0
1300 ; CHECK-NEXT: vmov.u16 r0, q4[2]
1301 ; CHECK-NEXT: bl __fixhfdi
1302 ; CHECK-NEXT: vmov q5[2], q5[0], r5, r0
1303 ; CHECK-NEXT: vmov.u16 r0, q4[1]
1304 ; CHECK-NEXT: bl __fixhfdi
1305 ; CHECK-NEXT: vmov q5[3], q5[1], r0, r4
1306 ; CHECK-NEXT: vmov q0, q5
1307 ; CHECK-NEXT: vpop {d8, d9, d10, d11}
1308 ; CHECK-NEXT: pop {r4, r5, r7, pc}
1310 %conv = fptosi <4 x half> %x to <4 x i64>
1311 %spec.store.select = call <4 x i64> @llvm.smin.v4i64(<4 x i64> %conv, <4 x i64> <i64 2147483647, i64 2147483647, i64 2147483647, i64 2147483647>)
1312 %spec.store.select7 = call <4 x i64> @llvm.smax.v4i64(<4 x i64> %spec.store.select, <4 x i64> <i64 -2147483648, i64 -2147483648, i64 -2147483648, i64 -2147483648>)
1313 %conv6 = trunc <4 x i64> %spec.store.select7 to <4 x i32>
1314 ret <4 x i32> %conv6
1317 define arm_aapcs_vfpcc <4 x i32> @utesth_f16i32_mm(<4 x half> %x) {
1318 ; CHECK-LABEL: utesth_f16i32_mm:
1319 ; CHECK: @ %bb.0: @ %entry
1320 ; CHECK-NEXT: .save {r4, r5, r7, lr}
1321 ; CHECK-NEXT: push {r4, r5, r7, lr}
1322 ; CHECK-NEXT: .vsave {d8, d9, d10, d11}
1323 ; CHECK-NEXT: vpush {d8, d9, d10, d11}
1324 ; CHECK-NEXT: vmov.u16 r0, q0[3]
1325 ; CHECK-NEXT: vmov q4, q0
1326 ; CHECK-NEXT: bl __fixunshfdi
1327 ; CHECK-NEXT: mov r4, r0
1328 ; CHECK-NEXT: vmov.u16 r0, q4[0]
1329 ; CHECK-NEXT: bl __fixunshfdi
1330 ; CHECK-NEXT: mov r5, r0
1331 ; CHECK-NEXT: vmov.u16 r0, q4[2]
1332 ; CHECK-NEXT: bl __fixunshfdi
1333 ; CHECK-NEXT: vmov q5[2], q5[0], r5, r0
1334 ; CHECK-NEXT: vmov.u16 r0, q4[1]
1335 ; CHECK-NEXT: bl __fixunshfdi
1336 ; CHECK-NEXT: vmov q5[3], q5[1], r0, r4
1337 ; CHECK-NEXT: vmov q0, q5
1338 ; CHECK-NEXT: vpop {d8, d9, d10, d11}
1339 ; CHECK-NEXT: pop {r4, r5, r7, pc}
1341 %conv = fptoui <4 x half> %x to <4 x i64>
1342 %spec.store.select = call <4 x i64> @llvm.umin.v4i64(<4 x i64> %conv, <4 x i64> <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>)
1343 %conv6 = trunc <4 x i64> %spec.store.select to <4 x i32>
1344 ret <4 x i32> %conv6
1347 define arm_aapcs_vfpcc <4 x i32> @ustest_f16i32_mm(<4 x half> %x) {
1348 ; CHECK-LABEL: ustest_f16i32_mm:
1349 ; CHECK: @ %bb.0: @ %entry
1350 ; CHECK-NEXT: .save {r4, r5, r6, lr}
1351 ; CHECK-NEXT: push {r4, r5, r6, lr}
1352 ; CHECK-NEXT: .vsave {d8, d9, d10, d11, d12, d13}
1353 ; CHECK-NEXT: vpush {d8, d9, d10, d11, d12, d13}
1354 ; CHECK-NEXT: vmov.u16 r0, q0[3]
1355 ; CHECK-NEXT: vmov q4, q0
1356 ; CHECK-NEXT: bl __fixhfdi
1357 ; CHECK-NEXT: mov r4, r0
1358 ; CHECK-NEXT: vmov.u16 r0, q4[2]
1359 ; CHECK-NEXT: mov r5, r1
1360 ; CHECK-NEXT: bl __fixhfdi
1361 ; CHECK-NEXT: rsbs r2, r0, #0
1362 ; CHECK-NEXT: mov.w r6, #0
1363 ; CHECK-NEXT: vmov q0[2], q0[0], r0, r4
1364 ; CHECK-NEXT: sbcs.w r0, r6, r1
1365 ; CHECK-NEXT: csetm r0, lt
1366 ; CHECK-NEXT: movs r1, #0
1367 ; CHECK-NEXT: bfi r1, r0, #0, #8
1368 ; CHECK-NEXT: rsbs r0, r4, #0
1369 ; CHECK-NEXT: sbcs.w r0, r6, r5
1370 ; CHECK-NEXT: vmov.i32 q5, #0x0
1371 ; CHECK-NEXT: csetm r0, lt
1372 ; CHECK-NEXT: bfi r1, r0, #8, #8
1373 ; CHECK-NEXT: vmov.u16 r0, q4[1]
1374 ; CHECK-NEXT: vmsr p0, r1
1375 ; CHECK-NEXT: vpsel q6, q0, q5
1376 ; CHECK-NEXT: bl __fixhfdi
1377 ; CHECK-NEXT: mov r4, r0
1378 ; CHECK-NEXT: vmov.u16 r0, q4[0]
1379 ; CHECK-NEXT: mov r5, r1
1380 ; CHECK-NEXT: bl __fixhfdi
1381 ; CHECK-NEXT: rsbs r2, r0, #0
1382 ; CHECK-NEXT: vmov q0[2], q0[0], r0, r4
1383 ; CHECK-NEXT: sbcs.w r0, r6, r1
1384 ; CHECK-NEXT: csetm r0, lt
1385 ; CHECK-NEXT: rsbs r1, r4, #0
1386 ; CHECK-NEXT: sbcs.w r1, r6, r5
1387 ; CHECK-NEXT: bfi r6, r0, #0, #8
1388 ; CHECK-NEXT: csetm r0, lt
1389 ; CHECK-NEXT: bfi r6, r0, #8, #8
1390 ; CHECK-NEXT: vmsr p0, r6
1391 ; CHECK-NEXT: vpsel q0, q0, q5
1392 ; CHECK-NEXT: vmov.f32 s1, s2
1393 ; CHECK-NEXT: vmov.f32 s2, s24
1394 ; CHECK-NEXT: vmov.f32 s3, s26
1395 ; CHECK-NEXT: vpop {d8, d9, d10, d11, d12, d13}
1396 ; CHECK-NEXT: pop {r4, r5, r6, pc}
1398 %conv = fptosi <4 x half> %x to <4 x i64>
1399 %spec.store.select = call <4 x i64> @llvm.smin.v4i64(<4 x i64> %conv, <4 x i64> <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>)
1400 %spec.store.select7 = call <4 x i64> @llvm.smax.v4i64(<4 x i64> %spec.store.select, <4 x i64> zeroinitializer)
1401 %conv6 = trunc <4 x i64> %spec.store.select7 to <4 x i32>
1402 ret <4 x i32> %conv6
1407 define arm_aapcs_vfpcc <2 x i16> @stest_f64i16_mm(<2 x double> %x) {
1408 ; CHECK-LABEL: stest_f64i16_mm:
1409 ; CHECK: @ %bb.0: @ %entry
1410 ; CHECK-NEXT: .save {r4, r5, r7, lr}
1411 ; CHECK-NEXT: push {r4, r5, r7, lr}
1412 ; CHECK-NEXT: .vsave {d8, d9}
1413 ; CHECK-NEXT: vpush {d8, d9}
1414 ; CHECK-NEXT: vmov q4, q0
1415 ; CHECK-NEXT: vmov r0, r1, d9
1416 ; CHECK-NEXT: bl __aeabi_d2lz
1417 ; CHECK-NEXT: mov r4, r0
1418 ; CHECK-NEXT: mov r5, r1
1419 ; CHECK-NEXT: vmov r0, r1, d8
1420 ; CHECK-NEXT: bl __aeabi_d2lz
1421 ; CHECK-NEXT: vmov q0[2], q0[0], r0, r4
1422 ; CHECK-NEXT: movw r4, #32767
1423 ; CHECK-NEXT: vmov q0[3], q0[1], r1, r5
1424 ; CHECK-NEXT: adr.w r12, .LCPI36_0
1425 ; CHECK-NEXT: vmov r1, r2, d0
1426 ; CHECK-NEXT: vldrw.u32 q1, [r12]
1427 ; CHECK-NEXT: vmov r3, r5, d1
1428 ; CHECK-NEXT: movw lr, #32768
1429 ; CHECK-NEXT: movt lr, #65535
1430 ; CHECK-NEXT: mov.w r12, #-1
1431 ; CHECK-NEXT: movs r0, #0
1432 ; CHECK-NEXT: subs r1, r1, r4
1433 ; CHECK-NEXT: sbcs r1, r2, #0
1434 ; CHECK-NEXT: mov.w r2, #0
1435 ; CHECK-NEXT: csetm r1, lt
1436 ; CHECK-NEXT: bfi r2, r1, #0, #8
1437 ; CHECK-NEXT: subs r1, r3, r4
1438 ; CHECK-NEXT: sbcs r1, r5, #0
1439 ; CHECK-NEXT: adr r4, .LCPI36_1
1440 ; CHECK-NEXT: csetm r1, lt
1441 ; CHECK-NEXT: bfi r2, r1, #8, #8
1442 ; CHECK-NEXT: vmsr p0, r2
1443 ; CHECK-NEXT: vpsel q0, q0, q1
1444 ; CHECK-NEXT: vldrw.u32 q1, [r4]
1445 ; CHECK-NEXT: vmov r1, r2, d0
1446 ; CHECK-NEXT: vmov r3, r5, d1
1447 ; CHECK-NEXT: subs.w r1, lr, r1
1448 ; CHECK-NEXT: sbcs.w r1, r12, r2
1449 ; CHECK-NEXT: csetm r1, lt
1450 ; CHECK-NEXT: bfi r0, r1, #0, #8
1451 ; CHECK-NEXT: subs.w r1, lr, r3
1452 ; CHECK-NEXT: sbcs.w r1, r12, r5
1453 ; CHECK-NEXT: csetm r1, lt
1454 ; CHECK-NEXT: bfi r0, r1, #8, #8
1455 ; CHECK-NEXT: vmsr p0, r0
1456 ; CHECK-NEXT: vpsel q0, q0, q1
1457 ; CHECK-NEXT: vpop {d8, d9}
1458 ; CHECK-NEXT: pop {r4, r5, r7, pc}
1459 ; CHECK-NEXT: .p2align 4
1460 ; CHECK-NEXT: @ %bb.1:
1461 ; CHECK-NEXT: .LCPI36_0:
1462 ; CHECK-NEXT: .long 32767 @ 0x7fff
1463 ; CHECK-NEXT: .long 0 @ 0x0
1464 ; CHECK-NEXT: .long 32767 @ 0x7fff
1465 ; CHECK-NEXT: .long 0 @ 0x0
1466 ; CHECK-NEXT: .LCPI36_1:
1467 ; CHECK-NEXT: .long 4294934528 @ 0xffff8000
1468 ; CHECK-NEXT: .long 4294967295 @ 0xffffffff
1469 ; CHECK-NEXT: .long 4294934528 @ 0xffff8000
1470 ; CHECK-NEXT: .long 4294967295 @ 0xffffffff
1472 %conv = fptosi <2 x double> %x to <2 x i32>
1473 %spec.store.select = call <2 x i32> @llvm.smin.v2i32(<2 x i32> %conv, <2 x i32> <i32 32767, i32 32767>)
1474 %spec.store.select7 = call <2 x i32> @llvm.smax.v2i32(<2 x i32> %spec.store.select, <2 x i32> <i32 -32768, i32 -32768>)
1475 %conv6 = trunc <2 x i32> %spec.store.select7 to <2 x i16>
1476 ret <2 x i16> %conv6
1479 define arm_aapcs_vfpcc <2 x i16> @utest_f64i16_mm(<2 x double> %x) {
1480 ; CHECK-LABEL: utest_f64i16_mm:
1481 ; CHECK: @ %bb.0: @ %entry
1482 ; CHECK-NEXT: .save {r4, r5, r7, lr}
1483 ; CHECK-NEXT: push {r4, r5, r7, lr}
1484 ; CHECK-NEXT: .vsave {d8, d9}
1485 ; CHECK-NEXT: vpush {d8, d9}
1486 ; CHECK-NEXT: vmov q4, q0
1487 ; CHECK-NEXT: vmov r0, r1, d9
1488 ; CHECK-NEXT: bl __aeabi_d2ulz
1489 ; CHECK-NEXT: mov r4, r0
1490 ; CHECK-NEXT: mov r5, r1
1491 ; CHECK-NEXT: vmov r0, r1, d8
1492 ; CHECK-NEXT: bl __aeabi_d2ulz
1493 ; CHECK-NEXT: vmov q0[2], q0[0], r0, r4
1494 ; CHECK-NEXT: movw r4, #65535
1495 ; CHECK-NEXT: vmov q0[3], q0[1], r1, r5
1496 ; CHECK-NEXT: movs r5, #0
1497 ; CHECK-NEXT: vmov r0, r1, d0
1498 ; CHECK-NEXT: vmov.i64 q1, #0xffff
1499 ; CHECK-NEXT: vmov r2, r3, d1
1500 ; CHECK-NEXT: subs r0, r0, r4
1501 ; CHECK-NEXT: sbcs r0, r1, #0
1502 ; CHECK-NEXT: csetm r0, lo
1503 ; CHECK-NEXT: bfi r5, r0, #0, #8
1504 ; CHECK-NEXT: subs r0, r2, r4
1505 ; CHECK-NEXT: sbcs r0, r3, #0
1506 ; CHECK-NEXT: csetm r0, lo
1507 ; CHECK-NEXT: bfi r5, r0, #8, #8
1508 ; CHECK-NEXT: vmsr p0, r5
1509 ; CHECK-NEXT: vpsel q0, q0, q1
1510 ; CHECK-NEXT: vpop {d8, d9}
1511 ; CHECK-NEXT: pop {r4, r5, r7, pc}
1513 %conv = fptoui <2 x double> %x to <2 x i32>
1514 %spec.store.select = call <2 x i32> @llvm.umin.v2i32(<2 x i32> %conv, <2 x i32> <i32 65535, i32 65535>)
1515 %conv6 = trunc <2 x i32> %spec.store.select to <2 x i16>
1516 ret <2 x i16> %conv6
1519 define arm_aapcs_vfpcc <2 x i16> @ustest_f64i16_mm(<2 x double> %x) {
1520 ; CHECK-LABEL: ustest_f64i16_mm:
1521 ; CHECK: @ %bb.0: @ %entry
1522 ; CHECK-NEXT: .save {r4, r5, r7, lr}
1523 ; CHECK-NEXT: push {r4, r5, r7, lr}
1524 ; CHECK-NEXT: .vsave {d8, d9}
1525 ; CHECK-NEXT: vpush {d8, d9}
1526 ; CHECK-NEXT: vmov q4, q0
1527 ; CHECK-NEXT: vmov r0, r1, d9
1528 ; CHECK-NEXT: bl __aeabi_d2lz
1529 ; CHECK-NEXT: mov r4, r0
1530 ; CHECK-NEXT: mov r5, r1
1531 ; CHECK-NEXT: vmov r0, r1, d8
1532 ; CHECK-NEXT: bl __aeabi_d2lz
1533 ; CHECK-NEXT: vmov q0[2], q0[0], r0, r4
1534 ; CHECK-NEXT: movw r4, #65535
1535 ; CHECK-NEXT: vmov q0[3], q0[1], r1, r5
1536 ; CHECK-NEXT: vmov.i64 q1, #0xffff
1537 ; CHECK-NEXT: vmov r1, r2, d0
1538 ; CHECK-NEXT: movs r0, #0
1539 ; CHECK-NEXT: vmov r3, r5, d1
1540 ; CHECK-NEXT: subs r1, r1, r4
1541 ; CHECK-NEXT: sbcs r1, r2, #0
1542 ; CHECK-NEXT: mov.w r2, #0
1543 ; CHECK-NEXT: csetm r1, lt
1544 ; CHECK-NEXT: bfi r2, r1, #0, #8
1545 ; CHECK-NEXT: subs r1, r3, r4
1546 ; CHECK-NEXT: sbcs r1, r5, #0
1547 ; CHECK-NEXT: csetm r1, lt
1548 ; CHECK-NEXT: bfi r2, r1, #8, #8
1549 ; CHECK-NEXT: vmsr p0, r2
1550 ; CHECK-NEXT: vpsel q0, q0, q1
1551 ; CHECK-NEXT: vmov.i32 q1, #0x0
1552 ; CHECK-NEXT: vmov r1, r2, d0
1553 ; CHECK-NEXT: vmov r3, r5, d1
1554 ; CHECK-NEXT: rsbs r1, r1, #0
1555 ; CHECK-NEXT: sbcs.w r1, r0, r2
1556 ; CHECK-NEXT: csetm r1, lt
1557 ; CHECK-NEXT: rsbs r2, r3, #0
1558 ; CHECK-NEXT: sbcs.w r2, r0, r5
1559 ; CHECK-NEXT: bfi r0, r1, #0, #8
1560 ; CHECK-NEXT: csetm r1, lt
1561 ; CHECK-NEXT: bfi r0, r1, #8, #8
1562 ; CHECK-NEXT: vmsr p0, r0
1563 ; CHECK-NEXT: vpsel q0, q0, q1
1564 ; CHECK-NEXT: vpop {d8, d9}
1565 ; CHECK-NEXT: pop {r4, r5, r7, pc}
1567 %conv = fptosi <2 x double> %x to <2 x i32>
1568 %spec.store.select = call <2 x i32> @llvm.smin.v2i32(<2 x i32> %conv, <2 x i32> <i32 65535, i32 65535>)
1569 %spec.store.select7 = call <2 x i32> @llvm.smax.v2i32(<2 x i32> %spec.store.select, <2 x i32> zeroinitializer)
1570 %conv6 = trunc <2 x i32> %spec.store.select7 to <2 x i16>
1571 ret <2 x i16> %conv6
1574 define arm_aapcs_vfpcc <4 x i16> @stest_f32i16_mm(<4 x float> %x) {
1575 ; CHECK-LABEL: stest_f32i16_mm:
1576 ; CHECK: @ %bb.0: @ %entry
1577 ; CHECK-NEXT: vcvt.s32.f32 q0, q0
1578 ; CHECK-NEXT: vqmovnb.s32 q0, q0
1579 ; CHECK-NEXT: vmovlb.s16 q0, q0
1582 %conv = fptosi <4 x float> %x to <4 x i32>
1583 %spec.store.select = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %conv, <4 x i32> <i32 32767, i32 32767, i32 32767, i32 32767>)
1584 %spec.store.select7 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %spec.store.select, <4 x i32> <i32 -32768, i32 -32768, i32 -32768, i32 -32768>)
1585 %conv6 = trunc <4 x i32> %spec.store.select7 to <4 x i16>
1586 ret <4 x i16> %conv6
1589 define arm_aapcs_vfpcc <4 x i16> @utest_f32i16_mm(<4 x float> %x) {
1590 ; CHECK-LABEL: utest_f32i16_mm:
1591 ; CHECK: @ %bb.0: @ %entry
1592 ; CHECK-NEXT: vcvt.u32.f32 q0, q0
1593 ; CHECK-NEXT: vqmovnb.u32 q0, q0
1594 ; CHECK-NEXT: vmovlb.u16 q0, q0
1597 %conv = fptoui <4 x float> %x to <4 x i32>
1598 %spec.store.select = call <4 x i32> @llvm.umin.v4i32(<4 x i32> %conv, <4 x i32> <i32 65535, i32 65535, i32 65535, i32 65535>)
1599 %conv6 = trunc <4 x i32> %spec.store.select to <4 x i16>
1600 ret <4 x i16> %conv6
1603 define arm_aapcs_vfpcc <4 x i16> @ustest_f32i16_mm(<4 x float> %x) {
1604 ; CHECK-LABEL: ustest_f32i16_mm:
1605 ; CHECK: @ %bb.0: @ %entry
1606 ; CHECK-NEXT: vmov.i32 q1, #0xffff
1607 ; CHECK-NEXT: vcvt.s32.f32 q0, q0
1608 ; CHECK-NEXT: vmov.i32 q2, #0x0
1609 ; CHECK-NEXT: vmin.s32 q0, q0, q1
1610 ; CHECK-NEXT: vmax.s32 q0, q0, q2
1613 %conv = fptosi <4 x float> %x to <4 x i32>
1614 %spec.store.select = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %conv, <4 x i32> <i32 65535, i32 65535, i32 65535, i32 65535>)
1615 %spec.store.select7 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %spec.store.select, <4 x i32> zeroinitializer)
1616 %conv6 = trunc <4 x i32> %spec.store.select7 to <4 x i16>
1617 ret <4 x i16> %conv6
1620 define arm_aapcs_vfpcc <8 x i16> @stest_f16i16_mm(<8 x half> %x) {
1621 ; CHECK-LABEL: stest_f16i16_mm:
1622 ; CHECK: @ %bb.0: @ %entry
1623 ; CHECK-NEXT: vcvt.s16.f16 q0, q0
1626 %conv = fptosi <8 x half> %x to <8 x i32>
1627 %spec.store.select = call <8 x i32> @llvm.smin.v8i32(<8 x i32> %conv, <8 x i32> <i32 32767, i32 32767, i32 32767, i32 32767, i32 32767, i32 32767, i32 32767, i32 32767>)
1628 %spec.store.select7 = call <8 x i32> @llvm.smax.v8i32(<8 x i32> %spec.store.select, <8 x i32> <i32 -32768, i32 -32768, i32 -32768, i32 -32768, i32 -32768, i32 -32768, i32 -32768, i32 -32768>)
1629 %conv6 = trunc <8 x i32> %spec.store.select7 to <8 x i16>
1630 ret <8 x i16> %conv6
1633 define arm_aapcs_vfpcc <8 x i16> @utesth_f16i16_mm(<8 x half> %x) {
1634 ; CHECK-LABEL: utesth_f16i16_mm:
1635 ; CHECK: @ %bb.0: @ %entry
1636 ; CHECK-NEXT: vmovx.f16 s6, s2
1637 ; CHECK-NEXT: vcvt.u32.f16 s12, s2
1638 ; CHECK-NEXT: vmovx.f16 s2, s0
1639 ; CHECK-NEXT: vcvt.u32.f16 s0, s0
1640 ; CHECK-NEXT: vcvt.u32.f16 s14, s2
1641 ; CHECK-NEXT: vmov r0, s0
1642 ; CHECK-NEXT: vmovx.f16 s4, s3
1643 ; CHECK-NEXT: vmovx.f16 s10, s1
1644 ; CHECK-NEXT: vcvt.u32.f16 s8, s3
1645 ; CHECK-NEXT: vcvt.u32.f16 s5, s1
1646 ; CHECK-NEXT: vmov.16 q0[0], r0
1647 ; CHECK-NEXT: vmov r0, s14
1648 ; CHECK-NEXT: vmov.16 q0[1], r0
1649 ; CHECK-NEXT: vmov r0, s5
1650 ; CHECK-NEXT: vcvt.u32.f16 s10, s10
1651 ; CHECK-NEXT: vmov.16 q0[2], r0
1652 ; CHECK-NEXT: vmov r0, s10
1653 ; CHECK-NEXT: vcvt.u32.f16 s6, s6
1654 ; CHECK-NEXT: vmov.16 q0[3], r0
1655 ; CHECK-NEXT: vmov r0, s12
1656 ; CHECK-NEXT: vmov.16 q0[4], r0
1657 ; CHECK-NEXT: vmov r0, s6
1658 ; CHECK-NEXT: vmov.16 q0[5], r0
1659 ; CHECK-NEXT: vmov r0, s8
1660 ; CHECK-NEXT: vcvt.u32.f16 s4, s4
1661 ; CHECK-NEXT: vmov.16 q0[6], r0
1662 ; CHECK-NEXT: vmov r0, s4
1663 ; CHECK-NEXT: vmov.16 q0[7], r0
1666 %conv = fptoui <8 x half> %x to <8 x i32>
1667 %spec.store.select = call <8 x i32> @llvm.umin.v8i32(<8 x i32> %conv, <8 x i32> <i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535>)
1668 %conv6 = trunc <8 x i32> %spec.store.select to <8 x i16>
1669 ret <8 x i16> %conv6
1672 define arm_aapcs_vfpcc <8 x i16> @ustest_f16i16_mm(<8 x half> %x) {
1673 ; CHECK-LABEL: ustest_f16i16_mm:
1674 ; CHECK: @ %bb.0: @ %entry
1675 ; CHECK-NEXT: .vsave {d8, d9}
1676 ; CHECK-NEXT: vpush {d8, d9}
1677 ; CHECK-NEXT: .pad #16
1678 ; CHECK-NEXT: sub sp, #16
1679 ; CHECK-NEXT: vmovx.f16 s6, s0
1680 ; CHECK-NEXT: vcvt.s32.f16 s10, s0
1681 ; CHECK-NEXT: vmovx.f16 s0, s3
1682 ; CHECK-NEXT: vcvt.s32.f16 s5, s3
1683 ; CHECK-NEXT: vcvt.s32.f16 s12, s0
1684 ; CHECK-NEXT: vmovx.f16 s0, s2
1685 ; CHECK-NEXT: vcvt.s32.f16 s7, s2
1686 ; CHECK-NEXT: vcvt.s32.f16 s14, s0
1687 ; CHECK-NEXT: vmov r1, s5
1688 ; CHECK-NEXT: vmovx.f16 s4, s1
1689 ; CHECK-NEXT: vmov r2, s7
1690 ; CHECK-NEXT: vcvt.s32.f16 s8, s1
1691 ; CHECK-NEXT: vmov q4[2], q4[0], r2, r1
1692 ; CHECK-NEXT: vmov r1, s12
1693 ; CHECK-NEXT: vmov r2, s14
1694 ; CHECK-NEXT: vcvt.s32.f16 s4, s4
1695 ; CHECK-NEXT: vmov q4[3], q4[1], r2, r1
1696 ; CHECK-NEXT: vcvt.s32.f16 s6, s6
1697 ; CHECK-NEXT: vmov r1, s8
1698 ; CHECK-NEXT: vmov.i32 q0, #0x0
1699 ; CHECK-NEXT: vmov r2, s10
1700 ; CHECK-NEXT: mov r0, sp
1701 ; CHECK-NEXT: vmov q2[2], q2[0], r2, r1
1702 ; CHECK-NEXT: vmov r1, s4
1703 ; CHECK-NEXT: vmov r2, s6
1704 ; CHECK-NEXT: vmax.s32 q3, q4, q0
1705 ; CHECK-NEXT: vmov q2[3], q2[1], r2, r1
1706 ; CHECK-NEXT: vstrh.32 q3, [r0, #8]
1707 ; CHECK-NEXT: vmax.s32 q0, q2, q0
1708 ; CHECK-NEXT: vstrh.32 q0, [r0]
1709 ; CHECK-NEXT: vldrw.u32 q0, [r0]
1710 ; CHECK-NEXT: add sp, #16
1711 ; CHECK-NEXT: vpop {d8, d9}
1714 %conv = fptosi <8 x half> %x to <8 x i32>
1715 %spec.store.select = call <8 x i32> @llvm.smin.v8i32(<8 x i32> %conv, <8 x i32> <i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535>)
1716 %spec.store.select7 = call <8 x i32> @llvm.smax.v8i32(<8 x i32> %spec.store.select, <8 x i32> zeroinitializer)
1717 %conv6 = trunc <8 x i32> %spec.store.select7 to <8 x i16>
1718 ret <8 x i16> %conv6
1723 define arm_aapcs_vfpcc <2 x i64> @stest_f64i64_mm(<2 x double> %x) {
1724 ; CHECK-LABEL: stest_f64i64_mm:
1725 ; CHECK: @ %bb.0: @ %entry
1726 ; CHECK-NEXT: .save {r4, r5, r6, r7, r8, r9, lr}
1727 ; CHECK-NEXT: push.w {r4, r5, r6, r7, r8, r9, lr}
1728 ; CHECK-NEXT: .pad #4
1729 ; CHECK-NEXT: sub sp, #4
1730 ; CHECK-NEXT: .vsave {d8, d9}
1731 ; CHECK-NEXT: vpush {d8, d9}
1732 ; CHECK-NEXT: vmov q4, q0
1733 ; CHECK-NEXT: vmov r0, r1, d9
1734 ; CHECK-NEXT: bl __fixdfti
1735 ; CHECK-NEXT: vmov r12, lr, d8
1736 ; CHECK-NEXT: subs.w r5, r0, #-1
1737 ; CHECK-NEXT: mvn r4, #-2147483648
1738 ; CHECK-NEXT: sbcs.w r5, r1, r4
1739 ; CHECK-NEXT: sbcs r5, r2, #0
1740 ; CHECK-NEXT: mov.w r6, #-1
1741 ; CHECK-NEXT: sbcs r5, r3, #0
1742 ; CHECK-NEXT: cset r5, lt
1743 ; CHECK-NEXT: cmp r5, #0
1744 ; CHECK-NEXT: csel r0, r0, r6, ne
1745 ; CHECK-NEXT: csel r3, r3, r5, ne
1746 ; CHECK-NEXT: csel r2, r2, r5, ne
1747 ; CHECK-NEXT: csel r1, r1, r4, ne
1748 ; CHECK-NEXT: rsbs r7, r0, #0
1749 ; CHECK-NEXT: mov.w r5, #-2147483648
1750 ; CHECK-NEXT: sbcs.w r7, r5, r1
1751 ; CHECK-NEXT: sbcs.w r2, r6, r2
1752 ; CHECK-NEXT: sbcs.w r2, r6, r3
1753 ; CHECK-NEXT: cset r2, lt
1754 ; CHECK-NEXT: cmp r2, #0
1755 ; CHECK-NEXT: csel r9, r0, r2, ne
1756 ; CHECK-NEXT: csel r8, r1, r5, ne
1757 ; CHECK-NEXT: mov r0, r12
1758 ; CHECK-NEXT: mov r1, lr
1759 ; CHECK-NEXT: bl __fixdfti
1760 ; CHECK-NEXT: subs.w r7, r0, #-1
1761 ; CHECK-NEXT: sbcs.w r7, r1, r4
1762 ; CHECK-NEXT: sbcs r7, r2, #0
1763 ; CHECK-NEXT: sbcs r7, r3, #0
1764 ; CHECK-NEXT: cset r7, lt
1765 ; CHECK-NEXT: cmp r7, #0
1766 ; CHECK-NEXT: csel r0, r0, r6, ne
1767 ; CHECK-NEXT: csel r3, r3, r7, ne
1768 ; CHECK-NEXT: csel r2, r2, r7, ne
1769 ; CHECK-NEXT: csel r1, r1, r4, ne
1770 ; CHECK-NEXT: rsbs r7, r0, #0
1771 ; CHECK-NEXT: sbcs.w r7, r5, r1
1772 ; CHECK-NEXT: sbcs.w r2, r6, r2
1773 ; CHECK-NEXT: sbcs.w r2, r6, r3
1774 ; CHECK-NEXT: cset r2, lt
1775 ; CHECK-NEXT: cmp r2, #0
1776 ; CHECK-NEXT: csel r0, r0, r2, ne
1777 ; CHECK-NEXT: csel r1, r1, r5, ne
1778 ; CHECK-NEXT: vmov q0[2], q0[0], r0, r9
1779 ; CHECK-NEXT: vmov q0[3], q0[1], r1, r8
1780 ; CHECK-NEXT: vpop {d8, d9}
1781 ; CHECK-NEXT: add sp, #4
1782 ; CHECK-NEXT: pop.w {r4, r5, r6, r7, r8, r9, pc}
1784 %conv = fptosi <2 x double> %x to <2 x i128>
1785 %spec.store.select = call <2 x i128> @llvm.smin.v2i128(<2 x i128> %conv, <2 x i128> <i128 9223372036854775807, i128 9223372036854775807>)
1786 %spec.store.select7 = call <2 x i128> @llvm.smax.v2i128(<2 x i128> %spec.store.select, <2 x i128> <i128 -9223372036854775808, i128 -9223372036854775808>)
1787 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
1788 ret <2 x i64> %conv6
1791 define arm_aapcs_vfpcc <2 x i64> @utest_f64i64_mm(<2 x double> %x) {
1792 ; CHECK-LABEL: utest_f64i64_mm:
1793 ; CHECK: @ %bb.0: @ %entry
1794 ; CHECK-NEXT: .save {r4, r5, r7, lr}
1795 ; CHECK-NEXT: push {r4, r5, r7, lr}
1796 ; CHECK-NEXT: .vsave {d8, d9}
1797 ; CHECK-NEXT: vpush {d8, d9}
1798 ; CHECK-NEXT: vmov q4, q0
1799 ; CHECK-NEXT: vmov r0, r1, d9
1800 ; CHECK-NEXT: bl __fixunsdfti
1801 ; CHECK-NEXT: vmov r12, lr, d8
1802 ; CHECK-NEXT: subs r2, #1
1803 ; CHECK-NEXT: sbcs r2, r3, #0
1804 ; CHECK-NEXT: cset r2, lo
1805 ; CHECK-NEXT: cmp r2, #0
1806 ; CHECK-NEXT: csel r4, r1, r2, ne
1807 ; CHECK-NEXT: csel r5, r0, r2, ne
1808 ; CHECK-NEXT: mov r0, r12
1809 ; CHECK-NEXT: mov r1, lr
1810 ; CHECK-NEXT: bl __fixunsdfti
1811 ; CHECK-NEXT: subs r2, #1
1812 ; CHECK-NEXT: sbcs r2, r3, #0
1813 ; CHECK-NEXT: cset r2, lo
1814 ; CHECK-NEXT: cmp r2, #0
1815 ; CHECK-NEXT: csel r0, r0, r2, ne
1816 ; CHECK-NEXT: csel r1, r1, r2, ne
1817 ; CHECK-NEXT: vmov q0[2], q0[0], r0, r5
1818 ; CHECK-NEXT: vmov q0[3], q0[1], r1, r4
1819 ; CHECK-NEXT: vpop {d8, d9}
1820 ; CHECK-NEXT: pop {r4, r5, r7, pc}
1822 %conv = fptoui <2 x double> %x to <2 x i128>
1823 %spec.store.select = call <2 x i128> @llvm.umin.v2i128(<2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>)
1824 %conv6 = trunc <2 x i128> %spec.store.select to <2 x i64>
1825 ret <2 x i64> %conv6
1828 define arm_aapcs_vfpcc <2 x i64> @ustest_f64i64_mm(<2 x double> %x) {
1829 ; CHECK-LABEL: ustest_f64i64_mm:
1830 ; CHECK: @ %bb.0: @ %entry
1831 ; CHECK-NEXT: .save {r4, r5, r7, lr}
1832 ; CHECK-NEXT: push {r4, r5, r7, lr}
1833 ; CHECK-NEXT: .vsave {d8, d9}
1834 ; CHECK-NEXT: vpush {d8, d9}
1835 ; CHECK-NEXT: vmov q4, q0
1836 ; CHECK-NEXT: vmov r0, r1, d9
1837 ; CHECK-NEXT: bl __fixdfti
1838 ; CHECK-NEXT: vmov r12, lr, d8
1839 ; CHECK-NEXT: subs r2, #1
1840 ; CHECK-NEXT: sbcs r2, r3, #0
1841 ; CHECK-NEXT: cset r2, lt
1842 ; CHECK-NEXT: cmp r2, #0
1843 ; CHECK-NEXT: csel r5, r0, r2, ne
1844 ; CHECK-NEXT: csel r0, r3, r2, ne
1845 ; CHECK-NEXT: csel r4, r1, r2, ne
1846 ; CHECK-NEXT: cmp r0, #0
1847 ; CHECK-NEXT: itt mi
1848 ; CHECK-NEXT: movmi r4, #0
1849 ; CHECK-NEXT: movmi r5, #0
1850 ; CHECK-NEXT: mov r0, r12
1851 ; CHECK-NEXT: mov r1, lr
1852 ; CHECK-NEXT: bl __fixdfti
1853 ; CHECK-NEXT: subs r2, #1
1854 ; CHECK-NEXT: sbcs r2, r3, #0
1855 ; CHECK-NEXT: cset r2, lt
1856 ; CHECK-NEXT: cmp r2, #0
1857 ; CHECK-NEXT: csel r1, r1, r2, ne
1858 ; CHECK-NEXT: csel r0, r0, r2, ne
1859 ; CHECK-NEXT: csel r2, r3, r2, ne
1860 ; CHECK-NEXT: cmp r2, #0
1861 ; CHECK-NEXT: itt mi
1862 ; CHECK-NEXT: movmi r0, #0
1863 ; CHECK-NEXT: movmi r1, #0
1864 ; CHECK-NEXT: vmov q0[2], q0[0], r0, r5
1865 ; CHECK-NEXT: vmov q0[3], q0[1], r1, r4
1866 ; CHECK-NEXT: vpop {d8, d9}
1867 ; CHECK-NEXT: pop {r4, r5, r7, pc}
1869 %conv = fptosi <2 x double> %x to <2 x i128>
1870 %spec.store.select = call <2 x i128> @llvm.smin.v2i128(<2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>)
1871 %spec.store.select7 = call <2 x i128> @llvm.smax.v2i128(<2 x i128> %spec.store.select, <2 x i128> zeroinitializer)
1872 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
1873 ret <2 x i64> %conv6
1876 define arm_aapcs_vfpcc <2 x i64> @stest_f32i64_mm(<2 x float> %x) {
1877 ; CHECK-LABEL: stest_f32i64_mm:
1878 ; CHECK: @ %bb.0: @ %entry
1879 ; CHECK-NEXT: .save {r4, r5, r6, r7, r8, r9, r10, lr}
1880 ; CHECK-NEXT: push.w {r4, r5, r6, r7, r8, r9, r10, lr}
1881 ; CHECK-NEXT: vmov r8, r0, d0
1882 ; CHECK-NEXT: bl __fixsfti
1883 ; CHECK-NEXT: subs.w r7, r0, #-1
1884 ; CHECK-NEXT: mvn r5, #-2147483648
1885 ; CHECK-NEXT: sbcs.w r7, r1, r5
1886 ; CHECK-NEXT: mov.w r6, #-2147483648
1887 ; CHECK-NEXT: sbcs r7, r2, #0
1888 ; CHECK-NEXT: sbcs r7, r3, #0
1889 ; CHECK-NEXT: cset r7, lt
1890 ; CHECK-NEXT: cmp r7, #0
1891 ; CHECK-NEXT: csel r3, r3, r7, ne
1892 ; CHECK-NEXT: csel r2, r2, r7, ne
1893 ; CHECK-NEXT: mov.w r7, #-1
1894 ; CHECK-NEXT: csel r1, r1, r5, ne
1895 ; CHECK-NEXT: csel r0, r0, r7, ne
1896 ; CHECK-NEXT: rsbs r4, r0, #0
1897 ; CHECK-NEXT: sbcs.w r4, r6, r1
1898 ; CHECK-NEXT: sbcs.w r2, r7, r2
1899 ; CHECK-NEXT: sbcs.w r2, r7, r3
1900 ; CHECK-NEXT: cset r2, lt
1901 ; CHECK-NEXT: cmp r2, #0
1902 ; CHECK-NEXT: csel r10, r0, r2, ne
1903 ; CHECK-NEXT: mov r0, r8
1904 ; CHECK-NEXT: csel r9, r1, r6, ne
1905 ; CHECK-NEXT: bl __fixsfti
1906 ; CHECK-NEXT: subs.w r4, r0, #-1
1907 ; CHECK-NEXT: sbcs.w r4, r1, r5
1908 ; CHECK-NEXT: sbcs r4, r2, #0
1909 ; CHECK-NEXT: sbcs r4, r3, #0
1910 ; CHECK-NEXT: cset r4, lt
1911 ; CHECK-NEXT: cmp r4, #0
1912 ; CHECK-NEXT: csel r0, r0, r7, ne
1913 ; CHECK-NEXT: csel r3, r3, r4, ne
1914 ; CHECK-NEXT: csel r2, r2, r4, ne
1915 ; CHECK-NEXT: csel r1, r1, r5, ne
1916 ; CHECK-NEXT: rsbs r5, r0, #0
1917 ; CHECK-NEXT: sbcs.w r5, r6, r1
1918 ; CHECK-NEXT: sbcs.w r2, r7, r2
1919 ; CHECK-NEXT: sbcs.w r2, r7, r3
1920 ; CHECK-NEXT: cset r2, lt
1921 ; CHECK-NEXT: cmp r2, #0
1922 ; CHECK-NEXT: csel r0, r0, r2, ne
1923 ; CHECK-NEXT: csel r1, r1, r6, ne
1924 ; CHECK-NEXT: vmov q0[2], q0[0], r0, r10
1925 ; CHECK-NEXT: vmov q0[3], q0[1], r1, r9
1926 ; CHECK-NEXT: pop.w {r4, r5, r6, r7, r8, r9, r10, pc}
1928 %conv = fptosi <2 x float> %x to <2 x i128>
1929 %spec.store.select = call <2 x i128> @llvm.smin.v2i128(<2 x i128> %conv, <2 x i128> <i128 9223372036854775807, i128 9223372036854775807>)
1930 %spec.store.select7 = call <2 x i128> @llvm.smax.v2i128(<2 x i128> %spec.store.select, <2 x i128> <i128 -9223372036854775808, i128 -9223372036854775808>)
1931 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
1932 ret <2 x i64> %conv6
1935 define arm_aapcs_vfpcc <2 x i64> @utest_f32i64_mm(<2 x float> %x) {
1936 ; CHECK-LABEL: utest_f32i64_mm:
1937 ; CHECK: @ %bb.0: @ %entry
1938 ; CHECK-NEXT: .save {r4, r5, r6, lr}
1939 ; CHECK-NEXT: push {r4, r5, r6, lr}
1940 ; CHECK-NEXT: vmov r4, r0, d0
1941 ; CHECK-NEXT: bl __fixunssfti
1942 ; CHECK-NEXT: subs r2, #1
1943 ; CHECK-NEXT: sbcs r2, r3, #0
1944 ; CHECK-NEXT: cset r2, lo
1945 ; CHECK-NEXT: cmp r2, #0
1946 ; CHECK-NEXT: csel r6, r0, r2, ne
1947 ; CHECK-NEXT: mov r0, r4
1948 ; CHECK-NEXT: csel r5, r1, r2, ne
1949 ; CHECK-NEXT: bl __fixunssfti
1950 ; CHECK-NEXT: subs r2, #1
1951 ; CHECK-NEXT: sbcs r2, r3, #0
1952 ; CHECK-NEXT: cset r2, lo
1953 ; CHECK-NEXT: cmp r2, #0
1954 ; CHECK-NEXT: csel r0, r0, r2, ne
1955 ; CHECK-NEXT: csel r1, r1, r2, ne
1956 ; CHECK-NEXT: vmov q0[2], q0[0], r0, r6
1957 ; CHECK-NEXT: vmov q0[3], q0[1], r1, r5
1958 ; CHECK-NEXT: pop {r4, r5, r6, pc}
1960 %conv = fptoui <2 x float> %x to <2 x i128>
1961 %spec.store.select = call <2 x i128> @llvm.umin.v2i128(<2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>)
1962 %conv6 = trunc <2 x i128> %spec.store.select to <2 x i64>
1963 ret <2 x i64> %conv6
1966 define arm_aapcs_vfpcc <2 x i64> @ustest_f32i64_mm(<2 x float> %x) {
1967 ; CHECK-LABEL: ustest_f32i64_mm:
1968 ; CHECK: @ %bb.0: @ %entry
1969 ; CHECK-NEXT: .save {r4, r5, r6, lr}
1970 ; CHECK-NEXT: push {r4, r5, r6, lr}
1971 ; CHECK-NEXT: vmov r4, r0, d0
1972 ; CHECK-NEXT: bl __fixsfti
1973 ; CHECK-NEXT: subs r2, #1
1974 ; CHECK-NEXT: sbcs r2, r3, #0
1975 ; CHECK-NEXT: cset r2, lt
1976 ; CHECK-NEXT: cmp r2, #0
1977 ; CHECK-NEXT: csel r6, r0, r2, ne
1978 ; CHECK-NEXT: csel r0, r3, r2, ne
1979 ; CHECK-NEXT: csel r5, r1, r2, ne
1980 ; CHECK-NEXT: cmp r0, #0
1981 ; CHECK-NEXT: mov r0, r4
1982 ; CHECK-NEXT: itt mi
1983 ; CHECK-NEXT: movmi r5, #0
1984 ; CHECK-NEXT: movmi r6, #0
1985 ; CHECK-NEXT: bl __fixsfti
1986 ; CHECK-NEXT: subs r2, #1
1987 ; CHECK-NEXT: sbcs r2, r3, #0
1988 ; CHECK-NEXT: cset r2, lt
1989 ; CHECK-NEXT: cmp r2, #0
1990 ; CHECK-NEXT: csel r1, r1, r2, ne
1991 ; CHECK-NEXT: csel r0, r0, r2, ne
1992 ; CHECK-NEXT: csel r2, r3, r2, ne
1993 ; CHECK-NEXT: cmp r2, #0
1994 ; CHECK-NEXT: itt mi
1995 ; CHECK-NEXT: movmi r0, #0
1996 ; CHECK-NEXT: movmi r1, #0
1997 ; CHECK-NEXT: vmov q0[2], q0[0], r0, r6
1998 ; CHECK-NEXT: vmov q0[3], q0[1], r1, r5
1999 ; CHECK-NEXT: pop {r4, r5, r6, pc}
2001 %conv = fptosi <2 x float> %x to <2 x i128>
2002 %spec.store.select = call <2 x i128> @llvm.smin.v2i128(<2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>)
2003 %spec.store.select7 = call <2 x i128> @llvm.smax.v2i128(<2 x i128> %spec.store.select, <2 x i128> zeroinitializer)
2004 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
2005 ret <2 x i64> %conv6
2008 define arm_aapcs_vfpcc <2 x i64> @stest_f16i64_mm(<2 x half> %x) {
2009 ; CHECK-LABEL: stest_f16i64_mm:
2010 ; CHECK: @ %bb.0: @ %entry
2011 ; CHECK-NEXT: .save {r4, r5, r7, lr}
2012 ; CHECK-NEXT: push {r4, r5, r7, lr}
2013 ; CHECK-NEXT: .vsave {d8, d9}
2014 ; CHECK-NEXT: vpush {d8, d9}
2015 ; CHECK-NEXT: vmov.u16 r0, q0[1]
2016 ; CHECK-NEXT: vmov q4, q0
2017 ; CHECK-NEXT: bl __fixhfti
2018 ; CHECK-NEXT: mov r4, r0
2019 ; CHECK-NEXT: vmov.u16 r0, q4[0]
2020 ; CHECK-NEXT: mov r5, r1
2021 ; CHECK-NEXT: bl __fixhfti
2022 ; CHECK-NEXT: vmov q0[2], q0[0], r0, r4
2023 ; CHECK-NEXT: vmov q0[3], q0[1], r1, r5
2024 ; CHECK-NEXT: vpop {d8, d9}
2025 ; CHECK-NEXT: pop {r4, r5, r7, pc}
2027 %conv = fptosi <2 x half> %x to <2 x i128>
2028 %spec.store.select = call <2 x i128> @llvm.smin.v2i128(<2 x i128> %conv, <2 x i128> <i128 9223372036854775807, i128 9223372036854775807>)
2029 %spec.store.select7 = call <2 x i128> @llvm.smax.v2i128(<2 x i128> %spec.store.select, <2 x i128> <i128 -9223372036854775808, i128 -9223372036854775808>)
2030 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
2031 ret <2 x i64> %conv6
2034 define arm_aapcs_vfpcc <2 x i64> @utesth_f16i64_mm(<2 x half> %x) {
2035 ; CHECK-LABEL: utesth_f16i64_mm:
2036 ; CHECK: @ %bb.0: @ %entry
2037 ; CHECK-NEXT: .save {r4, r5, r7, lr}
2038 ; CHECK-NEXT: push {r4, r5, r7, lr}
2039 ; CHECK-NEXT: .vsave {d8, d9}
2040 ; CHECK-NEXT: vpush {d8, d9}
2041 ; CHECK-NEXT: vmov.u16 r0, q0[1]
2042 ; CHECK-NEXT: vmov q4, q0
2043 ; CHECK-NEXT: bl __fixunshfti
2044 ; CHECK-NEXT: mov r4, r0
2045 ; CHECK-NEXT: vmov.u16 r0, q4[0]
2046 ; CHECK-NEXT: mov r5, r1
2047 ; CHECK-NEXT: bl __fixunshfti
2048 ; CHECK-NEXT: vmov q0[2], q0[0], r0, r4
2049 ; CHECK-NEXT: vmov q0[3], q0[1], r1, r5
2050 ; CHECK-NEXT: vpop {d8, d9}
2051 ; CHECK-NEXT: pop {r4, r5, r7, pc}
2053 %conv = fptoui <2 x half> %x to <2 x i128>
2054 %spec.store.select = call <2 x i128> @llvm.umin.v2i128(<2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>)
2055 %conv6 = trunc <2 x i128> %spec.store.select to <2 x i64>
2056 ret <2 x i64> %conv6
2059 define arm_aapcs_vfpcc <2 x i64> @ustest_f16i64_mm(<2 x half> %x) {
2060 ; CHECK-LABEL: ustest_f16i64_mm:
2061 ; CHECK: @ %bb.0: @ %entry
2062 ; CHECK-NEXT: .save {r4, r5, r7, lr}
2063 ; CHECK-NEXT: push {r4, r5, r7, lr}
2064 ; CHECK-NEXT: .vsave {d8, d9}
2065 ; CHECK-NEXT: vpush {d8, d9}
2066 ; CHECK-NEXT: vmov.u16 r0, q0[1]
2067 ; CHECK-NEXT: vmov q4, q0
2068 ; CHECK-NEXT: bl __fixhfti
2069 ; CHECK-NEXT: mov r4, r0
2070 ; CHECK-NEXT: vmov.u16 r0, q4[0]
2071 ; CHECK-NEXT: mov r5, r1
2072 ; CHECK-NEXT: cmp r3, #0
2073 ; CHECK-NEXT: itt mi
2074 ; CHECK-NEXT: movmi r5, #0
2075 ; CHECK-NEXT: movmi r4, #0
2076 ; CHECK-NEXT: bl __fixhfti
2077 ; CHECK-NEXT: cmp r3, #0
2078 ; CHECK-NEXT: itt mi
2079 ; CHECK-NEXT: movmi r0, #0
2080 ; CHECK-NEXT: movmi r1, #0
2081 ; CHECK-NEXT: vmov q0[2], q0[0], r0, r4
2082 ; CHECK-NEXT: vmov q0[3], q0[1], r1, r5
2083 ; CHECK-NEXT: vpop {d8, d9}
2084 ; CHECK-NEXT: pop {r4, r5, r7, pc}
2086 %conv = fptosi <2 x half> %x to <2 x i128>
2087 %spec.store.select = call <2 x i128> @llvm.smin.v2i128(<2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>)
2088 %spec.store.select7 = call <2 x i128> @llvm.smax.v2i128(<2 x i128> %spec.store.select, <2 x i128> zeroinitializer)
2089 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
2090 ret <2 x i64> %conv6
2093 declare <2 x i32> @llvm.smin.v2i32(<2 x i32>, <2 x i32>)
2094 declare <2 x i32> @llvm.smax.v2i32(<2 x i32>, <2 x i32>)
2095 declare <2 x i32> @llvm.umin.v2i32(<2 x i32>, <2 x i32>)
2096 declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>)
2097 declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>)
2098 declare <4 x i32> @llvm.umin.v4i32(<4 x i32>, <4 x i32>)
2099 declare <8 x i32> @llvm.smin.v8i32(<8 x i32>, <8 x i32>)
2100 declare <8 x i32> @llvm.smax.v8i32(<8 x i32>, <8 x i32>)
2101 declare <8 x i32> @llvm.umin.v8i32(<8 x i32>, <8 x i32>)
2102 declare <2 x i64> @llvm.smin.v2i64(<2 x i64>, <2 x i64>)
2103 declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>)
2104 declare <2 x i64> @llvm.umin.v2i64(<2 x i64>, <2 x i64>)
2105 declare <4 x i64> @llvm.smin.v4i64(<4 x i64>, <4 x i64>)
2106 declare <4 x i64> @llvm.smax.v4i64(<4 x i64>, <4 x i64>)
2107 declare <4 x i64> @llvm.umin.v4i64(<4 x i64>, <4 x i64>)
2108 declare <2 x i128> @llvm.smin.v2i128(<2 x i128>, <2 x i128>)
2109 declare <2 x i128> @llvm.smax.v2i128(<2 x i128>, <2 x i128>)
2110 declare <2 x i128> @llvm.umin.v2i128(<2 x i128>, <2 x i128>)