1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=armv7a-none-eabihf -mattr=+neon | FileCheck %s --check-prefixes=CHECK,CHECK-NEON
3 ; RUN: llc < %s -mtriple=armv8a-none-eabihf -mattr=+neon,+fullfp16 | FileCheck %s --check-prefixes=CHECK,CHECK-FP16
7 define <2 x i32> @stest_f64i32(<2 x double> %x) {
8 ; CHECK-LABEL: stest_f64i32:
9 ; CHECK: @ %bb.0: @ %entry
10 ; CHECK-NEXT: .save {r4, r5, r11, lr}
11 ; CHECK-NEXT: push {r4, r5, r11, lr}
12 ; CHECK-NEXT: .vsave {d8, d9, d10, d11}
13 ; CHECK-NEXT: vpush {d8, d9, d10, d11}
14 ; CHECK-NEXT: vorr q4, q0, q0
15 ; CHECK-NEXT: vmov r0, r1, d8
16 ; CHECK-NEXT: bl __aeabi_d2lz
17 ; CHECK-NEXT: mov r4, r0
18 ; CHECK-NEXT: mov r5, r1
19 ; CHECK-NEXT: vmov r0, r1, d9
20 ; CHECK-NEXT: adr r2, .LCPI0_0
21 ; CHECK-NEXT: vld1.64 {d8, d9}, [r2:128]
22 ; CHECK-NEXT: vmov.32 d10[0], r4
23 ; CHECK-NEXT: bl __aeabi_d2lz
24 ; CHECK-NEXT: mvn r3, #-2147483648
25 ; CHECK-NEXT: subs r4, r4, r3
26 ; CHECK-NEXT: sbcs r4, r5, #0
27 ; CHECK-NEXT: vmov.32 d11[0], r0
28 ; CHECK-NEXT: mov r4, #0
29 ; CHECK-NEXT: mov r2, #0
30 ; CHECK-NEXT: movwlt r4, #1
31 ; CHECK-NEXT: subs r0, r0, r3
32 ; CHECK-NEXT: sbcs r0, r1, #0
33 ; CHECK-NEXT: vmov.32 d11[1], r1
34 ; CHECK-NEXT: mov r0, #0
35 ; CHECK-NEXT: vmov.i32 q10, #0x80000000
36 ; CHECK-NEXT: movwlt r0, #1
37 ; CHECK-NEXT: cmp r0, #0
38 ; CHECK-NEXT: mvnne r0, #0
39 ; CHECK-NEXT: cmp r4, #0
40 ; CHECK-NEXT: vmov.32 d10[1], r5
41 ; CHECK-NEXT: mvnne r4, #0
42 ; CHECK-NEXT: vdup.32 d17, r0
43 ; CHECK-NEXT: vdup.32 d16, r4
44 ; CHECK-NEXT: mvn r4, #0
45 ; CHECK-NEXT: vbsl q8, q5, q4
46 ; CHECK-NEXT: vmov r0, r1, d16
47 ; CHECK-NEXT: vmov r3, r5, d17
48 ; CHECK-NEXT: rsbs r0, r0, #-2147483648
49 ; CHECK-NEXT: sbcs r0, r4, r1
50 ; CHECK-NEXT: mov r0, #0
51 ; CHECK-NEXT: movwlt r0, #1
52 ; CHECK-NEXT: rsbs r1, r3, #-2147483648
53 ; CHECK-NEXT: sbcs r1, r4, r5
54 ; CHECK-NEXT: movwlt r2, #1
55 ; CHECK-NEXT: cmp r2, #0
56 ; CHECK-NEXT: mvnne r2, #0
57 ; CHECK-NEXT: cmp r0, #0
58 ; CHECK-NEXT: vdup.32 d19, r2
59 ; CHECK-NEXT: mvnne r0, #0
60 ; CHECK-NEXT: vdup.32 d18, r0
61 ; CHECK-NEXT: vbif q8, q10, q9
62 ; CHECK-NEXT: vmovn.i64 d0, q8
63 ; CHECK-NEXT: vpop {d8, d9, d10, d11}
64 ; CHECK-NEXT: pop {r4, r5, r11, pc}
65 ; CHECK-NEXT: .p2align 4
66 ; CHECK-NEXT: @ %bb.1:
67 ; CHECK-NEXT: .LCPI0_0:
68 ; CHECK-NEXT: .long 2147483647 @ 0x7fffffff
69 ; CHECK-NEXT: .long 0 @ 0x0
70 ; CHECK-NEXT: .long 2147483647 @ 0x7fffffff
71 ; CHECK-NEXT: .long 0 @ 0x0
73 %conv = fptosi <2 x double> %x to <2 x i64>
74 %0 = icmp slt <2 x i64> %conv, <i64 2147483647, i64 2147483647>
75 %spec.store.select = select <2 x i1> %0, <2 x i64> %conv, <2 x i64> <i64 2147483647, i64 2147483647>
76 %1 = icmp sgt <2 x i64> %spec.store.select, <i64 -2147483648, i64 -2147483648>
77 %spec.store.select7 = select <2 x i1> %1, <2 x i64> %spec.store.select, <2 x i64> <i64 -2147483648, i64 -2147483648>
78 %conv6 = trunc <2 x i64> %spec.store.select7 to <2 x i32>
82 define <2 x i32> @utest_f64i32(<2 x double> %x) {
83 ; CHECK-LABEL: utest_f64i32:
84 ; CHECK: @ %bb.0: @ %entry
85 ; CHECK-NEXT: .save {r4, r5, r11, lr}
86 ; CHECK-NEXT: push {r4, r5, r11, lr}
87 ; CHECK-NEXT: .vsave {d8, d9}
88 ; CHECK-NEXT: vpush {d8, d9}
89 ; CHECK-NEXT: vorr q4, q0, q0
90 ; CHECK-NEXT: vmov r0, r1, d9
91 ; CHECK-NEXT: bl __aeabi_d2ulz
92 ; CHECK-NEXT: mov r4, r0
93 ; CHECK-NEXT: mov r5, r1
94 ; CHECK-NEXT: vmov r0, r1, d8
95 ; CHECK-NEXT: vmov.32 d9[0], r4
96 ; CHECK-NEXT: bl __aeabi_d2ulz
97 ; CHECK-NEXT: mvn r3, #0
98 ; CHECK-NEXT: vmov.32 d8[0], r0
99 ; CHECK-NEXT: subs r0, r0, r3
100 ; CHECK-NEXT: mov r2, #0
101 ; CHECK-NEXT: sbcs r0, r1, #0
102 ; CHECK-NEXT: mov r0, #0
103 ; CHECK-NEXT: movwlo r0, #1
104 ; CHECK-NEXT: subs r1, r4, r3
105 ; CHECK-NEXT: sbcs r1, r5, #0
106 ; CHECK-NEXT: movwlo r2, #1
107 ; CHECK-NEXT: cmp r2, #0
108 ; CHECK-NEXT: mvnne r2, #0
109 ; CHECK-NEXT: cmp r0, #0
110 ; CHECK-NEXT: vdup.32 d17, r2
111 ; CHECK-NEXT: mvnne r0, #0
112 ; CHECK-NEXT: vdup.32 d16, r0
113 ; CHECK-NEXT: vand q9, q4, q8
114 ; CHECK-NEXT: vorn q8, q9, q8
115 ; CHECK-NEXT: vmovn.i64 d0, q8
116 ; CHECK-NEXT: vpop {d8, d9}
117 ; CHECK-NEXT: pop {r4, r5, r11, pc}
119 %conv = fptoui <2 x double> %x to <2 x i64>
120 %0 = icmp ult <2 x i64> %conv, <i64 4294967295, i64 4294967295>
121 %spec.store.select = select <2 x i1> %0, <2 x i64> %conv, <2 x i64> <i64 4294967295, i64 4294967295>
122 %conv6 = trunc <2 x i64> %spec.store.select to <2 x i32>
126 define <2 x i32> @ustest_f64i32(<2 x double> %x) {
127 ; CHECK-LABEL: ustest_f64i32:
128 ; CHECK: @ %bb.0: @ %entry
129 ; CHECK-NEXT: .save {r4, r5, r11, lr}
130 ; CHECK-NEXT: push {r4, r5, r11, lr}
131 ; CHECK-NEXT: .vsave {d8, d9}
132 ; CHECK-NEXT: vpush {d8, d9}
133 ; CHECK-NEXT: vorr q4, q0, q0
134 ; CHECK-NEXT: vmov r0, r1, d8
135 ; CHECK-NEXT: bl __aeabi_d2lz
136 ; CHECK-NEXT: mov r4, r0
137 ; CHECK-NEXT: mov r5, r1
138 ; CHECK-NEXT: vmov r0, r1, d9
139 ; CHECK-NEXT: vmov.32 d8[0], r4
140 ; CHECK-NEXT: bl __aeabi_d2lz
141 ; CHECK-NEXT: mvn r3, #0
142 ; CHECK-NEXT: subs r4, r4, r3
143 ; CHECK-NEXT: sbcs r4, r5, #0
144 ; CHECK-NEXT: vmov.32 d9[0], r0
145 ; CHECK-NEXT: mov r4, #0
146 ; CHECK-NEXT: vmov.i64 q9, #0xffffffff
147 ; CHECK-NEXT: movwlt r4, #1
148 ; CHECK-NEXT: subs r0, r0, r3
149 ; CHECK-NEXT: sbcs r0, r1, #0
150 ; CHECK-NEXT: vmov.32 d9[1], r1
151 ; CHECK-NEXT: mov r0, #0
152 ; CHECK-NEXT: mov r2, #0
153 ; CHECK-NEXT: movwlt r0, #1
154 ; CHECK-NEXT: cmp r0, #0
155 ; CHECK-NEXT: mvnne r0, #0
156 ; CHECK-NEXT: cmp r4, #0
157 ; CHECK-NEXT: vmov.32 d8[1], r5
158 ; CHECK-NEXT: mvnne r4, #0
159 ; CHECK-NEXT: vdup.32 d17, r0
160 ; CHECK-NEXT: vdup.32 d16, r4
161 ; CHECK-NEXT: vbsl q8, q4, q9
162 ; CHECK-NEXT: vmov r0, r1, d16
163 ; CHECK-NEXT: vmov r3, r5, d17
164 ; CHECK-NEXT: rsbs r0, r0, #0
165 ; CHECK-NEXT: rscs r0, r1, #0
166 ; CHECK-NEXT: mov r0, #0
167 ; CHECK-NEXT: movwlt r0, #1
168 ; CHECK-NEXT: rsbs r1, r3, #0
169 ; CHECK-NEXT: rscs r1, r5, #0
170 ; CHECK-NEXT: movwlt r2, #1
171 ; CHECK-NEXT: cmp r2, #0
172 ; CHECK-NEXT: mvnne r2, #0
173 ; CHECK-NEXT: cmp r0, #0
174 ; CHECK-NEXT: vmov.32 d19[0], r2
175 ; CHECK-NEXT: mvnne r0, #0
176 ; CHECK-NEXT: vmov.32 d18[0], r0
177 ; CHECK-NEXT: vand q8, q8, q9
178 ; CHECK-NEXT: vmovn.i64 d0, q8
179 ; CHECK-NEXT: vpop {d8, d9}
180 ; CHECK-NEXT: pop {r4, r5, r11, pc}
182 %conv = fptosi <2 x double> %x to <2 x i64>
183 %0 = icmp slt <2 x i64> %conv, <i64 4294967295, i64 4294967295>
184 %spec.store.select = select <2 x i1> %0, <2 x i64> %conv, <2 x i64> <i64 4294967295, i64 4294967295>
185 %1 = icmp sgt <2 x i64> %spec.store.select, zeroinitializer
186 %spec.store.select7 = select <2 x i1> %1, <2 x i64> %spec.store.select, <2 x i64> zeroinitializer
187 %conv6 = trunc <2 x i64> %spec.store.select7 to <2 x i32>
191 define <4 x i32> @stest_f32i32(<4 x float> %x) {
192 ; CHECK-LABEL: stest_f32i32:
193 ; CHECK: @ %bb.0: @ %entry
194 ; CHECK-NEXT: .save {r4, r5, r6, r7, r8, r9, r10, r11, lr}
195 ; CHECK-NEXT: push {r4, r5, r6, r7, r8, r9, r10, r11, lr}
196 ; CHECK-NEXT: .pad #4
197 ; CHECK-NEXT: sub sp, sp, #4
198 ; CHECK-NEXT: .vsave {d8, d9, d10, d11}
199 ; CHECK-NEXT: vpush {d8, d9, d10, d11}
200 ; CHECK-NEXT: vorr q4, q0, q0
201 ; CHECK-NEXT: vmov r0, s16
202 ; CHECK-NEXT: bl __aeabi_f2lz
203 ; CHECK-NEXT: mov r7, r0
204 ; CHECK-NEXT: vmov r0, s18
205 ; CHECK-NEXT: mov r8, r1
206 ; CHECK-NEXT: vmov r6, s17
207 ; CHECK-NEXT: vmov r10, s19
208 ; CHECK-NEXT: vmov.32 d8[0], r7
209 ; CHECK-NEXT: bl __aeabi_f2lz
210 ; CHECK-NEXT: mov r5, r0
211 ; CHECK-NEXT: vmov.32 d10[0], r0
212 ; CHECK-NEXT: mov r0, r6
213 ; CHECK-NEXT: mov r4, r1
214 ; CHECK-NEXT: bl __aeabi_f2lz
215 ; CHECK-NEXT: mov r9, r0
216 ; CHECK-NEXT: vmov.32 d9[0], r0
217 ; CHECK-NEXT: mov r0, r10
218 ; CHECK-NEXT: mov r11, r1
219 ; CHECK-NEXT: bl __aeabi_f2lz
220 ; CHECK-NEXT: mvn r6, #-2147483648
221 ; CHECK-NEXT: subs r3, r7, r6
222 ; CHECK-NEXT: sbcs r3, r8, #0
223 ; CHECK-NEXT: vmov.32 d11[0], r0
224 ; CHECK-NEXT: mov r3, #0
225 ; CHECK-NEXT: adr r2, .LCPI3_0
226 ; CHECK-NEXT: movwlt r3, #1
227 ; CHECK-NEXT: subs r7, r5, r6
228 ; CHECK-NEXT: sbcs r7, r4, #0
229 ; CHECK-NEXT: vmov.32 d11[1], r1
230 ; CHECK-NEXT: mov r7, #0
231 ; CHECK-NEXT: movwlt r7, #1
232 ; CHECK-NEXT: cmp r7, #0
233 ; CHECK-NEXT: mvnne r7, #0
234 ; CHECK-NEXT: subs r0, r0, r6
235 ; CHECK-NEXT: sbcs r0, r1, #0
236 ; CHECK-NEXT: vld1.64 {d18, d19}, [r2:128]
237 ; CHECK-NEXT: mov r0, #0
238 ; CHECK-NEXT: mov r2, #0
239 ; CHECK-NEXT: movwlt r0, #1
240 ; CHECK-NEXT: cmp r0, #0
241 ; CHECK-NEXT: mvnne r0, #0
242 ; CHECK-NEXT: vmov.32 d10[1], r4
243 ; CHECK-NEXT: vdup.32 d17, r0
244 ; CHECK-NEXT: subs r0, r9, r6
245 ; CHECK-NEXT: sbcs r0, r11, #0
246 ; CHECK-NEXT: vdup.32 d16, r7
247 ; CHECK-NEXT: mov r0, #0
248 ; CHECK-NEXT: vbsl q8, q5, q9
249 ; CHECK-NEXT: movwlt r0, #1
250 ; CHECK-NEXT: cmp r0, #0
251 ; CHECK-NEXT: vmov.32 d9[1], r11
252 ; CHECK-NEXT: mvnne r0, #0
253 ; CHECK-NEXT: cmp r3, #0
254 ; CHECK-NEXT: mvn r6, #0
255 ; CHECK-NEXT: vdup.32 d21, r0
256 ; CHECK-NEXT: mvnne r3, #0
257 ; CHECK-NEXT: vmov.32 d8[1], r8
258 ; CHECK-NEXT: vmov r0, r1, d16
259 ; CHECK-NEXT: vdup.32 d20, r3
260 ; CHECK-NEXT: vbit q9, q4, q10
261 ; CHECK-NEXT: adr r5, .LCPI3_1
262 ; CHECK-NEXT: vld1.64 {d20, d21}, [r5:128]
263 ; CHECK-NEXT: vmov r5, r4, d17
264 ; CHECK-NEXT: vmov r3, r7, d18
265 ; CHECK-NEXT: rsbs r0, r0, #-2147483648
266 ; CHECK-NEXT: sbcs r0, r6, r1
267 ; CHECK-NEXT: mov r0, #0
268 ; CHECK-NEXT: movwlt r0, #1
269 ; CHECK-NEXT: cmp r0, #0
270 ; CHECK-NEXT: mvnne r0, #0
271 ; CHECK-NEXT: rsbs r1, r3, #-2147483648
272 ; CHECK-NEXT: vmov r1, r3, d19
273 ; CHECK-NEXT: sbcs r7, r6, r7
274 ; CHECK-NEXT: mov r7, #0
275 ; CHECK-NEXT: movwlt r7, #1
276 ; CHECK-NEXT: rsbs r5, r5, #-2147483648
277 ; CHECK-NEXT: sbcs r5, r6, r4
278 ; CHECK-NEXT: mov r5, #0
279 ; CHECK-NEXT: movwlt r5, #1
280 ; CHECK-NEXT: rsbs r1, r1, #-2147483648
281 ; CHECK-NEXT: sbcs r1, r6, r3
282 ; CHECK-NEXT: movwlt r2, #1
283 ; CHECK-NEXT: cmp r2, #0
284 ; CHECK-NEXT: mvnne r2, #0
285 ; CHECK-NEXT: cmp r5, #0
286 ; CHECK-NEXT: mvnne r5, #0
287 ; CHECK-NEXT: cmp r7, #0
288 ; CHECK-NEXT: vdup.32 d25, r5
289 ; CHECK-NEXT: mvnne r7, #0
290 ; CHECK-NEXT: vdup.32 d23, r2
291 ; CHECK-NEXT: vdup.32 d24, r0
292 ; CHECK-NEXT: vbif q8, q10, q12
293 ; CHECK-NEXT: vdup.32 d22, r7
294 ; CHECK-NEXT: vbif q9, q10, q11
295 ; CHECK-NEXT: vmovn.i64 d1, q8
296 ; CHECK-NEXT: vmovn.i64 d0, q9
297 ; CHECK-NEXT: vpop {d8, d9, d10, d11}
298 ; CHECK-NEXT: add sp, sp, #4
299 ; CHECK-NEXT: pop {r4, r5, r6, r7, r8, r9, r10, r11, pc}
300 ; CHECK-NEXT: .p2align 4
301 ; CHECK-NEXT: @ %bb.1:
302 ; CHECK-NEXT: .LCPI3_0:
303 ; CHECK-NEXT: .long 2147483647 @ 0x7fffffff
304 ; CHECK-NEXT: .long 0 @ 0x0
305 ; CHECK-NEXT: .long 2147483647 @ 0x7fffffff
306 ; CHECK-NEXT: .long 0 @ 0x0
307 ; CHECK-NEXT: .LCPI3_1:
308 ; CHECK-NEXT: .long 2147483648 @ 0x80000000
309 ; CHECK-NEXT: .long 4294967295 @ 0xffffffff
310 ; CHECK-NEXT: .long 2147483648 @ 0x80000000
311 ; CHECK-NEXT: .long 4294967295 @ 0xffffffff
313 %conv = fptosi <4 x float> %x to <4 x i64>
314 %0 = icmp slt <4 x i64> %conv, <i64 2147483647, i64 2147483647, i64 2147483647, i64 2147483647>
315 %spec.store.select = select <4 x i1> %0, <4 x i64> %conv, <4 x i64> <i64 2147483647, i64 2147483647, i64 2147483647, i64 2147483647>
316 %1 = icmp sgt <4 x i64> %spec.store.select, <i64 -2147483648, i64 -2147483648, i64 -2147483648, i64 -2147483648>
317 %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>
318 %conv6 = trunc <4 x i64> %spec.store.select7 to <4 x i32>
322 define <4 x i32> @utest_f32i32(<4 x float> %x) {
323 ; CHECK-LABEL: utest_f32i32:
324 ; CHECK: @ %bb.0: @ %entry
325 ; CHECK-NEXT: .save {r4, r5, r6, r7, r8, r9, r10, lr}
326 ; CHECK-NEXT: push {r4, r5, r6, r7, r8, r9, r10, lr}
327 ; CHECK-NEXT: .vsave {d8, d9, d10, d11}
328 ; CHECK-NEXT: vpush {d8, d9, d10, d11}
329 ; CHECK-NEXT: vorr q4, q0, q0
330 ; CHECK-NEXT: vmov r0, s17
331 ; CHECK-NEXT: bl __aeabi_f2ulz
332 ; CHECK-NEXT: mov r9, r0
333 ; CHECK-NEXT: vmov r0, s16
334 ; CHECK-NEXT: mov r8, r1
335 ; CHECK-NEXT: vmov r6, s19
336 ; CHECK-NEXT: vmov r7, s18
337 ; CHECK-NEXT: vmov.32 d9[0], r9
338 ; CHECK-NEXT: bl __aeabi_f2ulz
339 ; CHECK-NEXT: mov r5, r0
340 ; CHECK-NEXT: vmov.32 d8[0], r0
341 ; CHECK-NEXT: mov r0, r6
342 ; CHECK-NEXT: mov r4, r1
343 ; CHECK-NEXT: bl __aeabi_f2ulz
344 ; CHECK-NEXT: mov r6, r0
345 ; CHECK-NEXT: vmov.32 d11[0], r0
346 ; CHECK-NEXT: mov r0, r7
347 ; CHECK-NEXT: mov r10, r1
348 ; CHECK-NEXT: bl __aeabi_f2ulz
349 ; CHECK-NEXT: mvn r7, #0
350 ; CHECK-NEXT: subs r2, r5, r7
351 ; CHECK-NEXT: sbcs r2, r4, #0
352 ; CHECK-NEXT: vmov.32 d10[0], r0
353 ; CHECK-NEXT: mov r2, #0
354 ; CHECK-NEXT: mov r3, #0
355 ; CHECK-NEXT: movwlo r2, #1
356 ; CHECK-NEXT: subs r0, r0, r7
357 ; CHECK-NEXT: sbcs r0, r1, #0
358 ; CHECK-NEXT: mov r0, #0
359 ; CHECK-NEXT: movwlo r0, #1
360 ; CHECK-NEXT: cmp r0, #0
361 ; CHECK-NEXT: mvnne r0, #0
362 ; CHECK-NEXT: subs r1, r6, r7
363 ; CHECK-NEXT: sbcs r1, r10, #0
364 ; CHECK-NEXT: mov r1, #0
365 ; CHECK-NEXT: movwlo r1, #1
366 ; CHECK-NEXT: subs r7, r9, r7
367 ; CHECK-NEXT: sbcs r7, r8, #0
368 ; CHECK-NEXT: movwlo r3, #1
369 ; CHECK-NEXT: cmp r3, #0
370 ; CHECK-NEXT: mvnne r3, #0
371 ; CHECK-NEXT: cmp r1, #0
372 ; CHECK-NEXT: mvnne r1, #0
373 ; CHECK-NEXT: cmp r2, #0
374 ; CHECK-NEXT: vdup.32 d19, r1
375 ; CHECK-NEXT: mvnne r2, #0
376 ; CHECK-NEXT: vdup.32 d17, r3
377 ; CHECK-NEXT: vdup.32 d18, r0
378 ; CHECK-NEXT: vand q10, q5, q9
379 ; CHECK-NEXT: vdup.32 d16, r2
380 ; CHECK-NEXT: vand q11, q4, q8
381 ; CHECK-NEXT: vorn q9, q10, q9
382 ; CHECK-NEXT: vorn q8, q11, q8
383 ; CHECK-NEXT: vmovn.i64 d1, q9
384 ; CHECK-NEXT: vmovn.i64 d0, q8
385 ; CHECK-NEXT: vpop {d8, d9, d10, d11}
386 ; CHECK-NEXT: pop {r4, r5, r6, r7, r8, r9, r10, pc}
388 %conv = fptoui <4 x float> %x to <4 x i64>
389 %0 = icmp ult <4 x i64> %conv, <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>
390 %spec.store.select = select <4 x i1> %0, <4 x i64> %conv, <4 x i64> <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>
391 %conv6 = trunc <4 x i64> %spec.store.select to <4 x i32>
395 define <4 x i32> @ustest_f32i32(<4 x float> %x) {
396 ; CHECK-LABEL: ustest_f32i32:
397 ; CHECK: @ %bb.0: @ %entry
398 ; CHECK-NEXT: .save {r4, r5, r6, r7, r8, r9, r10, lr}
399 ; CHECK-NEXT: push {r4, r5, r6, r7, r8, r9, r10, lr}
400 ; CHECK-NEXT: .vsave {d8, d9, d10, d11, d12, d13}
401 ; CHECK-NEXT: vpush {d8, d9, d10, d11, d12, d13}
402 ; CHECK-NEXT: vorr q4, q0, q0
403 ; CHECK-NEXT: vmov r0, s17
404 ; CHECK-NEXT: bl __aeabi_f2lz
405 ; CHECK-NEXT: mov r5, r0
406 ; CHECK-NEXT: vmov r0, s16
407 ; CHECK-NEXT: mov r6, r1
408 ; CHECK-NEXT: bl __aeabi_f2lz
409 ; CHECK-NEXT: mov r2, r0
410 ; CHECK-NEXT: vmov r0, s18
411 ; CHECK-NEXT: vmov.32 d16[0], r2
412 ; CHECK-NEXT: mvn r4, #0
413 ; CHECK-NEXT: subs r2, r2, r4
414 ; CHECK-NEXT: vmov r8, s19
415 ; CHECK-NEXT: sbcs r2, r1, #0
416 ; CHECK-NEXT: vmov.32 d17[0], r5
417 ; CHECK-NEXT: mov r2, #0
418 ; CHECK-NEXT: vmov.i64 q5, #0xffffffff
419 ; CHECK-NEXT: movwlt r2, #1
420 ; CHECK-NEXT: subs r3, r5, r4
421 ; CHECK-NEXT: sbcs r3, r6, #0
422 ; CHECK-NEXT: vmov.32 d17[1], r6
423 ; CHECK-NEXT: mov r3, #0
424 ; CHECK-NEXT: mov r7, #0
425 ; CHECK-NEXT: movwlt r3, #1
426 ; CHECK-NEXT: cmp r3, #0
427 ; CHECK-NEXT: mvnne r3, #0
428 ; CHECK-NEXT: cmp r2, #0
429 ; CHECK-NEXT: vdup.32 d19, r3
430 ; CHECK-NEXT: mvnne r2, #0
431 ; CHECK-NEXT: vdup.32 d18, r2
432 ; CHECK-NEXT: vmov.32 d16[1], r1
433 ; CHECK-NEXT: vorr q4, q9, q9
434 ; CHECK-NEXT: vbsl q4, q8, q5
435 ; CHECK-NEXT: vmov r10, r9, d8
436 ; CHECK-NEXT: bl __aeabi_f2lz
437 ; CHECK-NEXT: mov r5, r0
438 ; CHECK-NEXT: vmov.32 d12[0], r0
439 ; CHECK-NEXT: mov r0, r8
440 ; CHECK-NEXT: mov r6, r1
441 ; CHECK-NEXT: bl __aeabi_f2lz
442 ; CHECK-NEXT: subs r2, r5, r4
443 ; CHECK-NEXT: vmov.32 d13[0], r0
444 ; CHECK-NEXT: sbcs r2, r6, #0
445 ; CHECK-NEXT: mov r2, #0
446 ; CHECK-NEXT: movwlt r2, #1
447 ; CHECK-NEXT: subs r0, r0, r4
448 ; CHECK-NEXT: sbcs r0, r1, #0
449 ; CHECK-NEXT: vmov.32 d13[1], r1
450 ; CHECK-NEXT: mov r0, #0
451 ; CHECK-NEXT: vmov r5, r4, d9
452 ; CHECK-NEXT: movwlt r0, #1
453 ; CHECK-NEXT: cmp r0, #0
454 ; CHECK-NEXT: mvnne r0, #0
455 ; CHECK-NEXT: cmp r2, #0
456 ; CHECK-NEXT: vmov.32 d12[1], r6
457 ; CHECK-NEXT: mvnne r2, #0
458 ; CHECK-NEXT: vdup.32 d17, r0
459 ; CHECK-NEXT: rsbs r0, r10, #0
460 ; CHECK-NEXT: vdup.32 d16, r2
461 ; CHECK-NEXT: rscs r0, r9, #0
462 ; CHECK-NEXT: vbsl q8, q6, q5
463 ; CHECK-NEXT: mov r0, #0
464 ; CHECK-NEXT: movwlt r0, #1
465 ; CHECK-NEXT: vmov r1, r2, d16
466 ; CHECK-NEXT: vmov r3, r6, d17
467 ; CHECK-NEXT: rsbs r1, r1, #0
468 ; CHECK-NEXT: rscs r1, r2, #0
469 ; CHECK-NEXT: mov r1, #0
470 ; CHECK-NEXT: movwlt r1, #1
471 ; CHECK-NEXT: rsbs r2, r3, #0
472 ; CHECK-NEXT: rscs r2, r6, #0
473 ; CHECK-NEXT: mov r2, #0
474 ; CHECK-NEXT: movwlt r2, #1
475 ; CHECK-NEXT: rsbs r3, r5, #0
476 ; CHECK-NEXT: rscs r3, r4, #0
477 ; CHECK-NEXT: movwlt r7, #1
478 ; CHECK-NEXT: cmp r7, #0
479 ; CHECK-NEXT: mvnne r7, #0
480 ; CHECK-NEXT: cmp r2, #0
481 ; CHECK-NEXT: mvnne r2, #0
482 ; CHECK-NEXT: cmp r1, #0
483 ; CHECK-NEXT: mvnne r1, #0
484 ; CHECK-NEXT: vmov.32 d21[0], r2
485 ; CHECK-NEXT: cmp r0, #0
486 ; CHECK-NEXT: vmov.32 d20[0], r1
487 ; CHECK-NEXT: mvnne r0, #0
488 ; CHECK-NEXT: vmov.32 d19[0], r7
489 ; CHECK-NEXT: vand q8, q8, q10
490 ; CHECK-NEXT: vmov.32 d18[0], r0
491 ; CHECK-NEXT: vmovn.i64 d1, q8
492 ; CHECK-NEXT: vand q9, q4, q9
493 ; CHECK-NEXT: vmovn.i64 d0, q9
494 ; CHECK-NEXT: vpop {d8, d9, d10, d11, d12, d13}
495 ; CHECK-NEXT: pop {r4, r5, r6, r7, r8, r9, r10, pc}
497 %conv = fptosi <4 x float> %x to <4 x i64>
498 %0 = icmp slt <4 x i64> %conv, <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>
499 %spec.store.select = select <4 x i1> %0, <4 x i64> %conv, <4 x i64> <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>
500 %1 = icmp sgt <4 x i64> %spec.store.select, zeroinitializer
501 %spec.store.select7 = select <4 x i1> %1, <4 x i64> %spec.store.select, <4 x i64> zeroinitializer
502 %conv6 = trunc <4 x i64> %spec.store.select7 to <4 x i32>
506 define <4 x i32> @stest_f16i32(<4 x half> %x) {
507 ; CHECK-NEON-LABEL: stest_f16i32:
508 ; CHECK-NEON: @ %bb.0: @ %entry
509 ; CHECK-NEON-NEXT: .save {r4, r5, r6, r7, r8, r9, r10, r11, lr}
510 ; CHECK-NEON-NEXT: push {r4, r5, r6, r7, r8, r9, r10, r11, lr}
511 ; CHECK-NEON-NEXT: .pad #4
512 ; CHECK-NEON-NEXT: sub sp, sp, #4
513 ; CHECK-NEON-NEXT: .vsave {d8, d9, d10, d11}
514 ; CHECK-NEON-NEXT: vpush {d8, d9, d10, d11}
515 ; CHECK-NEON-NEXT: vmov r0, s0
516 ; CHECK-NEON-NEXT: vmov.f32 s16, s3
517 ; CHECK-NEON-NEXT: vmov.f32 s18, s2
518 ; CHECK-NEON-NEXT: vmov.f32 s20, s1
519 ; CHECK-NEON-NEXT: bl __aeabi_h2f
520 ; CHECK-NEON-NEXT: bl __aeabi_f2lz
521 ; CHECK-NEON-NEXT: mov r9, r0
522 ; CHECK-NEON-NEXT: vmov r0, s18
523 ; CHECK-NEON-NEXT: vmov r10, s16
524 ; CHECK-NEON-NEXT: mov r8, r1
525 ; CHECK-NEON-NEXT: vmov r6, s20
526 ; CHECK-NEON-NEXT: vmov.32 d8[0], r9
527 ; CHECK-NEON-NEXT: bl __aeabi_h2f
528 ; CHECK-NEON-NEXT: bl __aeabi_f2lz
529 ; CHECK-NEON-NEXT: mov r5, r0
530 ; CHECK-NEON-NEXT: vmov.32 d10[0], r0
531 ; CHECK-NEON-NEXT: mov r0, r6
532 ; CHECK-NEON-NEXT: mov r4, r1
533 ; CHECK-NEON-NEXT: bl __aeabi_h2f
534 ; CHECK-NEON-NEXT: bl __aeabi_f2lz
535 ; CHECK-NEON-NEXT: mov r11, r0
536 ; CHECK-NEON-NEXT: vmov.32 d9[0], r0
537 ; CHECK-NEON-NEXT: mov r0, r10
538 ; CHECK-NEON-NEXT: mov r7, r1
539 ; CHECK-NEON-NEXT: bl __aeabi_h2f
540 ; CHECK-NEON-NEXT: bl __aeabi_f2lz
541 ; CHECK-NEON-NEXT: mvn r6, #-2147483648
542 ; CHECK-NEON-NEXT: subs r3, r9, r6
543 ; CHECK-NEON-NEXT: sbcs r3, r8, #0
544 ; CHECK-NEON-NEXT: vmov.32 d11[0], r0
545 ; CHECK-NEON-NEXT: mov r3, #0
546 ; CHECK-NEON-NEXT: adr r2, .LCPI6_0
547 ; CHECK-NEON-NEXT: movwlt r3, #1
548 ; CHECK-NEON-NEXT: subs r5, r5, r6
549 ; CHECK-NEON-NEXT: sbcs r5, r4, #0
550 ; CHECK-NEON-NEXT: vmov.32 d11[1], r1
551 ; CHECK-NEON-NEXT: mov r5, #0
552 ; CHECK-NEON-NEXT: movwlt r5, #1
553 ; CHECK-NEON-NEXT: cmp r5, #0
554 ; CHECK-NEON-NEXT: mvnne r5, #0
555 ; CHECK-NEON-NEXT: subs r0, r0, r6
556 ; CHECK-NEON-NEXT: sbcs r0, r1, #0
557 ; CHECK-NEON-NEXT: vld1.64 {d18, d19}, [r2:128]
558 ; CHECK-NEON-NEXT: mov r0, #0
559 ; CHECK-NEON-NEXT: mov r2, #0
560 ; CHECK-NEON-NEXT: movwlt r0, #1
561 ; CHECK-NEON-NEXT: cmp r0, #0
562 ; CHECK-NEON-NEXT: mvnne r0, #0
563 ; CHECK-NEON-NEXT: vmov.32 d10[1], r4
564 ; CHECK-NEON-NEXT: vdup.32 d17, r0
565 ; CHECK-NEON-NEXT: subs r0, r11, r6
566 ; CHECK-NEON-NEXT: sbcs r0, r7, #0
567 ; CHECK-NEON-NEXT: vdup.32 d16, r5
568 ; CHECK-NEON-NEXT: mov r0, #0
569 ; CHECK-NEON-NEXT: vbsl q8, q5, q9
570 ; CHECK-NEON-NEXT: movwlt r0, #1
571 ; CHECK-NEON-NEXT: cmp r0, #0
572 ; CHECK-NEON-NEXT: vmov.32 d9[1], r7
573 ; CHECK-NEON-NEXT: mvnne r0, #0
574 ; CHECK-NEON-NEXT: cmp r3, #0
575 ; CHECK-NEON-NEXT: mvn r6, #0
576 ; CHECK-NEON-NEXT: vdup.32 d21, r0
577 ; CHECK-NEON-NEXT: mvnne r3, #0
578 ; CHECK-NEON-NEXT: vmov.32 d8[1], r8
579 ; CHECK-NEON-NEXT: vmov r0, r1, d16
580 ; CHECK-NEON-NEXT: vdup.32 d20, r3
581 ; CHECK-NEON-NEXT: vbit q9, q4, q10
582 ; CHECK-NEON-NEXT: adr r5, .LCPI6_1
583 ; CHECK-NEON-NEXT: vld1.64 {d20, d21}, [r5:128]
584 ; CHECK-NEON-NEXT: vmov r5, r4, d17
585 ; CHECK-NEON-NEXT: vmov r3, r7, d18
586 ; CHECK-NEON-NEXT: rsbs r0, r0, #-2147483648
587 ; CHECK-NEON-NEXT: sbcs r0, r6, r1
588 ; CHECK-NEON-NEXT: mov r0, #0
589 ; CHECK-NEON-NEXT: movwlt r0, #1
590 ; CHECK-NEON-NEXT: cmp r0, #0
591 ; CHECK-NEON-NEXT: mvnne r0, #0
592 ; CHECK-NEON-NEXT: rsbs r1, r3, #-2147483648
593 ; CHECK-NEON-NEXT: vmov r1, r3, d19
594 ; CHECK-NEON-NEXT: sbcs r7, r6, r7
595 ; CHECK-NEON-NEXT: mov r7, #0
596 ; CHECK-NEON-NEXT: movwlt r7, #1
597 ; CHECK-NEON-NEXT: rsbs r5, r5, #-2147483648
598 ; CHECK-NEON-NEXT: sbcs r5, r6, r4
599 ; CHECK-NEON-NEXT: mov r5, #0
600 ; CHECK-NEON-NEXT: movwlt r5, #1
601 ; CHECK-NEON-NEXT: rsbs r1, r1, #-2147483648
602 ; CHECK-NEON-NEXT: sbcs r1, r6, r3
603 ; CHECK-NEON-NEXT: movwlt r2, #1
604 ; CHECK-NEON-NEXT: cmp r2, #0
605 ; CHECK-NEON-NEXT: mvnne r2, #0
606 ; CHECK-NEON-NEXT: cmp r5, #0
607 ; CHECK-NEON-NEXT: mvnne r5, #0
608 ; CHECK-NEON-NEXT: cmp r7, #0
609 ; CHECK-NEON-NEXT: vdup.32 d25, r5
610 ; CHECK-NEON-NEXT: mvnne r7, #0
611 ; CHECK-NEON-NEXT: vdup.32 d23, r2
612 ; CHECK-NEON-NEXT: vdup.32 d24, r0
613 ; CHECK-NEON-NEXT: vbif q8, q10, q12
614 ; CHECK-NEON-NEXT: vdup.32 d22, r7
615 ; CHECK-NEON-NEXT: vbif q9, q10, q11
616 ; CHECK-NEON-NEXT: vmovn.i64 d1, q8
617 ; CHECK-NEON-NEXT: vmovn.i64 d0, q9
618 ; CHECK-NEON-NEXT: vpop {d8, d9, d10, d11}
619 ; CHECK-NEON-NEXT: add sp, sp, #4
620 ; CHECK-NEON-NEXT: pop {r4, r5, r6, r7, r8, r9, r10, r11, pc}
621 ; CHECK-NEON-NEXT: .p2align 4
622 ; CHECK-NEON-NEXT: @ %bb.1:
623 ; CHECK-NEON-NEXT: .LCPI6_0:
624 ; CHECK-NEON-NEXT: .long 2147483647 @ 0x7fffffff
625 ; CHECK-NEON-NEXT: .long 0 @ 0x0
626 ; CHECK-NEON-NEXT: .long 2147483647 @ 0x7fffffff
627 ; CHECK-NEON-NEXT: .long 0 @ 0x0
628 ; CHECK-NEON-NEXT: .LCPI6_1:
629 ; CHECK-NEON-NEXT: .long 2147483648 @ 0x80000000
630 ; CHECK-NEON-NEXT: .long 4294967295 @ 0xffffffff
631 ; CHECK-NEON-NEXT: .long 2147483648 @ 0x80000000
632 ; CHECK-NEON-NEXT: .long 4294967295 @ 0xffffffff
634 ; CHECK-FP16-LABEL: stest_f16i32:
635 ; CHECK-FP16: @ %bb.0: @ %entry
636 ; CHECK-FP16-NEXT: .save {r4, r5, r6, r7, r8, r9, r10, lr}
637 ; CHECK-FP16-NEXT: push {r4, r5, r6, r7, r8, r9, r10, lr}
638 ; CHECK-FP16-NEXT: .vsave {d10, d11, d12, d13}
639 ; CHECK-FP16-NEXT: vpush {d10, d11, d12, d13}
640 ; CHECK-FP16-NEXT: .vsave {d8}
641 ; CHECK-FP16-NEXT: vpush {d8}
642 ; CHECK-FP16-NEXT: vmov.u16 r0, d0[0]
643 ; CHECK-FP16-NEXT: vorr d8, d0, d0
644 ; CHECK-FP16-NEXT: vmov.u16 r6, d0[1]
645 ; CHECK-FP16-NEXT: vmov s0, r0
646 ; CHECK-FP16-NEXT: bl __fixhfdi
647 ; CHECK-FP16-NEXT: mov r4, r0
648 ; CHECK-FP16-NEXT: vmov.u16 r0, d8[2]
649 ; CHECK-FP16-NEXT: mov r8, r1
650 ; CHECK-FP16-NEXT: vmov.32 d10[0], r4
651 ; CHECK-FP16-NEXT: vmov s0, r0
652 ; CHECK-FP16-NEXT: bl __fixhfdi
653 ; CHECK-FP16-NEXT: vmov s0, r6
654 ; CHECK-FP16-NEXT: mov r5, r0
655 ; CHECK-FP16-NEXT: mov r7, r1
656 ; CHECK-FP16-NEXT: vmov.32 d12[0], r0
657 ; CHECK-FP16-NEXT: bl __fixhfdi
658 ; CHECK-FP16-NEXT: mov r9, r0
659 ; CHECK-FP16-NEXT: vmov.u16 r0, d8[3]
660 ; CHECK-FP16-NEXT: mov r10, r1
661 ; CHECK-FP16-NEXT: vmov.32 d11[0], r9
662 ; CHECK-FP16-NEXT: vmov s0, r0
663 ; CHECK-FP16-NEXT: bl __fixhfdi
664 ; CHECK-FP16-NEXT: mvn r6, #-2147483648
665 ; CHECK-FP16-NEXT: subs r3, r4, r6
666 ; CHECK-FP16-NEXT: sbcs r3, r8, #0
667 ; CHECK-FP16-NEXT: vmov.32 d13[0], r0
668 ; CHECK-FP16-NEXT: mov r3, #0
669 ; CHECK-FP16-NEXT: adr r2, .LCPI6_0
670 ; CHECK-FP16-NEXT: movwlt r3, #1
671 ; CHECK-FP16-NEXT: subs r5, r5, r6
672 ; CHECK-FP16-NEXT: sbcs r5, r7, #0
673 ; CHECK-FP16-NEXT: vmov.32 d13[1], r1
674 ; CHECK-FP16-NEXT: mov r5, #0
675 ; CHECK-FP16-NEXT: movwlt r5, #1
676 ; CHECK-FP16-NEXT: cmp r5, #0
677 ; CHECK-FP16-NEXT: mvnne r5, #0
678 ; CHECK-FP16-NEXT: subs r0, r0, r6
679 ; CHECK-FP16-NEXT: sbcs r0, r1, #0
680 ; CHECK-FP16-NEXT: vld1.64 {d18, d19}, [r2:128]
681 ; CHECK-FP16-NEXT: mov r0, #0
682 ; CHECK-FP16-NEXT: mov r2, #0
683 ; CHECK-FP16-NEXT: movwlt r0, #1
684 ; CHECK-FP16-NEXT: cmp r0, #0
685 ; CHECK-FP16-NEXT: mvnne r0, #0
686 ; CHECK-FP16-NEXT: vmov.32 d12[1], r7
687 ; CHECK-FP16-NEXT: vdup.32 d17, r0
688 ; CHECK-FP16-NEXT: subs r0, r9, r6
689 ; CHECK-FP16-NEXT: sbcs r0, r10, #0
690 ; CHECK-FP16-NEXT: vdup.32 d16, r5
691 ; CHECK-FP16-NEXT: mov r0, #0
692 ; CHECK-FP16-NEXT: vbsl q8, q6, q9
693 ; CHECK-FP16-NEXT: movwlt r0, #1
694 ; CHECK-FP16-NEXT: cmp r0, #0
695 ; CHECK-FP16-NEXT: vmov.32 d11[1], r10
696 ; CHECK-FP16-NEXT: mvnne r0, #0
697 ; CHECK-FP16-NEXT: cmp r3, #0
698 ; CHECK-FP16-NEXT: mvn r6, #0
699 ; CHECK-FP16-NEXT: vdup.32 d21, r0
700 ; CHECK-FP16-NEXT: mvnne r3, #0
701 ; CHECK-FP16-NEXT: vmov.32 d10[1], r8
702 ; CHECK-FP16-NEXT: vmov r0, r1, d16
703 ; CHECK-FP16-NEXT: vdup.32 d20, r3
704 ; CHECK-FP16-NEXT: vbit q9, q5, q10
705 ; CHECK-FP16-NEXT: adr r5, .LCPI6_1
706 ; CHECK-FP16-NEXT: vld1.64 {d20, d21}, [r5:128]
707 ; CHECK-FP16-NEXT: vmov r5, r4, d17
708 ; CHECK-FP16-NEXT: vmov r3, r7, d18
709 ; CHECK-FP16-NEXT: rsbs r0, r0, #-2147483648
710 ; CHECK-FP16-NEXT: sbcs r0, r6, r1
711 ; CHECK-FP16-NEXT: mov r0, #0
712 ; CHECK-FP16-NEXT: movwlt r0, #1
713 ; CHECK-FP16-NEXT: cmp r0, #0
714 ; CHECK-FP16-NEXT: mvnne r0, #0
715 ; CHECK-FP16-NEXT: rsbs r1, r3, #-2147483648
716 ; CHECK-FP16-NEXT: vmov r1, r3, d19
717 ; CHECK-FP16-NEXT: sbcs r7, r6, r7
718 ; CHECK-FP16-NEXT: mov r7, #0
719 ; CHECK-FP16-NEXT: movwlt r7, #1
720 ; CHECK-FP16-NEXT: rsbs r5, r5, #-2147483648
721 ; CHECK-FP16-NEXT: sbcs r5, r6, r4
722 ; CHECK-FP16-NEXT: mov r5, #0
723 ; CHECK-FP16-NEXT: movwlt r5, #1
724 ; CHECK-FP16-NEXT: rsbs r1, r1, #-2147483648
725 ; CHECK-FP16-NEXT: sbcs r1, r6, r3
726 ; CHECK-FP16-NEXT: movwlt r2, #1
727 ; CHECK-FP16-NEXT: cmp r2, #0
728 ; CHECK-FP16-NEXT: mvnne r2, #0
729 ; CHECK-FP16-NEXT: cmp r5, #0
730 ; CHECK-FP16-NEXT: mvnne r5, #0
731 ; CHECK-FP16-NEXT: cmp r7, #0
732 ; CHECK-FP16-NEXT: vdup.32 d25, r5
733 ; CHECK-FP16-NEXT: mvnne r7, #0
734 ; CHECK-FP16-NEXT: vdup.32 d23, r2
735 ; CHECK-FP16-NEXT: vdup.32 d24, r0
736 ; CHECK-FP16-NEXT: vbif q8, q10, q12
737 ; CHECK-FP16-NEXT: vdup.32 d22, r7
738 ; CHECK-FP16-NEXT: vbif q9, q10, q11
739 ; CHECK-FP16-NEXT: vmovn.i64 d1, q8
740 ; CHECK-FP16-NEXT: vmovn.i64 d0, q9
741 ; CHECK-FP16-NEXT: vpop {d8}
742 ; CHECK-FP16-NEXT: vpop {d10, d11, d12, d13}
743 ; CHECK-FP16-NEXT: pop {r4, r5, r6, r7, r8, r9, r10, pc}
744 ; CHECK-FP16-NEXT: .p2align 4
745 ; CHECK-FP16-NEXT: @ %bb.1:
746 ; CHECK-FP16-NEXT: .LCPI6_0:
747 ; CHECK-FP16-NEXT: .long 2147483647 @ 0x7fffffff
748 ; CHECK-FP16-NEXT: .long 0 @ 0x0
749 ; CHECK-FP16-NEXT: .long 2147483647 @ 0x7fffffff
750 ; CHECK-FP16-NEXT: .long 0 @ 0x0
751 ; CHECK-FP16-NEXT: .LCPI6_1:
752 ; CHECK-FP16-NEXT: .long 2147483648 @ 0x80000000
753 ; CHECK-FP16-NEXT: .long 4294967295 @ 0xffffffff
754 ; CHECK-FP16-NEXT: .long 2147483648 @ 0x80000000
755 ; CHECK-FP16-NEXT: .long 4294967295 @ 0xffffffff
757 %conv = fptosi <4 x half> %x to <4 x i64>
758 %0 = icmp slt <4 x i64> %conv, <i64 2147483647, i64 2147483647, i64 2147483647, i64 2147483647>
759 %spec.store.select = select <4 x i1> %0, <4 x i64> %conv, <4 x i64> <i64 2147483647, i64 2147483647, i64 2147483647, i64 2147483647>
760 %1 = icmp sgt <4 x i64> %spec.store.select, <i64 -2147483648, i64 -2147483648, i64 -2147483648, i64 -2147483648>
761 %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>
762 %conv6 = trunc <4 x i64> %spec.store.select7 to <4 x i32>
766 define <4 x i32> @utesth_f16i32(<4 x half> %x) {
767 ; CHECK-NEON-LABEL: utesth_f16i32:
768 ; CHECK-NEON: @ %bb.0: @ %entry
769 ; CHECK-NEON-NEXT: .save {r4, r5, r6, r7, r8, r9, r10, lr}
770 ; CHECK-NEON-NEXT: push {r4, r5, r6, r7, r8, r9, r10, lr}
771 ; CHECK-NEON-NEXT: .vsave {d12, d13}
772 ; CHECK-NEON-NEXT: vpush {d12, d13}
773 ; CHECK-NEON-NEXT: .vsave {d8, d9, d10}
774 ; CHECK-NEON-NEXT: vpush {d8, d9, d10}
775 ; CHECK-NEON-NEXT: vmov r0, s3
776 ; CHECK-NEON-NEXT: vmov.f32 s16, s2
777 ; CHECK-NEON-NEXT: vmov.f32 s18, s1
778 ; CHECK-NEON-NEXT: vmov.f32 s20, s0
779 ; CHECK-NEON-NEXT: bl __aeabi_h2f
780 ; CHECK-NEON-NEXT: bl __aeabi_f2ulz
781 ; CHECK-NEON-NEXT: mov r10, r0
782 ; CHECK-NEON-NEXT: vmov r0, s18
783 ; CHECK-NEON-NEXT: mov r8, r1
784 ; CHECK-NEON-NEXT: bl __aeabi_h2f
785 ; CHECK-NEON-NEXT: bl __aeabi_f2ulz
786 ; CHECK-NEON-NEXT: mov r6, r0
787 ; CHECK-NEON-NEXT: vmov.32 d13[0], r0
788 ; CHECK-NEON-NEXT: vmov r0, s20
789 ; CHECK-NEON-NEXT: mov r9, r1
790 ; CHECK-NEON-NEXT: bl __aeabi_h2f
791 ; CHECK-NEON-NEXT: bl __aeabi_f2ulz
792 ; CHECK-NEON-NEXT: mov r5, r0
793 ; CHECK-NEON-NEXT: vmov.32 d12[0], r0
794 ; CHECK-NEON-NEXT: vmov r0, s16
795 ; CHECK-NEON-NEXT: mov r7, r1
796 ; CHECK-NEON-NEXT: bl __aeabi_h2f
797 ; CHECK-NEON-NEXT: vmov.32 d9[0], r10
798 ; CHECK-NEON-NEXT: bl __aeabi_f2ulz
799 ; CHECK-NEON-NEXT: mvn r4, #0
800 ; CHECK-NEON-NEXT: subs r2, r5, r4
801 ; CHECK-NEON-NEXT: sbcs r2, r7, #0
802 ; CHECK-NEON-NEXT: vmov.32 d8[0], r0
803 ; CHECK-NEON-NEXT: mov r2, #0
804 ; CHECK-NEON-NEXT: mov r3, #0
805 ; CHECK-NEON-NEXT: movwlo r2, #1
806 ; CHECK-NEON-NEXT: subs r0, r0, r4
807 ; CHECK-NEON-NEXT: sbcs r0, r1, #0
808 ; CHECK-NEON-NEXT: mov r0, #0
809 ; CHECK-NEON-NEXT: movwlo r0, #1
810 ; CHECK-NEON-NEXT: cmp r0, #0
811 ; CHECK-NEON-NEXT: mvnne r0, #0
812 ; CHECK-NEON-NEXT: subs r1, r10, r4
813 ; CHECK-NEON-NEXT: sbcs r1, r8, #0
814 ; CHECK-NEON-NEXT: mov r1, #0
815 ; CHECK-NEON-NEXT: movwlo r1, #1
816 ; CHECK-NEON-NEXT: subs r7, r6, r4
817 ; CHECK-NEON-NEXT: sbcs r7, r9, #0
818 ; CHECK-NEON-NEXT: movwlo r3, #1
819 ; CHECK-NEON-NEXT: cmp r3, #0
820 ; CHECK-NEON-NEXT: mvnne r3, #0
821 ; CHECK-NEON-NEXT: cmp r1, #0
822 ; CHECK-NEON-NEXT: mvnne r1, #0
823 ; CHECK-NEON-NEXT: cmp r2, #0
824 ; CHECK-NEON-NEXT: vdup.32 d19, r1
825 ; CHECK-NEON-NEXT: mvnne r2, #0
826 ; CHECK-NEON-NEXT: vdup.32 d17, r3
827 ; CHECK-NEON-NEXT: vdup.32 d18, r0
828 ; CHECK-NEON-NEXT: vand q10, q4, q9
829 ; CHECK-NEON-NEXT: vdup.32 d16, r2
830 ; CHECK-NEON-NEXT: vand q11, q6, q8
831 ; CHECK-NEON-NEXT: vorn q9, q10, q9
832 ; CHECK-NEON-NEXT: vorn q8, q11, q8
833 ; CHECK-NEON-NEXT: vmovn.i64 d1, q9
834 ; CHECK-NEON-NEXT: vmovn.i64 d0, q8
835 ; CHECK-NEON-NEXT: vpop {d8, d9, d10}
836 ; CHECK-NEON-NEXT: vpop {d12, d13}
837 ; CHECK-NEON-NEXT: pop {r4, r5, r6, r7, r8, r9, r10, pc}
839 ; CHECK-FP16-LABEL: utesth_f16i32:
840 ; CHECK-FP16: @ %bb.0: @ %entry
841 ; CHECK-FP16-NEXT: .save {r4, r5, r6, r7, r8, r9, r10, lr}
842 ; CHECK-FP16-NEXT: push {r4, r5, r6, r7, r8, r9, r10, lr}
843 ; CHECK-FP16-NEXT: .vsave {d8, d9, d10, d11}
844 ; CHECK-FP16-NEXT: vpush {d8, d9, d10, d11}
845 ; CHECK-FP16-NEXT: vmov.u16 r0, d0[1]
846 ; CHECK-FP16-NEXT: vorr d8, d0, d0
847 ; CHECK-FP16-NEXT: vmov.u16 r5, d0[3]
848 ; CHECK-FP16-NEXT: vmov s0, r0
849 ; CHECK-FP16-NEXT: bl __fixunshfdi
850 ; CHECK-FP16-NEXT: mov r10, r0
851 ; CHECK-FP16-NEXT: vmov.u16 r0, d8[0]
852 ; CHECK-FP16-NEXT: mov r8, r1
853 ; CHECK-FP16-NEXT: vmov.32 d11[0], r10
854 ; CHECK-FP16-NEXT: vmov s0, r0
855 ; CHECK-FP16-NEXT: bl __fixunshfdi
856 ; CHECK-FP16-NEXT: vmov s0, r5
857 ; CHECK-FP16-NEXT: mov r6, r0
858 ; CHECK-FP16-NEXT: mov r7, r1
859 ; CHECK-FP16-NEXT: vmov.32 d10[0], r0
860 ; CHECK-FP16-NEXT: bl __fixunshfdi
861 ; CHECK-FP16-NEXT: mov r5, r0
862 ; CHECK-FP16-NEXT: vmov.u16 r0, d8[2]
863 ; CHECK-FP16-NEXT: mov r9, r1
864 ; CHECK-FP16-NEXT: vmov.32 d9[0], r5
865 ; CHECK-FP16-NEXT: vmov s0, r0
866 ; CHECK-FP16-NEXT: bl __fixunshfdi
867 ; CHECK-FP16-NEXT: mvn r4, #0
868 ; CHECK-FP16-NEXT: subs r2, r6, r4
869 ; CHECK-FP16-NEXT: sbcs r2, r7, #0
870 ; CHECK-FP16-NEXT: vmov.32 d8[0], r0
871 ; CHECK-FP16-NEXT: mov r2, #0
872 ; CHECK-FP16-NEXT: mov r3, #0
873 ; CHECK-FP16-NEXT: movwlo r2, #1
874 ; CHECK-FP16-NEXT: subs r0, r0, r4
875 ; CHECK-FP16-NEXT: sbcs r0, r1, #0
876 ; CHECK-FP16-NEXT: mov r0, #0
877 ; CHECK-FP16-NEXT: movwlo r0, #1
878 ; CHECK-FP16-NEXT: cmp r0, #0
879 ; CHECK-FP16-NEXT: mvnne r0, #0
880 ; CHECK-FP16-NEXT: subs r1, r5, r4
881 ; CHECK-FP16-NEXT: sbcs r1, r9, #0
882 ; CHECK-FP16-NEXT: mov r1, #0
883 ; CHECK-FP16-NEXT: movwlo r1, #1
884 ; CHECK-FP16-NEXT: subs r7, r10, r4
885 ; CHECK-FP16-NEXT: sbcs r7, r8, #0
886 ; CHECK-FP16-NEXT: movwlo r3, #1
887 ; CHECK-FP16-NEXT: cmp r3, #0
888 ; CHECK-FP16-NEXT: mvnne r3, #0
889 ; CHECK-FP16-NEXT: cmp r1, #0
890 ; CHECK-FP16-NEXT: mvnne r1, #0
891 ; CHECK-FP16-NEXT: cmp r2, #0
892 ; CHECK-FP16-NEXT: vdup.32 d19, r1
893 ; CHECK-FP16-NEXT: mvnne r2, #0
894 ; CHECK-FP16-NEXT: vdup.32 d17, r3
895 ; CHECK-FP16-NEXT: vdup.32 d18, r0
896 ; CHECK-FP16-NEXT: vand q10, q4, q9
897 ; CHECK-FP16-NEXT: vdup.32 d16, r2
898 ; CHECK-FP16-NEXT: vand q11, q5, q8
899 ; CHECK-FP16-NEXT: vorn q9, q10, q9
900 ; CHECK-FP16-NEXT: vorn q8, q11, q8
901 ; CHECK-FP16-NEXT: vmovn.i64 d1, q9
902 ; CHECK-FP16-NEXT: vmovn.i64 d0, q8
903 ; CHECK-FP16-NEXT: vpop {d8, d9, d10, d11}
904 ; CHECK-FP16-NEXT: pop {r4, r5, r6, r7, r8, r9, r10, pc}
906 %conv = fptoui <4 x half> %x to <4 x i64>
907 %0 = icmp ult <4 x i64> %conv, <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>
908 %spec.store.select = select <4 x i1> %0, <4 x i64> %conv, <4 x i64> <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>
909 %conv6 = trunc <4 x i64> %spec.store.select to <4 x i32>
913 define <4 x i32> @ustest_f16i32(<4 x half> %x) {
914 ; CHECK-NEON-LABEL: ustest_f16i32:
915 ; CHECK-NEON: @ %bb.0: @ %entry
916 ; CHECK-NEON-NEXT: .save {r4, r5, r6, r7, r8, r9, r10, lr}
917 ; CHECK-NEON-NEXT: push {r4, r5, r6, r7, r8, r9, r10, lr}
918 ; CHECK-NEON-NEXT: .vsave {d8, d9, d10, d11, d12, d13}
919 ; CHECK-NEON-NEXT: vpush {d8, d9, d10, d11, d12, d13}
920 ; CHECK-NEON-NEXT: vmov r0, s1
921 ; CHECK-NEON-NEXT: vmov.f32 s16, s3
922 ; CHECK-NEON-NEXT: vmov.f32 s18, s2
923 ; CHECK-NEON-NEXT: vmov.f32 s20, s0
924 ; CHECK-NEON-NEXT: bl __aeabi_h2f
925 ; CHECK-NEON-NEXT: bl __aeabi_f2lz
926 ; CHECK-NEON-NEXT: mov r6, r0
927 ; CHECK-NEON-NEXT: vmov r0, s20
928 ; CHECK-NEON-NEXT: mov r7, r1
929 ; CHECK-NEON-NEXT: vmov r5, s18
930 ; CHECK-NEON-NEXT: vmov r8, s16
931 ; CHECK-NEON-NEXT: vmov.32 d9[0], r6
932 ; CHECK-NEON-NEXT: bl __aeabi_h2f
933 ; CHECK-NEON-NEXT: bl __aeabi_f2lz
934 ; CHECK-NEON-NEXT: vmov.32 d8[0], r0
935 ; CHECK-NEON-NEXT: mvn r9, #0
936 ; CHECK-NEON-NEXT: subs r0, r0, r9
937 ; CHECK-NEON-NEXT: mov r4, #0
938 ; CHECK-NEON-NEXT: sbcs r0, r1, #0
939 ; CHECK-NEON-NEXT: vmov.32 d9[1], r7
940 ; CHECK-NEON-NEXT: mov r0, #0
941 ; CHECK-NEON-NEXT: movwlt r0, #1
942 ; CHECK-NEON-NEXT: cmp r0, #0
943 ; CHECK-NEON-NEXT: vmov.32 d8[1], r1
944 ; CHECK-NEON-NEXT: mvnne r0, #0
945 ; CHECK-NEON-NEXT: subs r1, r6, r9
946 ; CHECK-NEON-NEXT: sbcs r1, r7, #0
947 ; CHECK-NEON-NEXT: mov r1, #0
948 ; CHECK-NEON-NEXT: movwlt r1, #1
949 ; CHECK-NEON-NEXT: cmp r1, #0
950 ; CHECK-NEON-NEXT: mvnne r1, #0
951 ; CHECK-NEON-NEXT: vdup.32 d13, r1
952 ; CHECK-NEON-NEXT: vdup.32 d12, r0
953 ; CHECK-NEON-NEXT: mov r0, r5
954 ; CHECK-NEON-NEXT: bl __aeabi_h2f
955 ; CHECK-NEON-NEXT: vmov.i64 q5, #0xffffffff
956 ; CHECK-NEON-NEXT: vbif q4, q5, q6
957 ; CHECK-NEON-NEXT: bl __aeabi_f2lz
958 ; CHECK-NEON-NEXT: mov r5, r0
959 ; CHECK-NEON-NEXT: vmov.32 d12[0], r0
960 ; CHECK-NEON-NEXT: mov r0, r8
961 ; CHECK-NEON-NEXT: mov r6, r1
962 ; CHECK-NEON-NEXT: vmov r7, r10, d8
963 ; CHECK-NEON-NEXT: bl __aeabi_h2f
964 ; CHECK-NEON-NEXT: bl __aeabi_f2lz
965 ; CHECK-NEON-NEXT: subs r2, r5, r9
966 ; CHECK-NEON-NEXT: vmov.32 d13[0], r0
967 ; CHECK-NEON-NEXT: sbcs r2, r6, #0
968 ; CHECK-NEON-NEXT: mov r2, #0
969 ; CHECK-NEON-NEXT: movwlt r2, #1
970 ; CHECK-NEON-NEXT: subs r0, r0, r9
971 ; CHECK-NEON-NEXT: sbcs r0, r1, #0
972 ; CHECK-NEON-NEXT: vmov.32 d13[1], r1
973 ; CHECK-NEON-NEXT: mov r0, #0
974 ; CHECK-NEON-NEXT: movwlt r0, #1
975 ; CHECK-NEON-NEXT: cmp r0, #0
976 ; CHECK-NEON-NEXT: mvnne r0, #0
977 ; CHECK-NEON-NEXT: cmp r2, #0
978 ; CHECK-NEON-NEXT: vmov.32 d12[1], r6
979 ; CHECK-NEON-NEXT: mvnne r2, #0
980 ; CHECK-NEON-NEXT: vdup.32 d17, r0
981 ; CHECK-NEON-NEXT: rsbs r0, r7, #0
982 ; CHECK-NEON-NEXT: vdup.32 d16, r2
983 ; CHECK-NEON-NEXT: vmov r7, r5, d9
984 ; CHECK-NEON-NEXT: vbsl q8, q6, q5
985 ; CHECK-NEON-NEXT: rscs r0, r10, #0
986 ; CHECK-NEON-NEXT: mov r0, #0
987 ; CHECK-NEON-NEXT: movwlt r0, #1
988 ; CHECK-NEON-NEXT: vmov r1, r2, d16
989 ; CHECK-NEON-NEXT: vmov r3, r6, d17
990 ; CHECK-NEON-NEXT: rsbs r1, r1, #0
991 ; CHECK-NEON-NEXT: rscs r1, r2, #0
992 ; CHECK-NEON-NEXT: mov r1, #0
993 ; CHECK-NEON-NEXT: movwlt r1, #1
994 ; CHECK-NEON-NEXT: rsbs r2, r3, #0
995 ; CHECK-NEON-NEXT: rscs r2, r6, #0
996 ; CHECK-NEON-NEXT: mov r2, #0
997 ; CHECK-NEON-NEXT: movwlt r2, #1
998 ; CHECK-NEON-NEXT: rsbs r3, r7, #0
999 ; CHECK-NEON-NEXT: rscs r3, r5, #0
1000 ; CHECK-NEON-NEXT: movwlt r4, #1
1001 ; CHECK-NEON-NEXT: cmp r4, #0
1002 ; CHECK-NEON-NEXT: mvnne r4, #0
1003 ; CHECK-NEON-NEXT: cmp r2, #0
1004 ; CHECK-NEON-NEXT: mvnne r2, #0
1005 ; CHECK-NEON-NEXT: cmp r1, #0
1006 ; CHECK-NEON-NEXT: mvnne r1, #0
1007 ; CHECK-NEON-NEXT: vmov.32 d21[0], r2
1008 ; CHECK-NEON-NEXT: cmp r0, #0
1009 ; CHECK-NEON-NEXT: vmov.32 d20[0], r1
1010 ; CHECK-NEON-NEXT: mvnne r0, #0
1011 ; CHECK-NEON-NEXT: vmov.32 d19[0], r4
1012 ; CHECK-NEON-NEXT: vand q8, q8, q10
1013 ; CHECK-NEON-NEXT: vmov.32 d18[0], r0
1014 ; CHECK-NEON-NEXT: vmovn.i64 d1, q8
1015 ; CHECK-NEON-NEXT: vand q9, q4, q9
1016 ; CHECK-NEON-NEXT: vmovn.i64 d0, q9
1017 ; CHECK-NEON-NEXT: vpop {d8, d9, d10, d11, d12, d13}
1018 ; CHECK-NEON-NEXT: pop {r4, r5, r6, r7, r8, r9, r10, pc}
1020 ; CHECK-FP16-LABEL: ustest_f16i32:
1021 ; CHECK-FP16: @ %bb.0: @ %entry
1022 ; CHECK-FP16-NEXT: .save {r4, r5, r6, r7, r8, r9, r11, lr}
1023 ; CHECK-FP16-NEXT: push {r4, r5, r6, r7, r8, r9, r11, lr}
1024 ; CHECK-FP16-NEXT: .vsave {d10, d11, d12, d13, d14, d15}
1025 ; CHECK-FP16-NEXT: vpush {d10, d11, d12, d13, d14, d15}
1026 ; CHECK-FP16-NEXT: .vsave {d8}
1027 ; CHECK-FP16-NEXT: vpush {d8}
1028 ; CHECK-FP16-NEXT: vmov.u16 r0, d0[1]
1029 ; CHECK-FP16-NEXT: vorr d8, d0, d0
1030 ; CHECK-FP16-NEXT: vmov.u16 r8, d0[2]
1031 ; CHECK-FP16-NEXT: vmov.u16 r9, d0[3]
1032 ; CHECK-FP16-NEXT: vmov s0, r0
1033 ; CHECK-FP16-NEXT: bl __fixhfdi
1034 ; CHECK-FP16-NEXT: mov r4, r0
1035 ; CHECK-FP16-NEXT: vmov.u16 r0, d8[0]
1036 ; CHECK-FP16-NEXT: mov r5, r1
1037 ; CHECK-FP16-NEXT: vmov.32 d11[0], r4
1038 ; CHECK-FP16-NEXT: vmov s0, r0
1039 ; CHECK-FP16-NEXT: bl __fixhfdi
1040 ; CHECK-FP16-NEXT: vmov.32 d10[0], r0
1041 ; CHECK-FP16-NEXT: mvn r7, #0
1042 ; CHECK-FP16-NEXT: subs r0, r0, r7
1043 ; CHECK-FP16-NEXT: vmov.i64 q6, #0xffffffff
1044 ; CHECK-FP16-NEXT: sbcs r0, r1, #0
1045 ; CHECK-FP16-NEXT: vmov.32 d11[1], r5
1046 ; CHECK-FP16-NEXT: mov r0, #0
1047 ; CHECK-FP16-NEXT: vmov s0, r8
1048 ; CHECK-FP16-NEXT: movwlt r0, #1
1049 ; CHECK-FP16-NEXT: cmp r0, #0
1050 ; CHECK-FP16-NEXT: vmov.32 d10[1], r1
1051 ; CHECK-FP16-NEXT: mvnne r0, #0
1052 ; CHECK-FP16-NEXT: subs r1, r4, r7
1053 ; CHECK-FP16-NEXT: mov r6, #0
1054 ; CHECK-FP16-NEXT: sbcs r1, r5, #0
1055 ; CHECK-FP16-NEXT: vmov s16, r9
1056 ; CHECK-FP16-NEXT: mov r1, #0
1057 ; CHECK-FP16-NEXT: movwlt r1, #1
1058 ; CHECK-FP16-NEXT: cmp r1, #0
1059 ; CHECK-FP16-NEXT: mvnne r1, #0
1060 ; CHECK-FP16-NEXT: vdup.32 d17, r1
1061 ; CHECK-FP16-NEXT: vdup.32 d16, r0
1062 ; CHECK-FP16-NEXT: vbif q5, q6, q8
1063 ; CHECK-FP16-NEXT: vmov r9, r8, d10
1064 ; CHECK-FP16-NEXT: bl __fixhfdi
1065 ; CHECK-FP16-NEXT: vmov.f32 s0, s16
1066 ; CHECK-FP16-NEXT: mov r4, r0
1067 ; CHECK-FP16-NEXT: mov r5, r1
1068 ; CHECK-FP16-NEXT: vmov.32 d14[0], r0
1069 ; CHECK-FP16-NEXT: bl __fixhfdi
1070 ; CHECK-FP16-NEXT: subs r2, r4, r7
1071 ; CHECK-FP16-NEXT: vmov.32 d15[0], r0
1072 ; CHECK-FP16-NEXT: sbcs r2, r5, #0
1073 ; CHECK-FP16-NEXT: mov r2, #0
1074 ; CHECK-FP16-NEXT: movwlt r2, #1
1075 ; CHECK-FP16-NEXT: subs r0, r0, r7
1076 ; CHECK-FP16-NEXT: sbcs r0, r1, #0
1077 ; CHECK-FP16-NEXT: vmov.32 d15[1], r1
1078 ; CHECK-FP16-NEXT: mov r0, #0
1079 ; CHECK-FP16-NEXT: movwlt r0, #1
1080 ; CHECK-FP16-NEXT: cmp r0, #0
1081 ; CHECK-FP16-NEXT: mvnne r0, #0
1082 ; CHECK-FP16-NEXT: cmp r2, #0
1083 ; CHECK-FP16-NEXT: vmov.32 d14[1], r5
1084 ; CHECK-FP16-NEXT: mvnne r2, #0
1085 ; CHECK-FP16-NEXT: vmov r5, r4, d11
1086 ; CHECK-FP16-NEXT: vdup.32 d17, r0
1087 ; CHECK-FP16-NEXT: rsbs r0, r9, #0
1088 ; CHECK-FP16-NEXT: vdup.32 d16, r2
1089 ; CHECK-FP16-NEXT: rscs r0, r8, #0
1090 ; CHECK-FP16-NEXT: vbsl q8, q7, q6
1091 ; CHECK-FP16-NEXT: mov r0, #0
1092 ; CHECK-FP16-NEXT: movwlt r0, #1
1093 ; CHECK-FP16-NEXT: vmov r1, r2, d16
1094 ; CHECK-FP16-NEXT: vmov r3, r7, d17
1095 ; CHECK-FP16-NEXT: rsbs r1, r1, #0
1096 ; CHECK-FP16-NEXT: rscs r1, r2, #0
1097 ; CHECK-FP16-NEXT: mov r1, #0
1098 ; CHECK-FP16-NEXT: movwlt r1, #1
1099 ; CHECK-FP16-NEXT: rsbs r2, r3, #0
1100 ; CHECK-FP16-NEXT: rscs r2, r7, #0
1101 ; CHECK-FP16-NEXT: mov r2, #0
1102 ; CHECK-FP16-NEXT: movwlt r2, #1
1103 ; CHECK-FP16-NEXT: rsbs r3, r5, #0
1104 ; CHECK-FP16-NEXT: rscs r3, r4, #0
1105 ; CHECK-FP16-NEXT: movwlt r6, #1
1106 ; CHECK-FP16-NEXT: cmp r6, #0
1107 ; CHECK-FP16-NEXT: mvnne r6, #0
1108 ; CHECK-FP16-NEXT: cmp r2, #0
1109 ; CHECK-FP16-NEXT: mvnne r2, #0
1110 ; CHECK-FP16-NEXT: cmp r1, #0
1111 ; CHECK-FP16-NEXT: mvnne r1, #0
1112 ; CHECK-FP16-NEXT: vmov.32 d21[0], r2
1113 ; CHECK-FP16-NEXT: cmp r0, #0
1114 ; CHECK-FP16-NEXT: vmov.32 d20[0], r1
1115 ; CHECK-FP16-NEXT: mvnne r0, #0
1116 ; CHECK-FP16-NEXT: vmov.32 d19[0], r6
1117 ; CHECK-FP16-NEXT: vand q8, q8, q10
1118 ; CHECK-FP16-NEXT: vmov.32 d18[0], r0
1119 ; CHECK-FP16-NEXT: vmovn.i64 d1, q8
1120 ; CHECK-FP16-NEXT: vand q9, q5, q9
1121 ; CHECK-FP16-NEXT: vmovn.i64 d0, q9
1122 ; CHECK-FP16-NEXT: vpop {d8}
1123 ; CHECK-FP16-NEXT: vpop {d10, d11, d12, d13, d14, d15}
1124 ; CHECK-FP16-NEXT: pop {r4, r5, r6, r7, r8, r9, r11, pc}
1126 %conv = fptosi <4 x half> %x to <4 x i64>
1127 %0 = icmp slt <4 x i64> %conv, <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>
1128 %spec.store.select = select <4 x i1> %0, <4 x i64> %conv, <4 x i64> <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>
1129 %1 = icmp sgt <4 x i64> %spec.store.select, zeroinitializer
1130 %spec.store.select7 = select <4 x i1> %1, <4 x i64> %spec.store.select, <4 x i64> zeroinitializer
1131 %conv6 = trunc <4 x i64> %spec.store.select7 to <4 x i32>
1132 ret <4 x i32> %conv6
1137 define <2 x i16> @stest_f64i16(<2 x double> %x) {
1138 ; CHECK-LABEL: stest_f64i16:
1139 ; CHECK: @ %bb.0: @ %entry
1140 ; CHECK-NEXT: vcvt.s32.f64 s4, d0
1141 ; CHECK-NEXT: vmov r0, s4
1142 ; CHECK-NEXT: vcvt.s32.f64 s0, d1
1143 ; CHECK-NEXT: vmov.i32 d17, #0x7fff
1144 ; CHECK-NEXT: vmvn.i32 d18, #0x7fff
1145 ; CHECK-NEXT: vmov.32 d16[0], r0
1146 ; CHECK-NEXT: vmov r0, s0
1147 ; CHECK-NEXT: vmov.32 d16[1], r0
1148 ; CHECK-NEXT: vmin.s32 d16, d16, d17
1149 ; CHECK-NEXT: vmax.s32 d0, d16, d18
1152 %conv = fptosi <2 x double> %x to <2 x i32>
1153 %0 = icmp slt <2 x i32> %conv, <i32 32767, i32 32767>
1154 %spec.store.select = select <2 x i1> %0, <2 x i32> %conv, <2 x i32> <i32 32767, i32 32767>
1155 %1 = icmp sgt <2 x i32> %spec.store.select, <i32 -32768, i32 -32768>
1156 %spec.store.select7 = select <2 x i1> %1, <2 x i32> %spec.store.select, <2 x i32> <i32 -32768, i32 -32768>
1157 %conv6 = trunc <2 x i32> %spec.store.select7 to <2 x i16>
1158 ret <2 x i16> %conv6
1161 define <2 x i16> @utest_f64i16(<2 x double> %x) {
1162 ; CHECK-LABEL: utest_f64i16:
1163 ; CHECK: @ %bb.0: @ %entry
1164 ; CHECK-NEXT: vcvt.u32.f64 s4, d0
1165 ; CHECK-NEXT: vmov r0, s4
1166 ; CHECK-NEXT: vcvt.u32.f64 s0, d1
1167 ; CHECK-NEXT: vmov.i32 d17, #0xffff
1168 ; CHECK-NEXT: vmov.32 d16[0], r0
1169 ; CHECK-NEXT: vmov r0, s0
1170 ; CHECK-NEXT: vmov.32 d16[1], r0
1171 ; CHECK-NEXT: vmin.u32 d0, d16, d17
1174 %conv = fptoui <2 x double> %x to <2 x i32>
1175 %0 = icmp ult <2 x i32> %conv, <i32 65535, i32 65535>
1176 %spec.store.select = select <2 x i1> %0, <2 x i32> %conv, <2 x i32> <i32 65535, i32 65535>
1177 %conv6 = trunc <2 x i32> %spec.store.select to <2 x i16>
1178 ret <2 x i16> %conv6
1181 define <2 x i16> @ustest_f64i16(<2 x double> %x) {
1182 ; CHECK-LABEL: ustest_f64i16:
1183 ; CHECK: @ %bb.0: @ %entry
1184 ; CHECK-NEXT: vcvt.s32.f64 s4, d0
1185 ; CHECK-NEXT: vmov r0, s4
1186 ; CHECK-NEXT: vcvt.s32.f64 s0, d1
1187 ; CHECK-NEXT: vmov.i32 d17, #0xffff
1188 ; CHECK-NEXT: vmov.i32 d18, #0x0
1189 ; CHECK-NEXT: vmov.32 d16[0], r0
1190 ; CHECK-NEXT: vmov r0, s0
1191 ; CHECK-NEXT: vmov.32 d16[1], r0
1192 ; CHECK-NEXT: vmin.s32 d16, d16, d17
1193 ; CHECK-NEXT: vmax.s32 d0, d16, d18
1196 %conv = fptosi <2 x double> %x to <2 x i32>
1197 %0 = icmp slt <2 x i32> %conv, <i32 65535, i32 65535>
1198 %spec.store.select = select <2 x i1> %0, <2 x i32> %conv, <2 x i32> <i32 65535, i32 65535>
1199 %1 = icmp sgt <2 x i32> %spec.store.select, zeroinitializer
1200 %spec.store.select7 = select <2 x i1> %1, <2 x i32> %spec.store.select, <2 x i32> zeroinitializer
1201 %conv6 = trunc <2 x i32> %spec.store.select7 to <2 x i16>
1202 ret <2 x i16> %conv6
1205 define <4 x i16> @stest_f32i16(<4 x float> %x) {
1206 ; CHECK-LABEL: stest_f32i16:
1207 ; CHECK: @ %bb.0: @ %entry
1208 ; CHECK-NEXT: vcvt.s32.f32 q8, q0
1209 ; CHECK-NEXT: vmov.i32 q9, #0x7fff
1210 ; CHECK-NEXT: vmvn.i32 q10, #0x7fff
1211 ; CHECK-NEXT: vmin.s32 q8, q8, q9
1212 ; CHECK-NEXT: vmax.s32 q8, q8, q10
1213 ; CHECK-NEXT: vmovn.i32 d0, q8
1216 %conv = fptosi <4 x float> %x to <4 x i32>
1217 %0 = icmp slt <4 x i32> %conv, <i32 32767, i32 32767, i32 32767, i32 32767>
1218 %spec.store.select = select <4 x i1> %0, <4 x i32> %conv, <4 x i32> <i32 32767, i32 32767, i32 32767, i32 32767>
1219 %1 = icmp sgt <4 x i32> %spec.store.select, <i32 -32768, i32 -32768, i32 -32768, i32 -32768>
1220 %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>
1221 %conv6 = trunc <4 x i32> %spec.store.select7 to <4 x i16>
1222 ret <4 x i16> %conv6
1225 define <4 x i16> @utest_f32i16(<4 x float> %x) {
1226 ; CHECK-LABEL: utest_f32i16:
1227 ; CHECK: @ %bb.0: @ %entry
1228 ; CHECK-NEXT: vcvt.u32.f32 q8, q0
1229 ; CHECK-NEXT: vmov.i32 q9, #0xffff
1230 ; CHECK-NEXT: vmin.u32 q8, q8, q9
1231 ; CHECK-NEXT: vmovn.i32 d0, q8
1234 %conv = fptoui <4 x float> %x to <4 x i32>
1235 %0 = icmp ult <4 x i32> %conv, <i32 65535, i32 65535, i32 65535, i32 65535>
1236 %spec.store.select = select <4 x i1> %0, <4 x i32> %conv, <4 x i32> <i32 65535, i32 65535, i32 65535, i32 65535>
1237 %conv6 = trunc <4 x i32> %spec.store.select to <4 x i16>
1238 ret <4 x i16> %conv6
1241 define <4 x i16> @ustest_f32i16(<4 x float> %x) {
1242 ; CHECK-LABEL: ustest_f32i16:
1243 ; CHECK: @ %bb.0: @ %entry
1244 ; CHECK-NEXT: vcvt.s32.f32 q8, q0
1245 ; CHECK-NEXT: vmov.i32 q9, #0xffff
1246 ; CHECK-NEXT: vmov.i32 q10, #0x0
1247 ; CHECK-NEXT: vmin.s32 q8, q8, q9
1248 ; CHECK-NEXT: vmax.s32 q8, q8, q10
1249 ; CHECK-NEXT: vmovn.i32 d0, q8
1252 %conv = fptosi <4 x float> %x to <4 x i32>
1253 %0 = icmp slt <4 x i32> %conv, <i32 65535, i32 65535, i32 65535, i32 65535>
1254 %spec.store.select = select <4 x i1> %0, <4 x i32> %conv, <4 x i32> <i32 65535, i32 65535, i32 65535, i32 65535>
1255 %1 = icmp sgt <4 x i32> %spec.store.select, zeroinitializer
1256 %spec.store.select7 = select <4 x i1> %1, <4 x i32> %spec.store.select, <4 x i32> zeroinitializer
1257 %conv6 = trunc <4 x i32> %spec.store.select7 to <4 x i16>
1258 ret <4 x i16> %conv6
1261 define <8 x i16> @stest_f16i16(<8 x half> %x) {
1262 ; CHECK-NEON-LABEL: stest_f16i16:
1263 ; CHECK-NEON: @ %bb.0: @ %entry
1264 ; CHECK-NEON-NEXT: .save {r4, r5, r6, r7, r11, lr}
1265 ; CHECK-NEON-NEXT: push {r4, r5, r6, r7, r11, lr}
1266 ; CHECK-NEON-NEXT: .vsave {d8, d9, d10, d11, d12, d13, d14, d15}
1267 ; CHECK-NEON-NEXT: vpush {d8, d9, d10, d11, d12, d13, d14, d15}
1268 ; CHECK-NEON-NEXT: vmov r0, s1
1269 ; CHECK-NEON-NEXT: vmov.f32 s16, s7
1270 ; CHECK-NEON-NEXT: vmov.f32 s18, s6
1271 ; CHECK-NEON-NEXT: vmov.f32 s20, s5
1272 ; CHECK-NEON-NEXT: vmov.f32 s22, s4
1273 ; CHECK-NEON-NEXT: vmov.f32 s24, s3
1274 ; CHECK-NEON-NEXT: vmov.f32 s26, s2
1275 ; CHECK-NEON-NEXT: vmov.f32 s28, s0
1276 ; CHECK-NEON-NEXT: bl __aeabi_h2f
1277 ; CHECK-NEON-NEXT: mov r4, r0
1278 ; CHECK-NEON-NEXT: vmov r0, s26
1279 ; CHECK-NEON-NEXT: bl __aeabi_h2f
1280 ; CHECK-NEON-NEXT: mov r5, r0
1281 ; CHECK-NEON-NEXT: vmov r0, s22
1282 ; CHECK-NEON-NEXT: bl __aeabi_h2f
1283 ; CHECK-NEON-NEXT: mov r6, r0
1284 ; CHECK-NEON-NEXT: vmov r0, s24
1285 ; CHECK-NEON-NEXT: bl __aeabi_h2f
1286 ; CHECK-NEON-NEXT: mov r7, r0
1287 ; CHECK-NEON-NEXT: vmov r0, s18
1288 ; CHECK-NEON-NEXT: bl __aeabi_h2f
1289 ; CHECK-NEON-NEXT: vmov s0, r0
1290 ; CHECK-NEON-NEXT: vcvt.s32.f32 s0, s0
1291 ; CHECK-NEON-NEXT: vmov r0, s0
1292 ; CHECK-NEON-NEXT: vmov.32 d13[0], r0
1293 ; CHECK-NEON-NEXT: vmov r0, s16
1294 ; CHECK-NEON-NEXT: bl __aeabi_h2f
1295 ; CHECK-NEON-NEXT: vmov s0, r0
1296 ; CHECK-NEON-NEXT: vmov s22, r7
1297 ; CHECK-NEON-NEXT: vcvt.s32.f32 s0, s0
1298 ; CHECK-NEON-NEXT: vmov s30, r6
1299 ; CHECK-NEON-NEXT: vmov r0, s0
1300 ; CHECK-NEON-NEXT: vmov.32 d13[1], r0
1301 ; CHECK-NEON-NEXT: vmov r0, s28
1302 ; CHECK-NEON-NEXT: bl __aeabi_h2f
1303 ; CHECK-NEON-NEXT: vmov s0, r0
1304 ; CHECK-NEON-NEXT: vmov r1, s20
1305 ; CHECK-NEON-NEXT: vcvt.s32.f32 s0, s0
1306 ; CHECK-NEON-NEXT: vmov s2, r5
1307 ; CHECK-NEON-NEXT: vcvt.s32.f32 s20, s2
1308 ; CHECK-NEON-NEXT: vmov r0, s0
1309 ; CHECK-NEON-NEXT: vcvt.s32.f32 s0, s30
1310 ; CHECK-NEON-NEXT: vmov.32 d8[0], r0
1311 ; CHECK-NEON-NEXT: vmov r0, s0
1312 ; CHECK-NEON-NEXT: vmov.32 d12[0], r0
1313 ; CHECK-NEON-NEXT: mov r0, r1
1314 ; CHECK-NEON-NEXT: bl __aeabi_h2f
1315 ; CHECK-NEON-NEXT: vmov s0, r0
1316 ; CHECK-NEON-NEXT: vmov r0, s20
1317 ; CHECK-NEON-NEXT: vcvt.s32.f32 s0, s0
1318 ; CHECK-NEON-NEXT: vmov s2, r4
1319 ; CHECK-NEON-NEXT: vmov.i32 q8, #0x7fff
1320 ; CHECK-NEON-NEXT: vcvt.s32.f32 s2, s2
1321 ; CHECK-NEON-NEXT: vmvn.i32 q9, #0x7fff
1322 ; CHECK-NEON-NEXT: vmov.32 d9[0], r0
1323 ; CHECK-NEON-NEXT: vmov r0, s0
1324 ; CHECK-NEON-NEXT: vcvt.s32.f32 s0, s22
1325 ; CHECK-NEON-NEXT: vmov.32 d12[1], r0
1326 ; CHECK-NEON-NEXT: vmov r0, s0
1327 ; CHECK-NEON-NEXT: vmin.s32 q10, q6, q8
1328 ; CHECK-NEON-NEXT: vmax.s32 q10, q10, q9
1329 ; CHECK-NEON-NEXT: vmov.32 d9[1], r0
1330 ; CHECK-NEON-NEXT: vmov r0, s2
1331 ; CHECK-NEON-NEXT: vmovn.i32 d1, q10
1332 ; CHECK-NEON-NEXT: vmov.32 d8[1], r0
1333 ; CHECK-NEON-NEXT: vmin.s32 q8, q4, q8
1334 ; CHECK-NEON-NEXT: vmax.s32 q8, q8, q9
1335 ; CHECK-NEON-NEXT: vmovn.i32 d0, q8
1336 ; CHECK-NEON-NEXT: vpop {d8, d9, d10, d11, d12, d13, d14, d15}
1337 ; CHECK-NEON-NEXT: pop {r4, r5, r6, r7, r11, pc}
1339 ; CHECK-FP16-LABEL: stest_f16i16:
1340 ; CHECK-FP16: @ %bb.0: @ %entry
1341 ; CHECK-FP16-NEXT: vmovx.f16 s4, s0
1342 ; CHECK-FP16-NEXT: vcvt.s32.f16 s12, s0
1343 ; CHECK-FP16-NEXT: vcvt.s32.f16 s0, s3
1344 ; CHECK-FP16-NEXT: vcvt.s32.f16 s5, s2
1345 ; CHECK-FP16-NEXT: vmov r0, s0
1346 ; CHECK-FP16-NEXT: vcvt.s32.f16 s14, s1
1347 ; CHECK-FP16-NEXT: vmovx.f16 s10, s3
1348 ; CHECK-FP16-NEXT: vmovx.f16 s8, s2
1349 ; CHECK-FP16-NEXT: vcvt.s32.f16 s10, s10
1350 ; CHECK-FP16-NEXT: vcvt.s32.f16 s8, s8
1351 ; CHECK-FP16-NEXT: vmovx.f16 s6, s1
1352 ; CHECK-FP16-NEXT: vcvt.s32.f16 s4, s4
1353 ; CHECK-FP16-NEXT: vcvt.s32.f16 s6, s6
1354 ; CHECK-FP16-NEXT: vmov.i32 q10, #0x7fff
1355 ; CHECK-FP16-NEXT: vmvn.i32 q11, #0x7fff
1356 ; CHECK-FP16-NEXT: vmov.32 d17[0], r0
1357 ; CHECK-FP16-NEXT: vmov r0, s5
1358 ; CHECK-FP16-NEXT: vmov.32 d16[0], r0
1359 ; CHECK-FP16-NEXT: vmov r0, s14
1360 ; CHECK-FP16-NEXT: vmov.32 d19[0], r0
1361 ; CHECK-FP16-NEXT: vmov r0, s12
1362 ; CHECK-FP16-NEXT: vmov.32 d18[0], r0
1363 ; CHECK-FP16-NEXT: vmov r0, s10
1364 ; CHECK-FP16-NEXT: vmov.32 d17[1], r0
1365 ; CHECK-FP16-NEXT: vmov r0, s8
1366 ; CHECK-FP16-NEXT: vmov.32 d16[1], r0
1367 ; CHECK-FP16-NEXT: vmov r0, s6
1368 ; CHECK-FP16-NEXT: vmin.s32 q8, q8, q10
1369 ; CHECK-FP16-NEXT: vmax.s32 q8, q8, q11
1370 ; CHECK-FP16-NEXT: vmovn.i32 d1, q8
1371 ; CHECK-FP16-NEXT: vmov.32 d19[1], r0
1372 ; CHECK-FP16-NEXT: vmov r0, s4
1373 ; CHECK-FP16-NEXT: vmov.32 d18[1], r0
1374 ; CHECK-FP16-NEXT: vmin.s32 q9, q9, q10
1375 ; CHECK-FP16-NEXT: vmax.s32 q9, q9, q11
1376 ; CHECK-FP16-NEXT: vmovn.i32 d0, q9
1377 ; CHECK-FP16-NEXT: bx lr
1379 %conv = fptosi <8 x half> %x to <8 x i32>
1380 %0 = icmp slt <8 x i32> %conv, <i32 32767, i32 32767, i32 32767, i32 32767, i32 32767, i32 32767, i32 32767, i32 32767>
1381 %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>
1382 %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>
1383 %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>
1384 %conv6 = trunc <8 x i32> %spec.store.select7 to <8 x i16>
1385 ret <8 x i16> %conv6
1388 define <8 x i16> @utesth_f16i16(<8 x half> %x) {
1389 ; CHECK-NEON-LABEL: utesth_f16i16:
1390 ; CHECK-NEON: @ %bb.0: @ %entry
1391 ; CHECK-NEON-NEXT: .save {r4, r5, r6, r7, r11, lr}
1392 ; CHECK-NEON-NEXT: push {r4, r5, r6, r7, r11, lr}
1393 ; CHECK-NEON-NEXT: .vsave {d8, d9, d10, d11, d12, d13, d14}
1394 ; CHECK-NEON-NEXT: vpush {d8, d9, d10, d11, d12, d13, d14}
1395 ; CHECK-NEON-NEXT: vmov r0, s1
1396 ; CHECK-NEON-NEXT: vmov.f32 s16, s7
1397 ; CHECK-NEON-NEXT: vmov.f32 s18, s6
1398 ; CHECK-NEON-NEXT: vmov.f32 s20, s5
1399 ; CHECK-NEON-NEXT: vmov.f32 s22, s4
1400 ; CHECK-NEON-NEXT: vmov.f32 s24, s3
1401 ; CHECK-NEON-NEXT: vmov.f32 s26, s2
1402 ; CHECK-NEON-NEXT: vmov.f32 s28, s0
1403 ; CHECK-NEON-NEXT: bl __aeabi_h2f
1404 ; CHECK-NEON-NEXT: mov r4, r0
1405 ; CHECK-NEON-NEXT: vmov r0, s26
1406 ; CHECK-NEON-NEXT: bl __aeabi_h2f
1407 ; CHECK-NEON-NEXT: mov r5, r0
1408 ; CHECK-NEON-NEXT: vmov r0, s22
1409 ; CHECK-NEON-NEXT: bl __aeabi_h2f
1410 ; CHECK-NEON-NEXT: mov r6, r0
1411 ; CHECK-NEON-NEXT: vmov r0, s24
1412 ; CHECK-NEON-NEXT: bl __aeabi_h2f
1413 ; CHECK-NEON-NEXT: mov r7, r0
1414 ; CHECK-NEON-NEXT: vmov r0, s18
1415 ; CHECK-NEON-NEXT: bl __aeabi_h2f
1416 ; CHECK-NEON-NEXT: vmov s0, r0
1417 ; CHECK-NEON-NEXT: vcvt.u32.f32 s0, s0
1418 ; CHECK-NEON-NEXT: vmov r0, s0
1419 ; CHECK-NEON-NEXT: vmov.32 d13[0], r0
1420 ; CHECK-NEON-NEXT: vmov r0, s16
1421 ; CHECK-NEON-NEXT: bl __aeabi_h2f
1422 ; CHECK-NEON-NEXT: vmov s0, r0
1423 ; CHECK-NEON-NEXT: vmov s16, r7
1424 ; CHECK-NEON-NEXT: vcvt.u32.f32 s0, s0
1425 ; CHECK-NEON-NEXT: vmov s18, r6
1426 ; CHECK-NEON-NEXT: vmov r0, s0
1427 ; CHECK-NEON-NEXT: vmov.32 d13[1], r0
1428 ; CHECK-NEON-NEXT: vmov r0, s28
1429 ; CHECK-NEON-NEXT: bl __aeabi_h2f
1430 ; CHECK-NEON-NEXT: vmov s0, r0
1431 ; CHECK-NEON-NEXT: vmov r1, s20
1432 ; CHECK-NEON-NEXT: vcvt.u32.f32 s0, s0
1433 ; CHECK-NEON-NEXT: vmov s2, r5
1434 ; CHECK-NEON-NEXT: vmov r0, s0
1435 ; CHECK-NEON-NEXT: vcvt.u32.f32 s0, s18
1436 ; CHECK-NEON-NEXT: vcvt.u32.f32 s18, s2
1437 ; CHECK-NEON-NEXT: vmov.32 d10[0], r0
1438 ; CHECK-NEON-NEXT: vmov r0, s0
1439 ; CHECK-NEON-NEXT: vmov.32 d12[0], r0
1440 ; CHECK-NEON-NEXT: mov r0, r1
1441 ; CHECK-NEON-NEXT: bl __aeabi_h2f
1442 ; CHECK-NEON-NEXT: vmov s0, r0
1443 ; CHECK-NEON-NEXT: vmov r0, s18
1444 ; CHECK-NEON-NEXT: vcvt.u32.f32 s0, s0
1445 ; CHECK-NEON-NEXT: vmov s2, r4
1446 ; CHECK-NEON-NEXT: vmov.i32 q8, #0xffff
1447 ; CHECK-NEON-NEXT: vcvt.u32.f32 s2, s2
1448 ; CHECK-NEON-NEXT: vmov.32 d11[0], r0
1449 ; CHECK-NEON-NEXT: vmov r0, s0
1450 ; CHECK-NEON-NEXT: vcvt.u32.f32 s0, s16
1451 ; CHECK-NEON-NEXT: vmov.32 d12[1], r0
1452 ; CHECK-NEON-NEXT: vmov r0, s0
1453 ; CHECK-NEON-NEXT: vmin.u32 q9, q6, q8
1454 ; CHECK-NEON-NEXT: vmov.32 d11[1], r0
1455 ; CHECK-NEON-NEXT: vmov r0, s2
1456 ; CHECK-NEON-NEXT: vmovn.i32 d1, q9
1457 ; CHECK-NEON-NEXT: vmov.32 d10[1], r0
1458 ; CHECK-NEON-NEXT: vmin.u32 q8, q5, q8
1459 ; CHECK-NEON-NEXT: vmovn.i32 d0, q8
1460 ; CHECK-NEON-NEXT: vpop {d8, d9, d10, d11, d12, d13, d14}
1461 ; CHECK-NEON-NEXT: pop {r4, r5, r6, r7, r11, pc}
1463 ; CHECK-FP16-LABEL: utesth_f16i16:
1464 ; CHECK-FP16: @ %bb.0: @ %entry
1465 ; CHECK-FP16-NEXT: vmovx.f16 s4, s0
1466 ; CHECK-FP16-NEXT: vcvt.u32.f16 s12, s0
1467 ; CHECK-FP16-NEXT: vcvt.u32.f16 s0, s3
1468 ; CHECK-FP16-NEXT: vcvt.u32.f16 s5, s2
1469 ; CHECK-FP16-NEXT: vmov r0, s0
1470 ; CHECK-FP16-NEXT: vcvt.u32.f16 s14, s1
1471 ; CHECK-FP16-NEXT: vmovx.f16 s10, s3
1472 ; CHECK-FP16-NEXT: vmovx.f16 s8, s2
1473 ; CHECK-FP16-NEXT: vcvt.u32.f16 s10, s10
1474 ; CHECK-FP16-NEXT: vcvt.u32.f16 s8, s8
1475 ; CHECK-FP16-NEXT: vmovx.f16 s6, s1
1476 ; CHECK-FP16-NEXT: vcvt.u32.f16 s4, s4
1477 ; CHECK-FP16-NEXT: vcvt.u32.f16 s6, s6
1478 ; CHECK-FP16-NEXT: vmov.i32 q10, #0xffff
1479 ; CHECK-FP16-NEXT: vmov.32 d17[0], r0
1480 ; CHECK-FP16-NEXT: vmov r0, s5
1481 ; CHECK-FP16-NEXT: vmov.32 d16[0], r0
1482 ; CHECK-FP16-NEXT: vmov r0, s14
1483 ; CHECK-FP16-NEXT: vmov.32 d19[0], r0
1484 ; CHECK-FP16-NEXT: vmov r0, s12
1485 ; CHECK-FP16-NEXT: vmov.32 d18[0], r0
1486 ; CHECK-FP16-NEXT: vmov r0, s10
1487 ; CHECK-FP16-NEXT: vmov.32 d17[1], r0
1488 ; CHECK-FP16-NEXT: vmov r0, s8
1489 ; CHECK-FP16-NEXT: vmov.32 d16[1], r0
1490 ; CHECK-FP16-NEXT: vmov r0, s6
1491 ; CHECK-FP16-NEXT: vmin.u32 q8, q8, q10
1492 ; CHECK-FP16-NEXT: vmovn.i32 d1, q8
1493 ; CHECK-FP16-NEXT: vmov.32 d19[1], r0
1494 ; CHECK-FP16-NEXT: vmov r0, s4
1495 ; CHECK-FP16-NEXT: vmov.32 d18[1], r0
1496 ; CHECK-FP16-NEXT: vmin.u32 q9, q9, q10
1497 ; CHECK-FP16-NEXT: vmovn.i32 d0, q9
1498 ; CHECK-FP16-NEXT: bx lr
1500 %conv = fptoui <8 x half> %x to <8 x i32>
1501 %0 = icmp ult <8 x i32> %conv, <i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535>
1502 %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>
1503 %conv6 = trunc <8 x i32> %spec.store.select to <8 x i16>
1504 ret <8 x i16> %conv6
1507 define <8 x i16> @ustest_f16i16(<8 x half> %x) {
1508 ; CHECK-NEON-LABEL: ustest_f16i16:
1509 ; CHECK-NEON: @ %bb.0: @ %entry
1510 ; CHECK-NEON-NEXT: .save {r4, r5, r6, r7, r11, lr}
1511 ; CHECK-NEON-NEXT: push {r4, r5, r6, r7, r11, lr}
1512 ; CHECK-NEON-NEXT: .vsave {d8, d9, d10, d11, d12, d13, d14, d15}
1513 ; CHECK-NEON-NEXT: vpush {d8, d9, d10, d11, d12, d13, d14, d15}
1514 ; CHECK-NEON-NEXT: vmov r0, s1
1515 ; CHECK-NEON-NEXT: vmov.f32 s16, s7
1516 ; CHECK-NEON-NEXT: vmov.f32 s18, s6
1517 ; CHECK-NEON-NEXT: vmov.f32 s20, s5
1518 ; CHECK-NEON-NEXT: vmov.f32 s22, s4
1519 ; CHECK-NEON-NEXT: vmov.f32 s24, s3
1520 ; CHECK-NEON-NEXT: vmov.f32 s26, s2
1521 ; CHECK-NEON-NEXT: vmov.f32 s28, s0
1522 ; CHECK-NEON-NEXT: bl __aeabi_h2f
1523 ; CHECK-NEON-NEXT: mov r4, r0
1524 ; CHECK-NEON-NEXT: vmov r0, s26
1525 ; CHECK-NEON-NEXT: bl __aeabi_h2f
1526 ; CHECK-NEON-NEXT: mov r5, r0
1527 ; CHECK-NEON-NEXT: vmov r0, s22
1528 ; CHECK-NEON-NEXT: bl __aeabi_h2f
1529 ; CHECK-NEON-NEXT: mov r6, r0
1530 ; CHECK-NEON-NEXT: vmov r0, s24
1531 ; CHECK-NEON-NEXT: bl __aeabi_h2f
1532 ; CHECK-NEON-NEXT: mov r7, r0
1533 ; CHECK-NEON-NEXT: vmov r0, s18
1534 ; CHECK-NEON-NEXT: bl __aeabi_h2f
1535 ; CHECK-NEON-NEXT: vmov s0, r0
1536 ; CHECK-NEON-NEXT: vcvt.s32.f32 s0, s0
1537 ; CHECK-NEON-NEXT: vmov r0, s0
1538 ; CHECK-NEON-NEXT: vmov.32 d13[0], r0
1539 ; CHECK-NEON-NEXT: vmov r0, s16
1540 ; CHECK-NEON-NEXT: bl __aeabi_h2f
1541 ; CHECK-NEON-NEXT: vmov s0, r0
1542 ; CHECK-NEON-NEXT: vmov s22, r7
1543 ; CHECK-NEON-NEXT: vcvt.s32.f32 s0, s0
1544 ; CHECK-NEON-NEXT: vmov s30, r6
1545 ; CHECK-NEON-NEXT: vmov r0, s0
1546 ; CHECK-NEON-NEXT: vmov.32 d13[1], r0
1547 ; CHECK-NEON-NEXT: vmov r0, s28
1548 ; CHECK-NEON-NEXT: bl __aeabi_h2f
1549 ; CHECK-NEON-NEXT: vmov s0, r0
1550 ; CHECK-NEON-NEXT: vmov r1, s20
1551 ; CHECK-NEON-NEXT: vcvt.s32.f32 s0, s0
1552 ; CHECK-NEON-NEXT: vmov s2, r5
1553 ; CHECK-NEON-NEXT: vcvt.s32.f32 s20, s2
1554 ; CHECK-NEON-NEXT: vmov r0, s0
1555 ; CHECK-NEON-NEXT: vcvt.s32.f32 s0, s30
1556 ; CHECK-NEON-NEXT: vmov.32 d8[0], r0
1557 ; CHECK-NEON-NEXT: vmov r0, s0
1558 ; CHECK-NEON-NEXT: vmov.32 d12[0], r0
1559 ; CHECK-NEON-NEXT: mov r0, r1
1560 ; CHECK-NEON-NEXT: bl __aeabi_h2f
1561 ; CHECK-NEON-NEXT: vmov s0, r0
1562 ; CHECK-NEON-NEXT: vmov r0, s20
1563 ; CHECK-NEON-NEXT: vcvt.s32.f32 s0, s0
1564 ; CHECK-NEON-NEXT: vmov s2, r4
1565 ; CHECK-NEON-NEXT: vmov.i32 q8, #0xffff
1566 ; CHECK-NEON-NEXT: vcvt.s32.f32 s2, s2
1567 ; CHECK-NEON-NEXT: vmov.i32 q9, #0x0
1568 ; CHECK-NEON-NEXT: vmov.32 d9[0], r0
1569 ; CHECK-NEON-NEXT: vmov r0, s0
1570 ; CHECK-NEON-NEXT: vcvt.s32.f32 s0, s22
1571 ; CHECK-NEON-NEXT: vmov.32 d12[1], r0
1572 ; CHECK-NEON-NEXT: vmov r0, s0
1573 ; CHECK-NEON-NEXT: vmin.s32 q10, q6, q8
1574 ; CHECK-NEON-NEXT: vmax.s32 q10, q10, q9
1575 ; CHECK-NEON-NEXT: vmov.32 d9[1], r0
1576 ; CHECK-NEON-NEXT: vmov r0, s2
1577 ; CHECK-NEON-NEXT: vmovn.i32 d1, q10
1578 ; CHECK-NEON-NEXT: vmov.32 d8[1], r0
1579 ; CHECK-NEON-NEXT: vmin.s32 q8, q4, q8
1580 ; CHECK-NEON-NEXT: vmax.s32 q8, q8, q9
1581 ; CHECK-NEON-NEXT: vmovn.i32 d0, q8
1582 ; CHECK-NEON-NEXT: vpop {d8, d9, d10, d11, d12, d13, d14, d15}
1583 ; CHECK-NEON-NEXT: pop {r4, r5, r6, r7, r11, pc}
1585 ; CHECK-FP16-LABEL: ustest_f16i16:
1586 ; CHECK-FP16: @ %bb.0: @ %entry
1587 ; CHECK-FP16-NEXT: vmovx.f16 s4, s0
1588 ; CHECK-FP16-NEXT: vcvt.s32.f16 s12, s0
1589 ; CHECK-FP16-NEXT: vcvt.s32.f16 s0, s3
1590 ; CHECK-FP16-NEXT: vcvt.s32.f16 s5, s2
1591 ; CHECK-FP16-NEXT: vmov r0, s0
1592 ; CHECK-FP16-NEXT: vcvt.s32.f16 s14, s1
1593 ; CHECK-FP16-NEXT: vmovx.f16 s10, s3
1594 ; CHECK-FP16-NEXT: vmovx.f16 s8, s2
1595 ; CHECK-FP16-NEXT: vcvt.s32.f16 s10, s10
1596 ; CHECK-FP16-NEXT: vcvt.s32.f16 s8, s8
1597 ; CHECK-FP16-NEXT: vmovx.f16 s6, s1
1598 ; CHECK-FP16-NEXT: vcvt.s32.f16 s4, s4
1599 ; CHECK-FP16-NEXT: vcvt.s32.f16 s6, s6
1600 ; CHECK-FP16-NEXT: vmov.i32 q10, #0xffff
1601 ; CHECK-FP16-NEXT: vmov.i32 q11, #0x0
1602 ; CHECK-FP16-NEXT: vmov.32 d17[0], r0
1603 ; CHECK-FP16-NEXT: vmov r0, s5
1604 ; CHECK-FP16-NEXT: vmov.32 d16[0], r0
1605 ; CHECK-FP16-NEXT: vmov r0, s14
1606 ; CHECK-FP16-NEXT: vmov.32 d19[0], r0
1607 ; CHECK-FP16-NEXT: vmov r0, s12
1608 ; CHECK-FP16-NEXT: vmov.32 d18[0], r0
1609 ; CHECK-FP16-NEXT: vmov r0, s10
1610 ; CHECK-FP16-NEXT: vmov.32 d17[1], r0
1611 ; CHECK-FP16-NEXT: vmov r0, s8
1612 ; CHECK-FP16-NEXT: vmov.32 d16[1], r0
1613 ; CHECK-FP16-NEXT: vmov r0, s6
1614 ; CHECK-FP16-NEXT: vmin.s32 q8, q8, q10
1615 ; CHECK-FP16-NEXT: vmax.s32 q8, q8, q11
1616 ; CHECK-FP16-NEXT: vmovn.i32 d1, q8
1617 ; CHECK-FP16-NEXT: vmov.32 d19[1], r0
1618 ; CHECK-FP16-NEXT: vmov r0, s4
1619 ; CHECK-FP16-NEXT: vmov.32 d18[1], r0
1620 ; CHECK-FP16-NEXT: vmin.s32 q9, q9, q10
1621 ; CHECK-FP16-NEXT: vmax.s32 q9, q9, q11
1622 ; CHECK-FP16-NEXT: vmovn.i32 d0, q9
1623 ; CHECK-FP16-NEXT: bx lr
1625 %conv = fptosi <8 x half> %x to <8 x i32>
1626 %0 = icmp slt <8 x i32> %conv, <i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535>
1627 %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>
1628 %1 = icmp sgt <8 x i32> %spec.store.select, zeroinitializer
1629 %spec.store.select7 = select <8 x i1> %1, <8 x i32> %spec.store.select, <8 x i32> zeroinitializer
1630 %conv6 = trunc <8 x i32> %spec.store.select7 to <8 x i16>
1631 ret <8 x i16> %conv6
1636 define <2 x i64> @stest_f64i64(<2 x double> %x) {
1637 ; CHECK-LABEL: stest_f64i64:
1638 ; CHECK: @ %bb.0: @ %entry
1639 ; CHECK-NEXT: .save {r4, r5, r6, r7, r8, r9, r10, lr}
1640 ; CHECK-NEXT: push {r4, r5, r6, r7, r8, r9, r10, lr}
1641 ; CHECK-NEXT: .vsave {d8, d9}
1642 ; CHECK-NEXT: vpush {d8, d9}
1643 ; CHECK-NEXT: vorr q4, q0, q0
1644 ; CHECK-NEXT: vorr d0, d9, d9
1645 ; CHECK-NEXT: bl __fixdfti
1646 ; CHECK-NEXT: mov r5, r0
1647 ; CHECK-NEXT: mvn r8, #0
1648 ; CHECK-NEXT: subs r0, r0, r8
1649 ; CHECK-NEXT: mvn r6, #-2147483648
1650 ; CHECK-NEXT: sbcs r0, r1, r6
1651 ; CHECK-NEXT: mov r10, r1
1652 ; CHECK-NEXT: sbcs r0, r2, #0
1653 ; CHECK-NEXT: vorr d0, d8, d8
1654 ; CHECK-NEXT: sbcs r0, r3, #0
1655 ; CHECK-NEXT: mov r7, #0
1656 ; CHECK-NEXT: mov r0, #0
1657 ; CHECK-NEXT: mov r9, #0
1658 ; CHECK-NEXT: movwlt r0, #1
1659 ; CHECK-NEXT: cmp r0, #0
1660 ; CHECK-NEXT: moveq r3, r0
1661 ; CHECK-NEXT: movne r0, r2
1662 ; CHECK-NEXT: moveq r10, r6
1663 ; CHECK-NEXT: moveq r5, r8
1664 ; CHECK-NEXT: rsbs r1, r5, #0
1665 ; CHECK-NEXT: rscs r1, r10, #-2147483648
1666 ; CHECK-NEXT: sbcs r0, r8, r0
1667 ; CHECK-NEXT: sbcs r0, r8, r3
1668 ; CHECK-NEXT: movwlt r7, #1
1669 ; CHECK-NEXT: cmp r7, #0
1670 ; CHECK-NEXT: moveq r5, r7
1671 ; CHECK-NEXT: bl __fixdfti
1672 ; CHECK-NEXT: subs r4, r0, r8
1673 ; CHECK-NEXT: vmov.32 d1[0], r5
1674 ; CHECK-NEXT: sbcs r4, r1, r6
1675 ; CHECK-NEXT: sbcs r4, r2, #0
1676 ; CHECK-NEXT: sbcs r4, r3, #0
1677 ; CHECK-NEXT: mov r4, #0
1678 ; CHECK-NEXT: movwlt r4, #1
1679 ; CHECK-NEXT: cmp r4, #0
1680 ; CHECK-NEXT: moveq r3, r4
1681 ; CHECK-NEXT: movne r6, r1
1682 ; CHECK-NEXT: movne r4, r2
1683 ; CHECK-NEXT: moveq r0, r8
1684 ; CHECK-NEXT: rsbs r1, r0, #0
1685 ; CHECK-NEXT: rscs r1, r6, #-2147483648
1686 ; CHECK-NEXT: sbcs r1, r8, r4
1687 ; CHECK-NEXT: sbcs r1, r8, r3
1688 ; CHECK-NEXT: movwlt r9, #1
1689 ; CHECK-NEXT: cmp r9, #0
1690 ; CHECK-NEXT: moveq r0, r9
1691 ; CHECK-NEXT: mov r1, #-2147483648
1692 ; CHECK-NEXT: cmp r7, #0
1693 ; CHECK-NEXT: vmov.32 d0[0], r0
1694 ; CHECK-NEXT: moveq r10, r1
1695 ; CHECK-NEXT: cmp r9, #0
1696 ; CHECK-NEXT: vmov.32 d1[1], r10
1697 ; CHECK-NEXT: moveq r6, r1
1698 ; CHECK-NEXT: vmov.32 d0[1], r6
1699 ; CHECK-NEXT: vpop {d8, d9}
1700 ; CHECK-NEXT: pop {r4, r5, r6, r7, r8, r9, r10, pc}
1702 %conv = fptosi <2 x double> %x to <2 x i128>
1703 %0 = icmp slt <2 x i128> %conv, <i128 9223372036854775807, i128 9223372036854775807>
1704 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 9223372036854775807, i128 9223372036854775807>
1705 %1 = icmp sgt <2 x i128> %spec.store.select, <i128 -9223372036854775808, i128 -9223372036854775808>
1706 %spec.store.select7 = select <2 x i1> %1, <2 x i128> %spec.store.select, <2 x i128> <i128 -9223372036854775808, i128 -9223372036854775808>
1707 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
1708 ret <2 x i64> %conv6
1711 define <2 x i64> @utest_f64i64(<2 x double> %x) {
1712 ; CHECK-LABEL: utest_f64i64:
1713 ; CHECK: @ %bb.0: @ %entry
1714 ; CHECK-NEXT: .save {r4, r5, r6, r7, r11, lr}
1715 ; CHECK-NEXT: push {r4, r5, r6, r7, r11, lr}
1716 ; CHECK-NEXT: .vsave {d8, d9}
1717 ; CHECK-NEXT: vpush {d8, d9}
1718 ; CHECK-NEXT: vorr q4, q0, q0
1719 ; CHECK-NEXT: vorr d0, d9, d9
1720 ; CHECK-NEXT: bl __fixunsdfti
1721 ; CHECK-NEXT: mov r5, r0
1722 ; CHECK-NEXT: subs r0, r2, #1
1723 ; CHECK-NEXT: vorr d0, d8, d8
1724 ; CHECK-NEXT: sbcs r0, r3, #0
1725 ; CHECK-NEXT: mov r7, #0
1726 ; CHECK-NEXT: mov r4, r1
1727 ; CHECK-NEXT: movwlo r7, #1
1728 ; CHECK-NEXT: cmp r7, #0
1729 ; CHECK-NEXT: mov r6, #0
1730 ; CHECK-NEXT: moveq r5, r7
1731 ; CHECK-NEXT: bl __fixunsdfti
1732 ; CHECK-NEXT: subs r2, r2, #1
1733 ; CHECK-NEXT: vmov.32 d1[0], r5
1734 ; CHECK-NEXT: sbcs r2, r3, #0
1735 ; CHECK-NEXT: movwlo r6, #1
1736 ; CHECK-NEXT: cmp r6, #0
1737 ; CHECK-NEXT: moveq r0, r6
1738 ; CHECK-NEXT: cmp r7, #0
1739 ; CHECK-NEXT: movne r7, r4
1740 ; CHECK-NEXT: vmov.32 d0[0], r0
1741 ; CHECK-NEXT: cmp r6, #0
1742 ; CHECK-NEXT: vmov.32 d1[1], r7
1743 ; CHECK-NEXT: movne r6, r1
1744 ; CHECK-NEXT: vmov.32 d0[1], r6
1745 ; CHECK-NEXT: vpop {d8, d9}
1746 ; CHECK-NEXT: pop {r4, r5, r6, r7, r11, pc}
1748 %conv = fptoui <2 x double> %x to <2 x i128>
1749 %0 = icmp ult <2 x i128> %conv, <i128 18446744073709551616, i128 18446744073709551616>
1750 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>
1751 %conv6 = trunc <2 x i128> %spec.store.select to <2 x i64>
1752 ret <2 x i64> %conv6
1755 define <2 x i64> @ustest_f64i64(<2 x double> %x) {
1756 ; CHECK-LABEL: ustest_f64i64:
1757 ; CHECK: @ %bb.0: @ %entry
1758 ; CHECK-NEXT: .save {r4, r5, r6, r7, r8, r9, r11, lr}
1759 ; CHECK-NEXT: push {r4, r5, r6, r7, r8, r9, r11, lr}
1760 ; CHECK-NEXT: .vsave {d8, d9}
1761 ; CHECK-NEXT: vpush {d8, d9}
1762 ; CHECK-NEXT: vorr q4, q0, q0
1763 ; CHECK-NEXT: vorr d0, d9, d9
1764 ; CHECK-NEXT: bl __fixdfti
1765 ; CHECK-NEXT: mov r8, r1
1766 ; CHECK-NEXT: subs r1, r2, #1
1767 ; CHECK-NEXT: sbcs r1, r3, #0
1768 ; CHECK-NEXT: mov r6, #0
1769 ; CHECK-NEXT: movwlt r6, #1
1770 ; CHECK-NEXT: cmp r6, #0
1771 ; CHECK-NEXT: mov r9, #1
1772 ; CHECK-NEXT: moveq r3, r6
1773 ; CHECK-NEXT: moveq r8, r6
1774 ; CHECK-NEXT: moveq r2, r9
1775 ; CHECK-NEXT: movne r6, r0
1776 ; CHECK-NEXT: rsbs r0, r6, #0
1777 ; CHECK-NEXT: rscs r0, r8, #0
1778 ; CHECK-NEXT: vorr d0, d8, d8
1779 ; CHECK-NEXT: rscs r0, r2, #0
1780 ; CHECK-NEXT: mov r7, #0
1781 ; CHECK-NEXT: rscs r0, r3, #0
1782 ; CHECK-NEXT: mov r5, #0
1783 ; CHECK-NEXT: movwlt r7, #1
1784 ; CHECK-NEXT: cmp r7, #0
1785 ; CHECK-NEXT: moveq r6, r7
1786 ; CHECK-NEXT: bl __fixdfti
1787 ; CHECK-NEXT: subs r4, r2, #1
1788 ; CHECK-NEXT: vmov.32 d1[0], r6
1789 ; CHECK-NEXT: sbcs r4, r3, #0
1790 ; CHECK-NEXT: mov r4, #0
1791 ; CHECK-NEXT: movwlt r4, #1
1792 ; CHECK-NEXT: cmp r4, #0
1793 ; CHECK-NEXT: movne r9, r2
1794 ; CHECK-NEXT: moveq r3, r4
1795 ; CHECK-NEXT: moveq r1, r4
1796 ; CHECK-NEXT: movne r4, r0
1797 ; CHECK-NEXT: rsbs r0, r4, #0
1798 ; CHECK-NEXT: rscs r0, r1, #0
1799 ; CHECK-NEXT: rscs r0, r9, #0
1800 ; CHECK-NEXT: rscs r0, r3, #0
1801 ; CHECK-NEXT: movwlt r5, #1
1802 ; CHECK-NEXT: cmp r5, #0
1803 ; CHECK-NEXT: moveq r4, r5
1804 ; CHECK-NEXT: cmp r7, #0
1805 ; CHECK-NEXT: movne r7, r8
1806 ; CHECK-NEXT: vmov.32 d0[0], r4
1807 ; CHECK-NEXT: cmp r5, #0
1808 ; CHECK-NEXT: vmov.32 d1[1], r7
1809 ; CHECK-NEXT: movne r5, r1
1810 ; CHECK-NEXT: vmov.32 d0[1], r5
1811 ; CHECK-NEXT: vpop {d8, d9}
1812 ; CHECK-NEXT: pop {r4, r5, r6, r7, r8, r9, r11, pc}
1814 %conv = fptosi <2 x double> %x to <2 x i128>
1815 %0 = icmp slt <2 x i128> %conv, <i128 18446744073709551616, i128 18446744073709551616>
1816 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>
1817 %1 = icmp sgt <2 x i128> %spec.store.select, zeroinitializer
1818 %spec.store.select7 = select <2 x i1> %1, <2 x i128> %spec.store.select, <2 x i128> zeroinitializer
1819 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
1820 ret <2 x i64> %conv6
1823 define <2 x i64> @stest_f32i64(<2 x float> %x) {
1824 ; CHECK-LABEL: stest_f32i64:
1825 ; CHECK: @ %bb.0: @ %entry
1826 ; CHECK-NEXT: .save {r4, r5, r6, r7, r8, r9, r10, lr}
1827 ; CHECK-NEXT: push {r4, r5, r6, r7, r8, r9, r10, lr}
1828 ; CHECK-NEXT: .vsave {d8}
1829 ; CHECK-NEXT: vpush {d8}
1830 ; CHECK-NEXT: vmov.f64 d8, d0
1831 ; CHECK-NEXT: vmov.f32 s0, s17
1832 ; CHECK-NEXT: bl __fixsfti
1833 ; CHECK-NEXT: mov r5, r0
1834 ; CHECK-NEXT: mvn r8, #0
1835 ; CHECK-NEXT: subs r0, r0, r8
1836 ; CHECK-NEXT: mvn r6, #-2147483648
1837 ; CHECK-NEXT: sbcs r0, r1, r6
1838 ; CHECK-NEXT: vmov.f32 s0, s16
1839 ; CHECK-NEXT: sbcs r0, r2, #0
1840 ; CHECK-NEXT: mov r10, r1
1841 ; CHECK-NEXT: sbcs r0, r3, #0
1842 ; CHECK-NEXT: mov r7, #0
1843 ; CHECK-NEXT: mov r0, #0
1844 ; CHECK-NEXT: mov r9, #0
1845 ; CHECK-NEXT: movwlt r0, #1
1846 ; CHECK-NEXT: cmp r0, #0
1847 ; CHECK-NEXT: moveq r3, r0
1848 ; CHECK-NEXT: movne r0, r2
1849 ; CHECK-NEXT: moveq r10, r6
1850 ; CHECK-NEXT: moveq r5, r8
1851 ; CHECK-NEXT: rsbs r1, r5, #0
1852 ; CHECK-NEXT: rscs r1, r10, #-2147483648
1853 ; CHECK-NEXT: sbcs r0, r8, r0
1854 ; CHECK-NEXT: sbcs r0, r8, r3
1855 ; CHECK-NEXT: movwlt r7, #1
1856 ; CHECK-NEXT: cmp r7, #0
1857 ; CHECK-NEXT: moveq r5, r7
1858 ; CHECK-NEXT: bl __fixsfti
1859 ; CHECK-NEXT: subs r4, r0, r8
1860 ; CHECK-NEXT: vmov.32 d1[0], r5
1861 ; CHECK-NEXT: sbcs r4, r1, r6
1862 ; CHECK-NEXT: sbcs r4, r2, #0
1863 ; CHECK-NEXT: sbcs r4, r3, #0
1864 ; CHECK-NEXT: mov r4, #0
1865 ; CHECK-NEXT: movwlt r4, #1
1866 ; CHECK-NEXT: cmp r4, #0
1867 ; CHECK-NEXT: moveq r3, r4
1868 ; CHECK-NEXT: movne r6, r1
1869 ; CHECK-NEXT: movne r4, r2
1870 ; CHECK-NEXT: moveq r0, r8
1871 ; CHECK-NEXT: rsbs r1, r0, #0
1872 ; CHECK-NEXT: rscs r1, r6, #-2147483648
1873 ; CHECK-NEXT: sbcs r1, r8, r4
1874 ; CHECK-NEXT: sbcs r1, r8, r3
1875 ; CHECK-NEXT: movwlt r9, #1
1876 ; CHECK-NEXT: cmp r9, #0
1877 ; CHECK-NEXT: moveq r0, r9
1878 ; CHECK-NEXT: mov r1, #-2147483648
1879 ; CHECK-NEXT: cmp r7, #0
1880 ; CHECK-NEXT: vmov.32 d0[0], r0
1881 ; CHECK-NEXT: moveq r10, r1
1882 ; CHECK-NEXT: cmp r9, #0
1883 ; CHECK-NEXT: vmov.32 d1[1], r10
1884 ; CHECK-NEXT: moveq r6, r1
1885 ; CHECK-NEXT: vmov.32 d0[1], r6
1886 ; CHECK-NEXT: vpop {d8}
1887 ; CHECK-NEXT: pop {r4, r5, r6, r7, r8, r9, r10, pc}
1889 %conv = fptosi <2 x float> %x to <2 x i128>
1890 %0 = icmp slt <2 x i128> %conv, <i128 9223372036854775807, i128 9223372036854775807>
1891 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 9223372036854775807, i128 9223372036854775807>
1892 %1 = icmp sgt <2 x i128> %spec.store.select, <i128 -9223372036854775808, i128 -9223372036854775808>
1893 %spec.store.select7 = select <2 x i1> %1, <2 x i128> %spec.store.select, <2 x i128> <i128 -9223372036854775808, i128 -9223372036854775808>
1894 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
1895 ret <2 x i64> %conv6
1898 define <2 x i64> @utest_f32i64(<2 x float> %x) {
1899 ; CHECK-LABEL: utest_f32i64:
1900 ; CHECK: @ %bb.0: @ %entry
1901 ; CHECK-NEXT: .save {r4, r5, r6, r7, r11, lr}
1902 ; CHECK-NEXT: push {r4, r5, r6, r7, r11, lr}
1903 ; CHECK-NEXT: .vsave {d8}
1904 ; CHECK-NEXT: vpush {d8}
1905 ; CHECK-NEXT: vmov.f64 d8, d0
1906 ; CHECK-NEXT: vmov.f32 s0, s17
1907 ; CHECK-NEXT: bl __fixunssfti
1908 ; CHECK-NEXT: vmov.f32 s0, s16
1909 ; CHECK-NEXT: mov r5, r0
1910 ; CHECK-NEXT: subs r0, r2, #1
1911 ; CHECK-NEXT: mov r7, #0
1912 ; CHECK-NEXT: sbcs r0, r3, #0
1913 ; CHECK-NEXT: mov r4, r1
1914 ; CHECK-NEXT: movwlo r7, #1
1915 ; CHECK-NEXT: cmp r7, #0
1916 ; CHECK-NEXT: mov r6, #0
1917 ; CHECK-NEXT: moveq r5, r7
1918 ; CHECK-NEXT: bl __fixunssfti
1919 ; CHECK-NEXT: subs r2, r2, #1
1920 ; CHECK-NEXT: vmov.32 d1[0], r5
1921 ; CHECK-NEXT: sbcs r2, r3, #0
1922 ; CHECK-NEXT: movwlo r6, #1
1923 ; CHECK-NEXT: cmp r6, #0
1924 ; CHECK-NEXT: moveq r0, r6
1925 ; CHECK-NEXT: cmp r7, #0
1926 ; CHECK-NEXT: movne r7, r4
1927 ; CHECK-NEXT: vmov.32 d0[0], r0
1928 ; CHECK-NEXT: cmp r6, #0
1929 ; CHECK-NEXT: vmov.32 d1[1], r7
1930 ; CHECK-NEXT: movne r6, r1
1931 ; CHECK-NEXT: vmov.32 d0[1], r6
1932 ; CHECK-NEXT: vpop {d8}
1933 ; CHECK-NEXT: pop {r4, r5, r6, r7, r11, pc}
1935 %conv = fptoui <2 x float> %x to <2 x i128>
1936 %0 = icmp ult <2 x i128> %conv, <i128 18446744073709551616, i128 18446744073709551616>
1937 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>
1938 %conv6 = trunc <2 x i128> %spec.store.select to <2 x i64>
1939 ret <2 x i64> %conv6
1942 define <2 x i64> @ustest_f32i64(<2 x float> %x) {
1943 ; CHECK-LABEL: ustest_f32i64:
1944 ; CHECK: @ %bb.0: @ %entry
1945 ; CHECK-NEXT: .save {r4, r5, r6, r7, r8, r9, r11, lr}
1946 ; CHECK-NEXT: push {r4, r5, r6, r7, r8, r9, r11, lr}
1947 ; CHECK-NEXT: .vsave {d8}
1948 ; CHECK-NEXT: vpush {d8}
1949 ; CHECK-NEXT: vmov.f64 d8, d0
1950 ; CHECK-NEXT: vmov.f32 s0, s17
1951 ; CHECK-NEXT: bl __fixsfti
1952 ; CHECK-NEXT: mov r8, r1
1953 ; CHECK-NEXT: subs r1, r2, #1
1954 ; CHECK-NEXT: vmov.f32 s0, s16
1955 ; CHECK-NEXT: sbcs r1, r3, #0
1956 ; CHECK-NEXT: mov r6, #0
1957 ; CHECK-NEXT: mov r9, #1
1958 ; CHECK-NEXT: movwlt r6, #1
1959 ; CHECK-NEXT: cmp r6, #0
1960 ; CHECK-NEXT: moveq r3, r6
1961 ; CHECK-NEXT: moveq r8, r6
1962 ; CHECK-NEXT: moveq r2, r9
1963 ; CHECK-NEXT: movne r6, r0
1964 ; CHECK-NEXT: rsbs r0, r6, #0
1965 ; CHECK-NEXT: mov r7, #0
1966 ; CHECK-NEXT: rscs r0, r8, #0
1967 ; CHECK-NEXT: mov r5, #0
1968 ; CHECK-NEXT: rscs r0, r2, #0
1969 ; CHECK-NEXT: rscs r0, r3, #0
1970 ; CHECK-NEXT: movwlt r7, #1
1971 ; CHECK-NEXT: cmp r7, #0
1972 ; CHECK-NEXT: moveq r6, r7
1973 ; CHECK-NEXT: bl __fixsfti
1974 ; CHECK-NEXT: subs r4, r2, #1
1975 ; CHECK-NEXT: vmov.32 d1[0], r6
1976 ; CHECK-NEXT: sbcs r4, r3, #0
1977 ; CHECK-NEXT: mov r4, #0
1978 ; CHECK-NEXT: movwlt r4, #1
1979 ; CHECK-NEXT: cmp r4, #0
1980 ; CHECK-NEXT: movne r9, r2
1981 ; CHECK-NEXT: moveq r3, r4
1982 ; CHECK-NEXT: moveq r1, r4
1983 ; CHECK-NEXT: movne r4, r0
1984 ; CHECK-NEXT: rsbs r0, r4, #0
1985 ; CHECK-NEXT: rscs r0, r1, #0
1986 ; CHECK-NEXT: rscs r0, r9, #0
1987 ; CHECK-NEXT: rscs r0, r3, #0
1988 ; CHECK-NEXT: movwlt r5, #1
1989 ; CHECK-NEXT: cmp r5, #0
1990 ; CHECK-NEXT: moveq r4, r5
1991 ; CHECK-NEXT: cmp r7, #0
1992 ; CHECK-NEXT: movne r7, r8
1993 ; CHECK-NEXT: vmov.32 d0[0], r4
1994 ; CHECK-NEXT: cmp r5, #0
1995 ; CHECK-NEXT: vmov.32 d1[1], r7
1996 ; CHECK-NEXT: movne r5, r1
1997 ; CHECK-NEXT: vmov.32 d0[1], r5
1998 ; CHECK-NEXT: vpop {d8}
1999 ; CHECK-NEXT: pop {r4, r5, r6, r7, r8, r9, r11, pc}
2001 %conv = fptosi <2 x float> %x to <2 x i128>
2002 %0 = icmp slt <2 x i128> %conv, <i128 18446744073709551616, i128 18446744073709551616>
2003 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>
2004 %1 = icmp sgt <2 x i128> %spec.store.select, zeroinitializer
2005 %spec.store.select7 = select <2 x i1> %1, <2 x i128> %spec.store.select, <2 x i128> zeroinitializer
2006 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
2007 ret <2 x i64> %conv6
2010 define <2 x i64> @stest_f16i64(<2 x half> %x) {
2011 ; CHECK-NEON-LABEL: stest_f16i64:
2012 ; CHECK-NEON: @ %bb.0: @ %entry
2013 ; CHECK-NEON-NEXT: .save {r4, r5, r6, r7, r8, r9, r10, r11, lr}
2014 ; CHECK-NEON-NEXT: push {r4, r5, r6, r7, r8, r9, r10, r11, lr}
2015 ; CHECK-NEON-NEXT: .pad #4
2016 ; CHECK-NEON-NEXT: sub sp, sp, #4
2017 ; CHECK-NEON-NEXT: .vsave {d8}
2018 ; CHECK-NEON-NEXT: vpush {d8}
2019 ; CHECK-NEON-NEXT: vmov r0, s0
2020 ; CHECK-NEON-NEXT: vmov.f32 s16, s1
2021 ; CHECK-NEON-NEXT: bl __aeabi_h2f
2022 ; CHECK-NEON-NEXT: mov r8, r0
2023 ; CHECK-NEON-NEXT: vmov r0, s16
2024 ; CHECK-NEON-NEXT: bl __aeabi_h2f
2025 ; CHECK-NEON-NEXT: vmov s0, r0
2026 ; CHECK-NEON-NEXT: bl __fixsfti
2027 ; CHECK-NEON-NEXT: mov r5, r0
2028 ; CHECK-NEON-NEXT: mvn r9, #0
2029 ; CHECK-NEON-NEXT: subs r0, r0, r9
2030 ; CHECK-NEON-NEXT: mvn r7, #-2147483648
2031 ; CHECK-NEON-NEXT: sbcs r0, r1, r7
2032 ; CHECK-NEON-NEXT: mov r11, r1
2033 ; CHECK-NEON-NEXT: sbcs r0, r2, #0
2034 ; CHECK-NEON-NEXT: vmov s0, r8
2035 ; CHECK-NEON-NEXT: sbcs r0, r3, #0
2036 ; CHECK-NEON-NEXT: mov r6, #0
2037 ; CHECK-NEON-NEXT: mov r0, #0
2038 ; CHECK-NEON-NEXT: mov r10, #0
2039 ; CHECK-NEON-NEXT: movwlt r0, #1
2040 ; CHECK-NEON-NEXT: cmp r0, #0
2041 ; CHECK-NEON-NEXT: moveq r3, r0
2042 ; CHECK-NEON-NEXT: movne r0, r2
2043 ; CHECK-NEON-NEXT: moveq r11, r7
2044 ; CHECK-NEON-NEXT: moveq r5, r9
2045 ; CHECK-NEON-NEXT: rsbs r1, r5, #0
2046 ; CHECK-NEON-NEXT: rscs r1, r11, #-2147483648
2047 ; CHECK-NEON-NEXT: sbcs r0, r9, r0
2048 ; CHECK-NEON-NEXT: sbcs r0, r9, r3
2049 ; CHECK-NEON-NEXT: movwlt r6, #1
2050 ; CHECK-NEON-NEXT: cmp r6, #0
2051 ; CHECK-NEON-NEXT: moveq r5, r6
2052 ; CHECK-NEON-NEXT: bl __fixsfti
2053 ; CHECK-NEON-NEXT: subs r4, r0, r9
2054 ; CHECK-NEON-NEXT: vmov.32 d1[0], r5
2055 ; CHECK-NEON-NEXT: sbcs r4, r1, r7
2056 ; CHECK-NEON-NEXT: sbcs r4, r2, #0
2057 ; CHECK-NEON-NEXT: sbcs r4, r3, #0
2058 ; CHECK-NEON-NEXT: mov r4, #0
2059 ; CHECK-NEON-NEXT: movwlt r4, #1
2060 ; CHECK-NEON-NEXT: cmp r4, #0
2061 ; CHECK-NEON-NEXT: moveq r3, r4
2062 ; CHECK-NEON-NEXT: movne r7, r1
2063 ; CHECK-NEON-NEXT: movne r4, r2
2064 ; CHECK-NEON-NEXT: moveq r0, r9
2065 ; CHECK-NEON-NEXT: rsbs r1, r0, #0
2066 ; CHECK-NEON-NEXT: rscs r1, r7, #-2147483648
2067 ; CHECK-NEON-NEXT: sbcs r1, r9, r4
2068 ; CHECK-NEON-NEXT: sbcs r1, r9, r3
2069 ; CHECK-NEON-NEXT: movwlt r10, #1
2070 ; CHECK-NEON-NEXT: cmp r10, #0
2071 ; CHECK-NEON-NEXT: moveq r0, r10
2072 ; CHECK-NEON-NEXT: mov r1, #-2147483648
2073 ; CHECK-NEON-NEXT: cmp r6, #0
2074 ; CHECK-NEON-NEXT: vmov.32 d0[0], r0
2075 ; CHECK-NEON-NEXT: moveq r11, r1
2076 ; CHECK-NEON-NEXT: cmp r10, #0
2077 ; CHECK-NEON-NEXT: vmov.32 d1[1], r11
2078 ; CHECK-NEON-NEXT: moveq r7, r1
2079 ; CHECK-NEON-NEXT: vmov.32 d0[1], r7
2080 ; CHECK-NEON-NEXT: vpop {d8}
2081 ; CHECK-NEON-NEXT: add sp, sp, #4
2082 ; CHECK-NEON-NEXT: pop {r4, r5, r6, r7, r8, r9, r10, r11, pc}
2084 ; CHECK-FP16-LABEL: stest_f16i64:
2085 ; CHECK-FP16: @ %bb.0: @ %entry
2086 ; CHECK-FP16-NEXT: .save {r4, r5, r6, r7, r8, r9, r10, lr}
2087 ; CHECK-FP16-NEXT: push {r4, r5, r6, r7, r8, r9, r10, lr}
2088 ; CHECK-FP16-NEXT: vmov.u16 r0, d0[1]
2089 ; CHECK-FP16-NEXT: vmov.u16 r7, d0[0]
2090 ; CHECK-FP16-NEXT: vmov s0, r0
2091 ; CHECK-FP16-NEXT: bl __fixhfti
2092 ; CHECK-FP16-NEXT: mov r5, r0
2093 ; CHECK-FP16-NEXT: mvn r8, #0
2094 ; CHECK-FP16-NEXT: subs r0, r0, r8
2095 ; CHECK-FP16-NEXT: mvn r6, #-2147483648
2096 ; CHECK-FP16-NEXT: sbcs r0, r1, r6
2097 ; CHECK-FP16-NEXT: mov r10, r1
2098 ; CHECK-FP16-NEXT: sbcs r0, r2, #0
2099 ; CHECK-FP16-NEXT: vmov s0, r7
2100 ; CHECK-FP16-NEXT: sbcs r0, r3, #0
2101 ; CHECK-FP16-NEXT: mov r7, #0
2102 ; CHECK-FP16-NEXT: mov r0, #0
2103 ; CHECK-FP16-NEXT: mov r9, #0
2104 ; CHECK-FP16-NEXT: movwlt r0, #1
2105 ; CHECK-FP16-NEXT: cmp r0, #0
2106 ; CHECK-FP16-NEXT: moveq r3, r0
2107 ; CHECK-FP16-NEXT: movne r0, r2
2108 ; CHECK-FP16-NEXT: moveq r10, r6
2109 ; CHECK-FP16-NEXT: moveq r5, r8
2110 ; CHECK-FP16-NEXT: rsbs r1, r5, #0
2111 ; CHECK-FP16-NEXT: rscs r1, r10, #-2147483648
2112 ; CHECK-FP16-NEXT: sbcs r0, r8, r0
2113 ; CHECK-FP16-NEXT: sbcs r0, r8, r3
2114 ; CHECK-FP16-NEXT: movwlt r7, #1
2115 ; CHECK-FP16-NEXT: cmp r7, #0
2116 ; CHECK-FP16-NEXT: moveq r5, r7
2117 ; CHECK-FP16-NEXT: bl __fixhfti
2118 ; CHECK-FP16-NEXT: subs r4, r0, r8
2119 ; CHECK-FP16-NEXT: vmov.32 d1[0], r5
2120 ; CHECK-FP16-NEXT: sbcs r4, r1, r6
2121 ; CHECK-FP16-NEXT: sbcs r4, r2, #0
2122 ; CHECK-FP16-NEXT: sbcs r4, r3, #0
2123 ; CHECK-FP16-NEXT: mov r4, #0
2124 ; CHECK-FP16-NEXT: movwlt r4, #1
2125 ; CHECK-FP16-NEXT: cmp r4, #0
2126 ; CHECK-FP16-NEXT: moveq r3, r4
2127 ; CHECK-FP16-NEXT: movne r6, r1
2128 ; CHECK-FP16-NEXT: movne r4, r2
2129 ; CHECK-FP16-NEXT: moveq r0, r8
2130 ; CHECK-FP16-NEXT: rsbs r1, r0, #0
2131 ; CHECK-FP16-NEXT: rscs r1, r6, #-2147483648
2132 ; CHECK-FP16-NEXT: sbcs r1, r8, r4
2133 ; CHECK-FP16-NEXT: sbcs r1, r8, r3
2134 ; CHECK-FP16-NEXT: movwlt r9, #1
2135 ; CHECK-FP16-NEXT: cmp r9, #0
2136 ; CHECK-FP16-NEXT: moveq r0, r9
2137 ; CHECK-FP16-NEXT: mov r1, #-2147483648
2138 ; CHECK-FP16-NEXT: cmp r7, #0
2139 ; CHECK-FP16-NEXT: vmov.32 d0[0], r0
2140 ; CHECK-FP16-NEXT: moveq r10, r1
2141 ; CHECK-FP16-NEXT: cmp r9, #0
2142 ; CHECK-FP16-NEXT: vmov.32 d1[1], r10
2143 ; CHECK-FP16-NEXT: moveq r6, r1
2144 ; CHECK-FP16-NEXT: vmov.32 d0[1], r6
2145 ; CHECK-FP16-NEXT: pop {r4, r5, r6, r7, r8, r9, r10, pc}
2147 %conv = fptosi <2 x half> %x to <2 x i128>
2148 %0 = icmp slt <2 x i128> %conv, <i128 9223372036854775807, i128 9223372036854775807>
2149 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 9223372036854775807, i128 9223372036854775807>
2150 %1 = icmp sgt <2 x i128> %spec.store.select, <i128 -9223372036854775808, i128 -9223372036854775808>
2151 %spec.store.select7 = select <2 x i1> %1, <2 x i128> %spec.store.select, <2 x i128> <i128 -9223372036854775808, i128 -9223372036854775808>
2152 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
2153 ret <2 x i64> %conv6
2156 define <2 x i64> @utesth_f16i64(<2 x half> %x) {
2157 ; CHECK-NEON-LABEL: utesth_f16i64:
2158 ; CHECK-NEON: @ %bb.0: @ %entry
2159 ; CHECK-NEON-NEXT: .save {r4, r5, r6, r7, r11, lr}
2160 ; CHECK-NEON-NEXT: push {r4, r5, r6, r7, r11, lr}
2161 ; CHECK-NEON-NEXT: .vsave {d8}
2162 ; CHECK-NEON-NEXT: vpush {d8}
2163 ; CHECK-NEON-NEXT: vmov r0, s0
2164 ; CHECK-NEON-NEXT: vmov.f32 s16, s1
2165 ; CHECK-NEON-NEXT: bl __aeabi_h2f
2166 ; CHECK-NEON-NEXT: mov r5, r0
2167 ; CHECK-NEON-NEXT: vmov r0, s16
2168 ; CHECK-NEON-NEXT: bl __aeabi_h2f
2169 ; CHECK-NEON-NEXT: vmov s0, r0
2170 ; CHECK-NEON-NEXT: bl __fixunssfti
2171 ; CHECK-NEON-NEXT: mov r6, r0
2172 ; CHECK-NEON-NEXT: subs r0, r2, #1
2173 ; CHECK-NEON-NEXT: vmov s0, r5
2174 ; CHECK-NEON-NEXT: sbcs r0, r3, #0
2175 ; CHECK-NEON-NEXT: mov r5, #0
2176 ; CHECK-NEON-NEXT: mov r4, r1
2177 ; CHECK-NEON-NEXT: movwlo r5, #1
2178 ; CHECK-NEON-NEXT: cmp r5, #0
2179 ; CHECK-NEON-NEXT: mov r7, #0
2180 ; CHECK-NEON-NEXT: moveq r6, r5
2181 ; CHECK-NEON-NEXT: bl __fixunssfti
2182 ; CHECK-NEON-NEXT: subs r2, r2, #1
2183 ; CHECK-NEON-NEXT: vmov.32 d1[0], r6
2184 ; CHECK-NEON-NEXT: sbcs r2, r3, #0
2185 ; CHECK-NEON-NEXT: movwlo r7, #1
2186 ; CHECK-NEON-NEXT: cmp r7, #0
2187 ; CHECK-NEON-NEXT: moveq r0, r7
2188 ; CHECK-NEON-NEXT: cmp r5, #0
2189 ; CHECK-NEON-NEXT: movne r5, r4
2190 ; CHECK-NEON-NEXT: vmov.32 d0[0], r0
2191 ; CHECK-NEON-NEXT: cmp r7, #0
2192 ; CHECK-NEON-NEXT: vmov.32 d1[1], r5
2193 ; CHECK-NEON-NEXT: movne r7, r1
2194 ; CHECK-NEON-NEXT: vmov.32 d0[1], r7
2195 ; CHECK-NEON-NEXT: vpop {d8}
2196 ; CHECK-NEON-NEXT: pop {r4, r5, r6, r7, r11, pc}
2198 ; CHECK-FP16-LABEL: utesth_f16i64:
2199 ; CHECK-FP16: @ %bb.0: @ %entry
2200 ; CHECK-FP16-NEXT: .save {r4, r5, r6, r7, r11, lr}
2201 ; CHECK-FP16-NEXT: push {r4, r5, r6, r7, r11, lr}
2202 ; CHECK-FP16-NEXT: vmov.u16 r0, d0[1]
2203 ; CHECK-FP16-NEXT: vmov.u16 r7, d0[0]
2204 ; CHECK-FP16-NEXT: vmov s0, r0
2205 ; CHECK-FP16-NEXT: bl __fixunshfti
2206 ; CHECK-FP16-NEXT: mov r5, r0
2207 ; CHECK-FP16-NEXT: subs r0, r2, #1
2208 ; CHECK-FP16-NEXT: vmov s0, r7
2209 ; CHECK-FP16-NEXT: sbcs r0, r3, #0
2210 ; CHECK-FP16-NEXT: mov r7, #0
2211 ; CHECK-FP16-NEXT: mov r4, r1
2212 ; CHECK-FP16-NEXT: movwlo r7, #1
2213 ; CHECK-FP16-NEXT: cmp r7, #0
2214 ; CHECK-FP16-NEXT: mov r6, #0
2215 ; CHECK-FP16-NEXT: moveq r5, r7
2216 ; CHECK-FP16-NEXT: bl __fixunshfti
2217 ; CHECK-FP16-NEXT: subs r2, r2, #1
2218 ; CHECK-FP16-NEXT: vmov.32 d1[0], r5
2219 ; CHECK-FP16-NEXT: sbcs r2, r3, #0
2220 ; CHECK-FP16-NEXT: movwlo r6, #1
2221 ; CHECK-FP16-NEXT: cmp r6, #0
2222 ; CHECK-FP16-NEXT: moveq r0, r6
2223 ; CHECK-FP16-NEXT: cmp r7, #0
2224 ; CHECK-FP16-NEXT: movne r7, r4
2225 ; CHECK-FP16-NEXT: vmov.32 d0[0], r0
2226 ; CHECK-FP16-NEXT: cmp r6, #0
2227 ; CHECK-FP16-NEXT: vmov.32 d1[1], r7
2228 ; CHECK-FP16-NEXT: movne r6, r1
2229 ; CHECK-FP16-NEXT: vmov.32 d0[1], r6
2230 ; CHECK-FP16-NEXT: pop {r4, r5, r6, r7, r11, pc}
2232 %conv = fptoui <2 x half> %x to <2 x i128>
2233 %0 = icmp ult <2 x i128> %conv, <i128 18446744073709551616, i128 18446744073709551616>
2234 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>
2235 %conv6 = trunc <2 x i128> %spec.store.select to <2 x i64>
2236 ret <2 x i64> %conv6
2239 define <2 x i64> @ustest_f16i64(<2 x half> %x) {
2240 ; CHECK-NEON-LABEL: ustest_f16i64:
2241 ; CHECK-NEON: @ %bb.0: @ %entry
2242 ; CHECK-NEON-NEXT: .save {r4, r5, r6, r7, r8, r9, r11, lr}
2243 ; CHECK-NEON-NEXT: push {r4, r5, r6, r7, r8, r9, r11, lr}
2244 ; CHECK-NEON-NEXT: .vsave {d8}
2245 ; CHECK-NEON-NEXT: vpush {d8}
2246 ; CHECK-NEON-NEXT: vmov r0, s0
2247 ; CHECK-NEON-NEXT: vmov.f32 s16, s1
2248 ; CHECK-NEON-NEXT: bl __aeabi_h2f
2249 ; CHECK-NEON-NEXT: mov r5, r0
2250 ; CHECK-NEON-NEXT: vmov r0, s16
2251 ; CHECK-NEON-NEXT: bl __aeabi_h2f
2252 ; CHECK-NEON-NEXT: vmov s0, r0
2253 ; CHECK-NEON-NEXT: bl __fixsfti
2254 ; CHECK-NEON-NEXT: mov r8, r1
2255 ; CHECK-NEON-NEXT: subs r1, r2, #1
2256 ; CHECK-NEON-NEXT: vmov s0, r5
2257 ; CHECK-NEON-NEXT: sbcs r1, r3, #0
2258 ; CHECK-NEON-NEXT: mov r5, #0
2259 ; CHECK-NEON-NEXT: mov r9, #1
2260 ; CHECK-NEON-NEXT: movwlt r5, #1
2261 ; CHECK-NEON-NEXT: cmp r5, #0
2262 ; CHECK-NEON-NEXT: moveq r3, r5
2263 ; CHECK-NEON-NEXT: moveq r8, r5
2264 ; CHECK-NEON-NEXT: moveq r2, r9
2265 ; CHECK-NEON-NEXT: movne r5, r0
2266 ; CHECK-NEON-NEXT: rsbs r0, r5, #0
2267 ; CHECK-NEON-NEXT: mov r7, #0
2268 ; CHECK-NEON-NEXT: rscs r0, r8, #0
2269 ; CHECK-NEON-NEXT: mov r6, #0
2270 ; CHECK-NEON-NEXT: rscs r0, r2, #0
2271 ; CHECK-NEON-NEXT: rscs r0, r3, #0
2272 ; CHECK-NEON-NEXT: movwlt r7, #1
2273 ; CHECK-NEON-NEXT: cmp r7, #0
2274 ; CHECK-NEON-NEXT: moveq r5, r7
2275 ; CHECK-NEON-NEXT: bl __fixsfti
2276 ; CHECK-NEON-NEXT: subs r4, r2, #1
2277 ; CHECK-NEON-NEXT: vmov.32 d1[0], r5
2278 ; CHECK-NEON-NEXT: sbcs r4, r3, #0
2279 ; CHECK-NEON-NEXT: mov r4, #0
2280 ; CHECK-NEON-NEXT: movwlt r4, #1
2281 ; CHECK-NEON-NEXT: cmp r4, #0
2282 ; CHECK-NEON-NEXT: movne r9, r2
2283 ; CHECK-NEON-NEXT: moveq r3, r4
2284 ; CHECK-NEON-NEXT: moveq r1, r4
2285 ; CHECK-NEON-NEXT: movne r4, r0
2286 ; CHECK-NEON-NEXT: rsbs r0, r4, #0
2287 ; CHECK-NEON-NEXT: rscs r0, r1, #0
2288 ; CHECK-NEON-NEXT: rscs r0, r9, #0
2289 ; CHECK-NEON-NEXT: rscs r0, r3, #0
2290 ; CHECK-NEON-NEXT: movwlt r6, #1
2291 ; CHECK-NEON-NEXT: cmp r6, #0
2292 ; CHECK-NEON-NEXT: moveq r4, r6
2293 ; CHECK-NEON-NEXT: cmp r7, #0
2294 ; CHECK-NEON-NEXT: movne r7, r8
2295 ; CHECK-NEON-NEXT: vmov.32 d0[0], r4
2296 ; CHECK-NEON-NEXT: cmp r6, #0
2297 ; CHECK-NEON-NEXT: vmov.32 d1[1], r7
2298 ; CHECK-NEON-NEXT: movne r6, r1
2299 ; CHECK-NEON-NEXT: vmov.32 d0[1], r6
2300 ; CHECK-NEON-NEXT: vpop {d8}
2301 ; CHECK-NEON-NEXT: pop {r4, r5, r6, r7, r8, r9, r11, pc}
2303 ; CHECK-FP16-LABEL: ustest_f16i64:
2304 ; CHECK-FP16: @ %bb.0: @ %entry
2305 ; CHECK-FP16-NEXT: .save {r4, r5, r6, r7, r8, r9, r11, lr}
2306 ; CHECK-FP16-NEXT: push {r4, r5, r6, r7, r8, r9, r11, lr}
2307 ; CHECK-FP16-NEXT: vmov.u16 r0, d0[1]
2308 ; CHECK-FP16-NEXT: vmov.u16 r4, d0[0]
2309 ; CHECK-FP16-NEXT: vmov s0, r0
2310 ; CHECK-FP16-NEXT: bl __fixhfti
2311 ; CHECK-FP16-NEXT: mov r8, r1
2312 ; CHECK-FP16-NEXT: subs r1, r2, #1
2313 ; CHECK-FP16-NEXT: sbcs r1, r3, #0
2314 ; CHECK-FP16-NEXT: mov r6, #0
2315 ; CHECK-FP16-NEXT: movwlt r6, #1
2316 ; CHECK-FP16-NEXT: cmp r6, #0
2317 ; CHECK-FP16-NEXT: mov r9, #1
2318 ; CHECK-FP16-NEXT: moveq r3, r6
2319 ; CHECK-FP16-NEXT: moveq r8, r6
2320 ; CHECK-FP16-NEXT: moveq r2, r9
2321 ; CHECK-FP16-NEXT: movne r6, r0
2322 ; CHECK-FP16-NEXT: rsbs r0, r6, #0
2323 ; CHECK-FP16-NEXT: rscs r0, r8, #0
2324 ; CHECK-FP16-NEXT: vmov s0, r4
2325 ; CHECK-FP16-NEXT: rscs r0, r2, #0
2326 ; CHECK-FP16-NEXT: mov r7, #0
2327 ; CHECK-FP16-NEXT: rscs r0, r3, #0
2328 ; CHECK-FP16-NEXT: mov r5, #0
2329 ; CHECK-FP16-NEXT: movwlt r7, #1
2330 ; CHECK-FP16-NEXT: cmp r7, #0
2331 ; CHECK-FP16-NEXT: moveq r6, r7
2332 ; CHECK-FP16-NEXT: bl __fixhfti
2333 ; CHECK-FP16-NEXT: subs r4, r2, #1
2334 ; CHECK-FP16-NEXT: vmov.32 d1[0], r6
2335 ; CHECK-FP16-NEXT: sbcs r4, r3, #0
2336 ; CHECK-FP16-NEXT: mov r4, #0
2337 ; CHECK-FP16-NEXT: movwlt r4, #1
2338 ; CHECK-FP16-NEXT: cmp r4, #0
2339 ; CHECK-FP16-NEXT: movne r9, r2
2340 ; CHECK-FP16-NEXT: moveq r3, r4
2341 ; CHECK-FP16-NEXT: moveq r1, r4
2342 ; CHECK-FP16-NEXT: movne r4, r0
2343 ; CHECK-FP16-NEXT: rsbs r0, r4, #0
2344 ; CHECK-FP16-NEXT: rscs r0, r1, #0
2345 ; CHECK-FP16-NEXT: rscs r0, r9, #0
2346 ; CHECK-FP16-NEXT: rscs r0, r3, #0
2347 ; CHECK-FP16-NEXT: movwlt r5, #1
2348 ; CHECK-FP16-NEXT: cmp r5, #0
2349 ; CHECK-FP16-NEXT: moveq r4, r5
2350 ; CHECK-FP16-NEXT: cmp r7, #0
2351 ; CHECK-FP16-NEXT: movne r7, r8
2352 ; CHECK-FP16-NEXT: vmov.32 d0[0], r4
2353 ; CHECK-FP16-NEXT: cmp r5, #0
2354 ; CHECK-FP16-NEXT: vmov.32 d1[1], r7
2355 ; CHECK-FP16-NEXT: movne r5, r1
2356 ; CHECK-FP16-NEXT: vmov.32 d0[1], r5
2357 ; CHECK-FP16-NEXT: pop {r4, r5, r6, r7, r8, r9, r11, pc}
2359 %conv = fptosi <2 x half> %x to <2 x i128>
2360 %0 = icmp slt <2 x i128> %conv, <i128 18446744073709551616, i128 18446744073709551616>
2361 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>
2362 %1 = icmp sgt <2 x i128> %spec.store.select, zeroinitializer
2363 %spec.store.select7 = select <2 x i1> %1, <2 x i128> %spec.store.select, <2 x i128> zeroinitializer
2364 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
2365 ret <2 x i64> %conv6
2372 define <2 x i32> @stest_f64i32_mm(<2 x double> %x) {
2373 ; CHECK-LABEL: stest_f64i32_mm:
2374 ; CHECK: @ %bb.0: @ %entry
2375 ; CHECK-NEXT: .save {r4, r5, r6, r7, r11, lr}
2376 ; CHECK-NEXT: push {r4, r5, r6, r7, r11, lr}
2377 ; CHECK-NEXT: .vsave {d8, d9}
2378 ; CHECK-NEXT: vpush {d8, d9}
2379 ; CHECK-NEXT: vorr q4, q0, q0
2380 ; CHECK-NEXT: vmov r0, r1, d8
2381 ; CHECK-NEXT: bl __aeabi_d2lz
2382 ; CHECK-NEXT: mov r4, r0
2383 ; CHECK-NEXT: vmov r0, r2, d9
2384 ; CHECK-NEXT: cmn r4, #-2147483647
2385 ; CHECK-NEXT: mvn r3, #-2147483648
2386 ; CHECK-NEXT: movlo r3, r4
2387 ; CHECK-NEXT: mvn r5, #-2147483648
2388 ; CHECK-NEXT: cmp r1, #0
2389 ; CHECK-NEXT: mov r6, #0
2390 ; CHECK-NEXT: movpl r4, r5
2391 ; CHECK-NEXT: movpl r1, r6
2392 ; CHECK-NEXT: moveq r4, r3
2393 ; CHECK-NEXT: cmn r1, #1
2394 ; CHECK-NEXT: mov r3, #-2147483648
2395 ; CHECK-NEXT: mov r7, #-2147483648
2396 ; CHECK-NEXT: movgt r3, r4
2397 ; CHECK-NEXT: cmp r4, #-2147483648
2398 ; CHECK-NEXT: movls r4, r7
2399 ; CHECK-NEXT: cmn r1, #1
2400 ; CHECK-NEXT: movne r4, r3
2401 ; CHECK-NEXT: mov r1, r2
2402 ; CHECK-NEXT: bl __aeabi_d2lz
2403 ; CHECK-NEXT: cmn r0, #-2147483647
2404 ; CHECK-NEXT: mvn r2, #-2147483648
2405 ; CHECK-NEXT: movlo r2, r0
2406 ; CHECK-NEXT: cmp r1, #0
2407 ; CHECK-NEXT: movmi r5, r0
2408 ; CHECK-NEXT: movmi r6, r1
2409 ; CHECK-NEXT: moveq r5, r2
2410 ; CHECK-NEXT: cmn r6, #1
2411 ; CHECK-NEXT: mov r0, #-2147483648
2412 ; CHECK-NEXT: vmov.32 d0[0], r4
2413 ; CHECK-NEXT: movgt r0, r5
2414 ; CHECK-NEXT: cmp r5, #-2147483648
2415 ; CHECK-NEXT: movls r5, r7
2416 ; CHECK-NEXT: cmn r6, #1
2417 ; CHECK-NEXT: movne r5, r0
2418 ; CHECK-NEXT: vmov.32 d0[1], r5
2419 ; CHECK-NEXT: vpop {d8, d9}
2420 ; CHECK-NEXT: pop {r4, r5, r6, r7, r11, pc}
2422 %conv = fptosi <2 x double> %x to <2 x i64>
2423 %spec.store.select = call <2 x i64> @llvm.smin.v2i64(<2 x i64> %conv, <2 x i64> <i64 2147483647, i64 2147483647>)
2424 %spec.store.select7 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %spec.store.select, <2 x i64> <i64 -2147483648, i64 -2147483648>)
2425 %conv6 = trunc <2 x i64> %spec.store.select7 to <2 x i32>
2426 ret <2 x i32> %conv6
2429 define <2 x i32> @utest_f64i32_mm(<2 x double> %x) {
2430 ; CHECK-LABEL: utest_f64i32_mm:
2431 ; CHECK: @ %bb.0: @ %entry
2432 ; CHECK-NEXT: .save {r4, lr}
2433 ; CHECK-NEXT: push {r4, lr}
2434 ; CHECK-NEXT: .vsave {d8, d9}
2435 ; CHECK-NEXT: vpush {d8, d9}
2436 ; CHECK-NEXT: vorr q4, q0, q0
2437 ; CHECK-NEXT: vmov r0, r1, d9
2438 ; CHECK-NEXT: bl __aeabi_d2ulz
2439 ; CHECK-NEXT: mov r4, r1
2440 ; CHECK-NEXT: vmov r2, r1, d8
2441 ; CHECK-NEXT: vmov.32 d9[0], r0
2442 ; CHECK-NEXT: mov r0, r2
2443 ; CHECK-NEXT: bl __aeabi_d2ulz
2444 ; CHECK-NEXT: vmov.32 d8[0], r0
2445 ; CHECK-NEXT: vmov.i64 q8, #0xffffffff
2446 ; CHECK-NEXT: vmov.32 d9[1], r4
2447 ; CHECK-NEXT: vmov.32 d8[1], r1
2448 ; CHECK-NEXT: vqsub.u64 q8, q4, q8
2449 ; CHECK-NEXT: vsub.i64 q8, q4, q8
2450 ; CHECK-NEXT: vmovn.i64 d0, q8
2451 ; CHECK-NEXT: vpop {d8, d9}
2452 ; CHECK-NEXT: pop {r4, pc}
2454 %conv = fptoui <2 x double> %x to <2 x i64>
2455 %spec.store.select = call <2 x i64> @llvm.umin.v2i64(<2 x i64> %conv, <2 x i64> <i64 4294967295, i64 4294967295>)
2456 %conv6 = trunc <2 x i64> %spec.store.select to <2 x i32>
2457 ret <2 x i32> %conv6
2460 define <2 x i32> @ustest_f64i32_mm(<2 x double> %x) {
2461 ; CHECK-LABEL: ustest_f64i32_mm:
2462 ; CHECK: @ %bb.0: @ %entry
2463 ; CHECK-NEXT: .save {r4, r5, r6, lr}
2464 ; CHECK-NEXT: push {r4, r5, r6, lr}
2465 ; CHECK-NEXT: .vsave {d8, d9}
2466 ; CHECK-NEXT: vpush {d8, d9}
2467 ; CHECK-NEXT: vorr q4, q0, q0
2468 ; CHECK-NEXT: vmov r0, r1, d8
2469 ; CHECK-NEXT: bl __aeabi_d2lz
2470 ; CHECK-NEXT: vmov r2, r12, d9
2471 ; CHECK-NEXT: cmp r1, #0
2472 ; CHECK-NEXT: mvn r3, #0
2473 ; CHECK-NEXT: mov r5, #0
2474 ; CHECK-NEXT: movmi r3, r0
2475 ; CHECK-NEXT: movpl r1, r5
2476 ; CHECK-NEXT: moveq r3, r0
2477 ; CHECK-NEXT: cmp r1, #0
2478 ; CHECK-NEXT: mov r6, #0
2479 ; CHECK-NEXT: mvn r4, #0
2480 ; CHECK-NEXT: movwgt r6, #1
2481 ; CHECK-NEXT: cmp r6, #0
2482 ; CHECK-NEXT: movne r6, r3
2483 ; CHECK-NEXT: cmp r1, #0
2484 ; CHECK-NEXT: moveq r6, r3
2485 ; CHECK-NEXT: mov r0, r2
2486 ; CHECK-NEXT: mov r1, r12
2487 ; CHECK-NEXT: bl __aeabi_d2lz
2488 ; CHECK-NEXT: cmp r1, #0
2489 ; CHECK-NEXT: vmov.32 d0[0], r6
2490 ; CHECK-NEXT: movmi r4, r0
2491 ; CHECK-NEXT: movpl r1, r5
2492 ; CHECK-NEXT: moveq r4, r0
2493 ; CHECK-NEXT: cmp r1, #0
2494 ; CHECK-NEXT: movwgt r5, #1
2495 ; CHECK-NEXT: cmp r5, #0
2496 ; CHECK-NEXT: movne r5, r4
2497 ; CHECK-NEXT: cmp r1, #0
2498 ; CHECK-NEXT: moveq r5, r4
2499 ; CHECK-NEXT: vmov.32 d0[1], r5
2500 ; CHECK-NEXT: vpop {d8, d9}
2501 ; CHECK-NEXT: pop {r4, r5, r6, pc}
2503 %conv = fptosi <2 x double> %x to <2 x i64>
2504 %spec.store.select = call <2 x i64> @llvm.smin.v2i64(<2 x i64> %conv, <2 x i64> <i64 4294967295, i64 4294967295>)
2505 %spec.store.select7 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %spec.store.select, <2 x i64> zeroinitializer)
2506 %conv6 = trunc <2 x i64> %spec.store.select7 to <2 x i32>
2507 ret <2 x i32> %conv6
2510 define <4 x i32> @stest_f32i32_mm(<4 x float> %x) {
2511 ; CHECK-LABEL: stest_f32i32_mm:
2512 ; CHECK: @ %bb.0: @ %entry
2513 ; CHECK-NEXT: .save {r4, r5, r6, r7, r8, r9, r11, lr}
2514 ; CHECK-NEXT: push {r4, r5, r6, r7, r8, r9, r11, lr}
2515 ; CHECK-NEXT: .vsave {d8, d9}
2516 ; CHECK-NEXT: vpush {d8, d9}
2517 ; CHECK-NEXT: vorr q4, q0, q0
2518 ; CHECK-NEXT: mov r8, #-2147483648
2519 ; CHECK-NEXT: mvn r7, #-2147483648
2520 ; CHECK-NEXT: vmov r0, s19
2521 ; CHECK-NEXT: vmov r5, s16
2522 ; CHECK-NEXT: bl __aeabi_f2lz
2523 ; CHECK-NEXT: mov r4, r0
2524 ; CHECK-NEXT: cmn r0, #-2147483647
2525 ; CHECK-NEXT: mvn r0, #-2147483648
2526 ; CHECK-NEXT: mov r9, #0
2527 ; CHECK-NEXT: movlo r0, r4
2528 ; CHECK-NEXT: cmp r1, #0
2529 ; CHECK-NEXT: movpl r4, r7
2530 ; CHECK-NEXT: movpl r1, r9
2531 ; CHECK-NEXT: moveq r4, r0
2532 ; CHECK-NEXT: cmn r1, #1
2533 ; CHECK-NEXT: mov r0, #-2147483648
2534 ; CHECK-NEXT: movgt r0, r4
2535 ; CHECK-NEXT: cmp r4, #-2147483648
2536 ; CHECK-NEXT: movls r4, r8
2537 ; CHECK-NEXT: cmn r1, #1
2538 ; CHECK-NEXT: movne r4, r0
2539 ; CHECK-NEXT: mov r0, r5
2540 ; CHECK-NEXT: bl __aeabi_f2lz
2541 ; CHECK-NEXT: mov r5, r0
2542 ; CHECK-NEXT: cmn r0, #-2147483647
2543 ; CHECK-NEXT: mvn r0, #-2147483648
2544 ; CHECK-NEXT: mov r2, #-2147483648
2545 ; CHECK-NEXT: movlo r0, r5
2546 ; CHECK-NEXT: cmp r1, #0
2547 ; CHECK-NEXT: movpl r5, r7
2548 ; CHECK-NEXT: movpl r1, r9
2549 ; CHECK-NEXT: moveq r5, r0
2550 ; CHECK-NEXT: vmov r0, s18
2551 ; CHECK-NEXT: cmn r1, #1
2552 ; CHECK-NEXT: movgt r2, r5
2553 ; CHECK-NEXT: cmp r5, #-2147483648
2554 ; CHECK-NEXT: movls r5, r8
2555 ; CHECK-NEXT: cmn r1, #1
2556 ; CHECK-NEXT: movne r5, r2
2557 ; CHECK-NEXT: bl __aeabi_f2lz
2558 ; CHECK-NEXT: mov r6, r0
2559 ; CHECK-NEXT: cmn r0, #-2147483647
2560 ; CHECK-NEXT: mvn r0, #-2147483648
2561 ; CHECK-NEXT: mov r2, #-2147483648
2562 ; CHECK-NEXT: movlo r0, r6
2563 ; CHECK-NEXT: cmp r1, #0
2564 ; CHECK-NEXT: movpl r6, r7
2565 ; CHECK-NEXT: movpl r1, r9
2566 ; CHECK-NEXT: moveq r6, r0
2567 ; CHECK-NEXT: vmov r0, s17
2568 ; CHECK-NEXT: cmn r1, #1
2569 ; CHECK-NEXT: movgt r2, r6
2570 ; CHECK-NEXT: cmp r6, #-2147483648
2571 ; CHECK-NEXT: movls r6, r8
2572 ; CHECK-NEXT: cmn r1, #1
2573 ; CHECK-NEXT: movne r6, r2
2574 ; CHECK-NEXT: bl __aeabi_f2lz
2575 ; CHECK-NEXT: cmn r0, #-2147483647
2576 ; CHECK-NEXT: mvn r2, #-2147483648
2577 ; CHECK-NEXT: movlo r2, r0
2578 ; CHECK-NEXT: cmp r1, #0
2579 ; CHECK-NEXT: movmi r7, r0
2580 ; CHECK-NEXT: movmi r9, r1
2581 ; CHECK-NEXT: moveq r7, r2
2582 ; CHECK-NEXT: cmn r9, #1
2583 ; CHECK-NEXT: mov r0, #-2147483648
2584 ; CHECK-NEXT: vmov.32 d1[0], r6
2585 ; CHECK-NEXT: movgt r0, r7
2586 ; CHECK-NEXT: cmp r7, #-2147483648
2587 ; CHECK-NEXT: vmov.32 d0[0], r5
2588 ; CHECK-NEXT: movls r7, r8
2589 ; CHECK-NEXT: cmn r9, #1
2590 ; CHECK-NEXT: vmov.32 d1[1], r4
2591 ; CHECK-NEXT: movne r7, r0
2592 ; CHECK-NEXT: vmov.32 d0[1], r7
2593 ; CHECK-NEXT: vpop {d8, d9}
2594 ; CHECK-NEXT: pop {r4, r5, r6, r7, r8, r9, r11, pc}
2596 %conv = fptosi <4 x float> %x to <4 x i64>
2597 %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>)
2598 %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>)
2599 %conv6 = trunc <4 x i64> %spec.store.select7 to <4 x i32>
2600 ret <4 x i32> %conv6
2603 define <4 x i32> @utest_f32i32_mm(<4 x float> %x) {
2604 ; CHECK-LABEL: utest_f32i32_mm:
2605 ; CHECK: @ %bb.0: @ %entry
2606 ; CHECK-NEXT: .save {r4, r5, r6, r7, r11, lr}
2607 ; CHECK-NEXT: push {r4, r5, r6, r7, r11, lr}
2608 ; CHECK-NEXT: .vsave {d8, d9, d10, d11}
2609 ; CHECK-NEXT: vpush {d8, d9, d10, d11}
2610 ; CHECK-NEXT: vorr q4, q0, q0
2611 ; CHECK-NEXT: vmov r0, s17
2612 ; CHECK-NEXT: bl __aeabi_f2ulz
2613 ; CHECK-NEXT: mov r4, r1
2614 ; CHECK-NEXT: vmov r1, s18
2615 ; CHECK-NEXT: vmov r5, s19
2616 ; CHECK-NEXT: vmov r6, s16
2617 ; CHECK-NEXT: vmov.32 d9[0], r0
2618 ; CHECK-NEXT: mov r0, r1
2619 ; CHECK-NEXT: bl __aeabi_f2ulz
2620 ; CHECK-NEXT: vmov.32 d10[0], r0
2621 ; CHECK-NEXT: mov r0, r5
2622 ; CHECK-NEXT: mov r7, r1
2623 ; CHECK-NEXT: bl __aeabi_f2ulz
2624 ; CHECK-NEXT: vmov.32 d11[0], r0
2625 ; CHECK-NEXT: mov r0, r6
2626 ; CHECK-NEXT: mov r5, r1
2627 ; CHECK-NEXT: bl __aeabi_f2ulz
2628 ; CHECK-NEXT: vmov.32 d8[0], r0
2629 ; CHECK-NEXT: vmov.i64 q8, #0xffffffff
2630 ; CHECK-NEXT: vmov.32 d11[1], r5
2631 ; CHECK-NEXT: vmov.32 d9[1], r4
2632 ; CHECK-NEXT: vmov.32 d10[1], r7
2633 ; CHECK-NEXT: vmov.32 d8[1], r1
2634 ; CHECK-NEXT: vqsub.u64 q9, q5, q8
2635 ; CHECK-NEXT: vqsub.u64 q8, q4, q8
2636 ; CHECK-NEXT: vsub.i64 q9, q5, q9
2637 ; CHECK-NEXT: vsub.i64 q8, q4, q8
2638 ; CHECK-NEXT: vmovn.i64 d1, q9
2639 ; CHECK-NEXT: vmovn.i64 d0, q8
2640 ; CHECK-NEXT: vpop {d8, d9, d10, d11}
2641 ; CHECK-NEXT: pop {r4, r5, r6, r7, r11, pc}
2643 %conv = fptoui <4 x float> %x to <4 x i64>
2644 %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>)
2645 %conv6 = trunc <4 x i64> %spec.store.select to <4 x i32>
2646 ret <4 x i32> %conv6
2649 define <4 x i32> @ustest_f32i32_mm(<4 x float> %x) {
2650 ; CHECK-LABEL: ustest_f32i32_mm:
2651 ; CHECK: @ %bb.0: @ %entry
2652 ; CHECK-NEXT: .save {r4, r5, r6, r7, r8, r9, r11, lr}
2653 ; CHECK-NEXT: push {r4, r5, r6, r7, r8, r9, r11, lr}
2654 ; CHECK-NEXT: .vsave {d8, d9}
2655 ; CHECK-NEXT: vpush {d8, d9}
2656 ; CHECK-NEXT: vorr q4, q0, q0
2657 ; CHECK-NEXT: mvn r9, #0
2658 ; CHECK-NEXT: vmov r0, s19
2659 ; CHECK-NEXT: vmov r5, s16
2660 ; CHECK-NEXT: vmov r8, s18
2661 ; CHECK-NEXT: bl __aeabi_f2lz
2662 ; CHECK-NEXT: cmp r1, #0
2663 ; CHECK-NEXT: mvn r2, #0
2664 ; CHECK-NEXT: movmi r2, r0
2665 ; CHECK-NEXT: mov r7, #0
2666 ; CHECK-NEXT: moveq r2, r0
2667 ; CHECK-NEXT: movpl r1, r7
2668 ; CHECK-NEXT: cmp r1, #0
2669 ; CHECK-NEXT: mov r4, #0
2670 ; CHECK-NEXT: movwgt r4, #1
2671 ; CHECK-NEXT: cmp r4, #0
2672 ; CHECK-NEXT: movne r4, r2
2673 ; CHECK-NEXT: cmp r1, #0
2674 ; CHECK-NEXT: mov r0, r5
2675 ; CHECK-NEXT: moveq r4, r2
2676 ; CHECK-NEXT: bl __aeabi_f2lz
2677 ; CHECK-NEXT: cmp r1, #0
2678 ; CHECK-NEXT: mvn r2, #0
2679 ; CHECK-NEXT: movmi r2, r0
2680 ; CHECK-NEXT: movpl r1, r7
2681 ; CHECK-NEXT: moveq r2, r0
2682 ; CHECK-NEXT: cmp r1, #0
2683 ; CHECK-NEXT: mov r5, #0
2684 ; CHECK-NEXT: mov r0, r8
2685 ; CHECK-NEXT: movwgt r5, #1
2686 ; CHECK-NEXT: cmp r5, #0
2687 ; CHECK-NEXT: movne r5, r2
2688 ; CHECK-NEXT: cmp r1, #0
2689 ; CHECK-NEXT: moveq r5, r2
2690 ; CHECK-NEXT: bl __aeabi_f2lz
2691 ; CHECK-NEXT: cmp r1, #0
2692 ; CHECK-NEXT: mvn r2, #0
2693 ; CHECK-NEXT: movmi r2, r0
2694 ; CHECK-NEXT: movpl r1, r7
2695 ; CHECK-NEXT: moveq r2, r0
2696 ; CHECK-NEXT: vmov r0, s17
2697 ; CHECK-NEXT: cmp r1, #0
2698 ; CHECK-NEXT: mov r6, #0
2699 ; CHECK-NEXT: movwgt r6, #1
2700 ; CHECK-NEXT: cmp r6, #0
2701 ; CHECK-NEXT: movne r6, r2
2702 ; CHECK-NEXT: cmp r1, #0
2703 ; CHECK-NEXT: moveq r6, r2
2704 ; CHECK-NEXT: bl __aeabi_f2lz
2705 ; CHECK-NEXT: cmp r1, #0
2706 ; CHECK-NEXT: vmov.32 d1[0], r6
2707 ; CHECK-NEXT: movmi r9, r0
2708 ; CHECK-NEXT: movpl r1, r7
2709 ; CHECK-NEXT: moveq r9, r0
2710 ; CHECK-NEXT: cmp r1, #0
2711 ; CHECK-NEXT: movwgt r7, #1
2712 ; CHECK-NEXT: cmp r7, #0
2713 ; CHECK-NEXT: vmov.32 d0[0], r5
2714 ; CHECK-NEXT: movne r7, r9
2715 ; CHECK-NEXT: cmp r1, #0
2716 ; CHECK-NEXT: vmov.32 d1[1], r4
2717 ; CHECK-NEXT: moveq r7, r9
2718 ; CHECK-NEXT: vmov.32 d0[1], r7
2719 ; CHECK-NEXT: vpop {d8, d9}
2720 ; CHECK-NEXT: pop {r4, r5, r6, r7, r8, r9, r11, pc}
2722 %conv = fptosi <4 x float> %x to <4 x i64>
2723 %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>)
2724 %spec.store.select7 = call <4 x i64> @llvm.smax.v4i64(<4 x i64> %spec.store.select, <4 x i64> zeroinitializer)
2725 %conv6 = trunc <4 x i64> %spec.store.select7 to <4 x i32>
2726 ret <4 x i32> %conv6
2729 define <4 x i32> @stest_f16i32_mm(<4 x half> %x) {
2730 ; CHECK-NEON-LABEL: stest_f16i32_mm:
2731 ; CHECK-NEON: @ %bb.0: @ %entry
2732 ; CHECK-NEON-NEXT: .save {r4, r5, r6, r7, r8, r9, r11, lr}
2733 ; CHECK-NEON-NEXT: push {r4, r5, r6, r7, r8, r9, r11, lr}
2734 ; CHECK-NEON-NEXT: .vsave {d8, d9, d10}
2735 ; CHECK-NEON-NEXT: vpush {d8, d9, d10}
2736 ; CHECK-NEON-NEXT: vmov r0, s3
2737 ; CHECK-NEON-NEXT: vmov.f32 s18, s2
2738 ; CHECK-NEON-NEXT: vmov.f32 s16, s1
2739 ; CHECK-NEON-NEXT: vmov.f32 s20, s0
2740 ; CHECK-NEON-NEXT: bl __aeabi_h2f
2741 ; CHECK-NEON-NEXT: bl __aeabi_f2lz
2742 ; CHECK-NEON-NEXT: mov r4, r0
2743 ; CHECK-NEON-NEXT: vmov r0, s20
2744 ; CHECK-NEON-NEXT: cmn r4, #-2147483647
2745 ; CHECK-NEON-NEXT: mvn r2, #-2147483648
2746 ; CHECK-NEON-NEXT: movlo r2, r4
2747 ; CHECK-NEON-NEXT: mvn r7, #-2147483648
2748 ; CHECK-NEON-NEXT: cmp r1, #0
2749 ; CHECK-NEON-NEXT: mov r9, #0
2750 ; CHECK-NEON-NEXT: movpl r4, r7
2751 ; CHECK-NEON-NEXT: movpl r1, r9
2752 ; CHECK-NEON-NEXT: moveq r4, r2
2753 ; CHECK-NEON-NEXT: cmn r1, #1
2754 ; CHECK-NEON-NEXT: mov r2, #-2147483648
2755 ; CHECK-NEON-NEXT: mov r8, #-2147483648
2756 ; CHECK-NEON-NEXT: movgt r2, r4
2757 ; CHECK-NEON-NEXT: cmp r4, #-2147483648
2758 ; CHECK-NEON-NEXT: movls r4, r8
2759 ; CHECK-NEON-NEXT: cmn r1, #1
2760 ; CHECK-NEON-NEXT: movne r4, r2
2761 ; CHECK-NEON-NEXT: bl __aeabi_h2f
2762 ; CHECK-NEON-NEXT: bl __aeabi_f2lz
2763 ; CHECK-NEON-NEXT: mov r5, r0
2764 ; CHECK-NEON-NEXT: cmn r0, #-2147483647
2765 ; CHECK-NEON-NEXT: mvn r0, #-2147483648
2766 ; CHECK-NEON-NEXT: mov r2, #-2147483648
2767 ; CHECK-NEON-NEXT: movlo r0, r5
2768 ; CHECK-NEON-NEXT: cmp r1, #0
2769 ; CHECK-NEON-NEXT: movpl r5, r7
2770 ; CHECK-NEON-NEXT: movpl r1, r9
2771 ; CHECK-NEON-NEXT: moveq r5, r0
2772 ; CHECK-NEON-NEXT: vmov r0, s18
2773 ; CHECK-NEON-NEXT: cmn r1, #1
2774 ; CHECK-NEON-NEXT: movgt r2, r5
2775 ; CHECK-NEON-NEXT: cmp r5, #-2147483648
2776 ; CHECK-NEON-NEXT: movls r5, r8
2777 ; CHECK-NEON-NEXT: cmn r1, #1
2778 ; CHECK-NEON-NEXT: movne r5, r2
2779 ; CHECK-NEON-NEXT: bl __aeabi_h2f
2780 ; CHECK-NEON-NEXT: bl __aeabi_f2lz
2781 ; CHECK-NEON-NEXT: mov r6, r0
2782 ; CHECK-NEON-NEXT: cmn r0, #-2147483647
2783 ; CHECK-NEON-NEXT: mvn r0, #-2147483648
2784 ; CHECK-NEON-NEXT: mov r2, #-2147483648
2785 ; CHECK-NEON-NEXT: movlo r0, r6
2786 ; CHECK-NEON-NEXT: cmp r1, #0
2787 ; CHECK-NEON-NEXT: movpl r6, r7
2788 ; CHECK-NEON-NEXT: movpl r1, r9
2789 ; CHECK-NEON-NEXT: moveq r6, r0
2790 ; CHECK-NEON-NEXT: vmov r0, s16
2791 ; CHECK-NEON-NEXT: cmn r1, #1
2792 ; CHECK-NEON-NEXT: movgt r2, r6
2793 ; CHECK-NEON-NEXT: cmp r6, #-2147483648
2794 ; CHECK-NEON-NEXT: movls r6, r8
2795 ; CHECK-NEON-NEXT: cmn r1, #1
2796 ; CHECK-NEON-NEXT: movne r6, r2
2797 ; CHECK-NEON-NEXT: bl __aeabi_h2f
2798 ; CHECK-NEON-NEXT: bl __aeabi_f2lz
2799 ; CHECK-NEON-NEXT: cmn r0, #-2147483647
2800 ; CHECK-NEON-NEXT: mvn r2, #-2147483648
2801 ; CHECK-NEON-NEXT: movlo r2, r0
2802 ; CHECK-NEON-NEXT: cmp r1, #0
2803 ; CHECK-NEON-NEXT: movmi r7, r0
2804 ; CHECK-NEON-NEXT: movmi r9, r1
2805 ; CHECK-NEON-NEXT: moveq r7, r2
2806 ; CHECK-NEON-NEXT: cmn r9, #1
2807 ; CHECK-NEON-NEXT: mov r0, #-2147483648
2808 ; CHECK-NEON-NEXT: vmov.32 d1[0], r6
2809 ; CHECK-NEON-NEXT: movgt r0, r7
2810 ; CHECK-NEON-NEXT: cmp r7, #-2147483648
2811 ; CHECK-NEON-NEXT: vmov.32 d0[0], r5
2812 ; CHECK-NEON-NEXT: movls r7, r8
2813 ; CHECK-NEON-NEXT: cmn r9, #1
2814 ; CHECK-NEON-NEXT: vmov.32 d1[1], r4
2815 ; CHECK-NEON-NEXT: movne r7, r0
2816 ; CHECK-NEON-NEXT: vmov.32 d0[1], r7
2817 ; CHECK-NEON-NEXT: vpop {d8, d9, d10}
2818 ; CHECK-NEON-NEXT: pop {r4, r5, r6, r7, r8, r9, r11, pc}
2820 ; CHECK-FP16-LABEL: stest_f16i32_mm:
2821 ; CHECK-FP16: @ %bb.0: @ %entry
2822 ; CHECK-FP16-NEXT: .save {r4, r5, r6, r7, r8, r9, r11, lr}
2823 ; CHECK-FP16-NEXT: push {r4, r5, r6, r7, r8, r9, r11, lr}
2824 ; CHECK-FP16-NEXT: .vsave {d8, d9}
2825 ; CHECK-FP16-NEXT: vpush {d8, d9}
2826 ; CHECK-FP16-NEXT: vmov.u16 r0, d0[3]
2827 ; CHECK-FP16-NEXT: vorr d8, d0, d0
2828 ; CHECK-FP16-NEXT: vmov s0, r0
2829 ; CHECK-FP16-NEXT: bl __fixhfdi
2830 ; CHECK-FP16-NEXT: mov r4, r0
2831 ; CHECK-FP16-NEXT: vmov.u16 r0, d8[2]
2832 ; CHECK-FP16-NEXT: vmov.u16 r2, d8[0]
2833 ; CHECK-FP16-NEXT: cmn r4, #-2147483647
2834 ; CHECK-FP16-NEXT: mvn r7, #-2147483648
2835 ; CHECK-FP16-NEXT: mov r9, #0
2836 ; CHECK-FP16-NEXT: mov r8, #-2147483648
2837 ; CHECK-FP16-NEXT: vmov s18, r0
2838 ; CHECK-FP16-NEXT: mvn r0, #-2147483648
2839 ; CHECK-FP16-NEXT: movlo r0, r4
2840 ; CHECK-FP16-NEXT: cmp r1, #0
2841 ; CHECK-FP16-NEXT: movpl r4, r7
2842 ; CHECK-FP16-NEXT: movpl r1, r9
2843 ; CHECK-FP16-NEXT: moveq r4, r0
2844 ; CHECK-FP16-NEXT: cmn r1, #1
2845 ; CHECK-FP16-NEXT: mov r0, #-2147483648
2846 ; CHECK-FP16-NEXT: vmov s0, r2
2847 ; CHECK-FP16-NEXT: movgt r0, r4
2848 ; CHECK-FP16-NEXT: cmp r4, #-2147483648
2849 ; CHECK-FP16-NEXT: movls r4, r8
2850 ; CHECK-FP16-NEXT: cmn r1, #1
2851 ; CHECK-FP16-NEXT: movne r4, r0
2852 ; CHECK-FP16-NEXT: bl __fixhfdi
2853 ; CHECK-FP16-NEXT: vmov.f32 s0, s18
2854 ; CHECK-FP16-NEXT: mov r5, r0
2855 ; CHECK-FP16-NEXT: cmn r0, #-2147483647
2856 ; CHECK-FP16-NEXT: mvn r0, #-2147483648
2857 ; CHECK-FP16-NEXT: movlo r0, r5
2858 ; CHECK-FP16-NEXT: cmp r1, #0
2859 ; CHECK-FP16-NEXT: movpl r5, r7
2860 ; CHECK-FP16-NEXT: movpl r1, r9
2861 ; CHECK-FP16-NEXT: moveq r5, r0
2862 ; CHECK-FP16-NEXT: cmn r1, #1
2863 ; CHECK-FP16-NEXT: mov r0, #-2147483648
2864 ; CHECK-FP16-NEXT: movgt r0, r5
2865 ; CHECK-FP16-NEXT: cmp r5, #-2147483648
2866 ; CHECK-FP16-NEXT: movls r5, r8
2867 ; CHECK-FP16-NEXT: cmn r1, #1
2868 ; CHECK-FP16-NEXT: movne r5, r0
2869 ; CHECK-FP16-NEXT: bl __fixhfdi
2870 ; CHECK-FP16-NEXT: vmov.u16 r2, d8[1]
2871 ; CHECK-FP16-NEXT: mov r6, r0
2872 ; CHECK-FP16-NEXT: cmn r0, #-2147483647
2873 ; CHECK-FP16-NEXT: mvn r0, #-2147483648
2874 ; CHECK-FP16-NEXT: movlo r0, r6
2875 ; CHECK-FP16-NEXT: cmp r1, #0
2876 ; CHECK-FP16-NEXT: movpl r6, r7
2877 ; CHECK-FP16-NEXT: movpl r1, r9
2878 ; CHECK-FP16-NEXT: moveq r6, r0
2879 ; CHECK-FP16-NEXT: cmn r1, #1
2880 ; CHECK-FP16-NEXT: mov r0, #-2147483648
2881 ; CHECK-FP16-NEXT: movgt r0, r6
2882 ; CHECK-FP16-NEXT: cmp r6, #-2147483648
2883 ; CHECK-FP16-NEXT: movls r6, r8
2884 ; CHECK-FP16-NEXT: cmn r1, #1
2885 ; CHECK-FP16-NEXT: movne r6, r0
2886 ; CHECK-FP16-NEXT: vmov s0, r2
2887 ; CHECK-FP16-NEXT: bl __fixhfdi
2888 ; CHECK-FP16-NEXT: cmn r0, #-2147483647
2889 ; CHECK-FP16-NEXT: mvn r2, #-2147483648
2890 ; CHECK-FP16-NEXT: movlo r2, r0
2891 ; CHECK-FP16-NEXT: cmp r1, #0
2892 ; CHECK-FP16-NEXT: movmi r7, r0
2893 ; CHECK-FP16-NEXT: movmi r9, r1
2894 ; CHECK-FP16-NEXT: moveq r7, r2
2895 ; CHECK-FP16-NEXT: cmn r9, #1
2896 ; CHECK-FP16-NEXT: mov r0, #-2147483648
2897 ; CHECK-FP16-NEXT: vmov.32 d1[0], r6
2898 ; CHECK-FP16-NEXT: movgt r0, r7
2899 ; CHECK-FP16-NEXT: cmp r7, #-2147483648
2900 ; CHECK-FP16-NEXT: vmov.32 d0[0], r5
2901 ; CHECK-FP16-NEXT: movls r7, r8
2902 ; CHECK-FP16-NEXT: cmn r9, #1
2903 ; CHECK-FP16-NEXT: vmov.32 d1[1], r4
2904 ; CHECK-FP16-NEXT: movne r7, r0
2905 ; CHECK-FP16-NEXT: vmov.32 d0[1], r7
2906 ; CHECK-FP16-NEXT: vpop {d8, d9}
2907 ; CHECK-FP16-NEXT: pop {r4, r5, r6, r7, r8, r9, r11, pc}
2909 %conv = fptosi <4 x half> %x to <4 x i64>
2910 %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>)
2911 %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>)
2912 %conv6 = trunc <4 x i64> %spec.store.select7 to <4 x i32>
2913 ret <4 x i32> %conv6
2916 define <4 x i32> @utesth_f16i32_mm(<4 x half> %x) {
2917 ; CHECK-NEON-LABEL: utesth_f16i32_mm:
2918 ; CHECK-NEON: @ %bb.0: @ %entry
2919 ; CHECK-NEON-NEXT: .save {r4, r5, r6, r7, r11, lr}
2920 ; CHECK-NEON-NEXT: push {r4, r5, r6, r7, r11, lr}
2921 ; CHECK-NEON-NEXT: .vsave {d8, d9, d10, d11}
2922 ; CHECK-NEON-NEXT: vpush {d8, d9, d10, d11}
2923 ; CHECK-NEON-NEXT: vmov r0, s1
2924 ; CHECK-NEON-NEXT: vmov.f32 s16, s3
2925 ; CHECK-NEON-NEXT: vmov.f32 s18, s2
2926 ; CHECK-NEON-NEXT: vmov.f32 s20, s0
2927 ; CHECK-NEON-NEXT: bl __aeabi_h2f
2928 ; CHECK-NEON-NEXT: bl __aeabi_f2ulz
2929 ; CHECK-NEON-NEXT: mov r4, r1
2930 ; CHECK-NEON-NEXT: vmov r1, s18
2931 ; CHECK-NEON-NEXT: vmov r6, s16
2932 ; CHECK-NEON-NEXT: vmov.32 d9[0], r0
2933 ; CHECK-NEON-NEXT: vmov r7, s20
2934 ; CHECK-NEON-NEXT: mov r0, r1
2935 ; CHECK-NEON-NEXT: bl __aeabi_h2f
2936 ; CHECK-NEON-NEXT: bl __aeabi_f2ulz
2937 ; CHECK-NEON-NEXT: vmov.32 d10[0], r0
2938 ; CHECK-NEON-NEXT: mov r0, r6
2939 ; CHECK-NEON-NEXT: mov r5, r1
2940 ; CHECK-NEON-NEXT: bl __aeabi_h2f
2941 ; CHECK-NEON-NEXT: bl __aeabi_f2ulz
2942 ; CHECK-NEON-NEXT: vmov.32 d11[0], r0
2943 ; CHECK-NEON-NEXT: mov r0, r7
2944 ; CHECK-NEON-NEXT: mov r6, r1
2945 ; CHECK-NEON-NEXT: bl __aeabi_h2f
2946 ; CHECK-NEON-NEXT: bl __aeabi_f2ulz
2947 ; CHECK-NEON-NEXT: vmov.32 d8[0], r0
2948 ; CHECK-NEON-NEXT: vmov.i64 q8, #0xffffffff
2949 ; CHECK-NEON-NEXT: vmov.32 d11[1], r6
2950 ; CHECK-NEON-NEXT: vmov.32 d9[1], r4
2951 ; CHECK-NEON-NEXT: vmov.32 d10[1], r5
2952 ; CHECK-NEON-NEXT: vmov.32 d8[1], r1
2953 ; CHECK-NEON-NEXT: vqsub.u64 q9, q5, q8
2954 ; CHECK-NEON-NEXT: vqsub.u64 q8, q4, q8
2955 ; CHECK-NEON-NEXT: vsub.i64 q9, q5, q9
2956 ; CHECK-NEON-NEXT: vsub.i64 q8, q4, q8
2957 ; CHECK-NEON-NEXT: vmovn.i64 d1, q9
2958 ; CHECK-NEON-NEXT: vmovn.i64 d0, q8
2959 ; CHECK-NEON-NEXT: vpop {d8, d9, d10, d11}
2960 ; CHECK-NEON-NEXT: pop {r4, r5, r6, r7, r11, pc}
2962 ; CHECK-FP16-LABEL: utesth_f16i32_mm:
2963 ; CHECK-FP16: @ %bb.0: @ %entry
2964 ; CHECK-FP16-NEXT: .save {r4, r5, r6, lr}
2965 ; CHECK-FP16-NEXT: push {r4, r5, r6, lr}
2966 ; CHECK-FP16-NEXT: .vsave {d10, d11, d12, d13}
2967 ; CHECK-FP16-NEXT: vpush {d10, d11, d12, d13}
2968 ; CHECK-FP16-NEXT: .vsave {d8}
2969 ; CHECK-FP16-NEXT: vpush {d8}
2970 ; CHECK-FP16-NEXT: vmov.u16 r0, d0[1]
2971 ; CHECK-FP16-NEXT: vorr d8, d0, d0
2972 ; CHECK-FP16-NEXT: vmov.u16 r6, d0[3]
2973 ; CHECK-FP16-NEXT: vmov s0, r0
2974 ; CHECK-FP16-NEXT: bl __fixunshfdi
2975 ; CHECK-FP16-NEXT: mov r4, r1
2976 ; CHECK-FP16-NEXT: vmov.u16 r1, d8[2]
2977 ; CHECK-FP16-NEXT: vmov.32 d11[0], r0
2978 ; CHECK-FP16-NEXT: vmov s0, r1
2979 ; CHECK-FP16-NEXT: bl __fixunshfdi
2980 ; CHECK-FP16-NEXT: vmov s0, r6
2981 ; CHECK-FP16-NEXT: mov r5, r1
2982 ; CHECK-FP16-NEXT: vmov.32 d12[0], r0
2983 ; CHECK-FP16-NEXT: bl __fixunshfdi
2984 ; CHECK-FP16-NEXT: mov r6, r1
2985 ; CHECK-FP16-NEXT: vmov.u16 r1, d8[0]
2986 ; CHECK-FP16-NEXT: vmov.32 d13[0], r0
2987 ; CHECK-FP16-NEXT: vmov s0, r1
2988 ; CHECK-FP16-NEXT: bl __fixunshfdi
2989 ; CHECK-FP16-NEXT: vmov.32 d10[0], r0
2990 ; CHECK-FP16-NEXT: vmov.i64 q8, #0xffffffff
2991 ; CHECK-FP16-NEXT: vmov.32 d13[1], r6
2992 ; CHECK-FP16-NEXT: vmov.32 d11[1], r4
2993 ; CHECK-FP16-NEXT: vmov.32 d12[1], r5
2994 ; CHECK-FP16-NEXT: vmov.32 d10[1], r1
2995 ; CHECK-FP16-NEXT: vqsub.u64 q9, q6, q8
2996 ; CHECK-FP16-NEXT: vqsub.u64 q8, q5, q8
2997 ; CHECK-FP16-NEXT: vsub.i64 q9, q6, q9
2998 ; CHECK-FP16-NEXT: vsub.i64 q8, q5, q8
2999 ; CHECK-FP16-NEXT: vmovn.i64 d1, q9
3000 ; CHECK-FP16-NEXT: vmovn.i64 d0, q8
3001 ; CHECK-FP16-NEXT: vpop {d8}
3002 ; CHECK-FP16-NEXT: vpop {d10, d11, d12, d13}
3003 ; CHECK-FP16-NEXT: pop {r4, r5, r6, pc}
3005 %conv = fptoui <4 x half> %x to <4 x i64>
3006 %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>)
3007 %conv6 = trunc <4 x i64> %spec.store.select to <4 x i32>
3008 ret <4 x i32> %conv6
3011 define <4 x i32> @ustest_f16i32_mm(<4 x half> %x) {
3012 ; CHECK-NEON-LABEL: ustest_f16i32_mm:
3013 ; CHECK-NEON: @ %bb.0: @ %entry
3014 ; CHECK-NEON-NEXT: .save {r4, r5, r6, r7, r8, r9, r11, lr}
3015 ; CHECK-NEON-NEXT: push {r4, r5, r6, r7, r8, r9, r11, lr}
3016 ; CHECK-NEON-NEXT: .vsave {d8, d9, d10}
3017 ; CHECK-NEON-NEXT: vpush {d8, d9, d10}
3018 ; CHECK-NEON-NEXT: vmov r0, s3
3019 ; CHECK-NEON-NEXT: vmov.f32 s18, s2
3020 ; CHECK-NEON-NEXT: vmov.f32 s16, s1
3021 ; CHECK-NEON-NEXT: vmov.f32 s20, s0
3022 ; CHECK-NEON-NEXT: bl __aeabi_h2f
3023 ; CHECK-NEON-NEXT: bl __aeabi_f2lz
3024 ; CHECK-NEON-NEXT: vmov r2, s20
3025 ; CHECK-NEON-NEXT: cmp r1, #0
3026 ; CHECK-NEON-NEXT: mvn r3, #0
3027 ; CHECK-NEON-NEXT: mov r6, #0
3028 ; CHECK-NEON-NEXT: movmi r3, r0
3029 ; CHECK-NEON-NEXT: movpl r1, r6
3030 ; CHECK-NEON-NEXT: moveq r3, r0
3031 ; CHECK-NEON-NEXT: cmp r1, #0
3032 ; CHECK-NEON-NEXT: mov r7, #0
3033 ; CHECK-NEON-NEXT: vmov r8, s18
3034 ; CHECK-NEON-NEXT: movwgt r7, #1
3035 ; CHECK-NEON-NEXT: cmp r7, #0
3036 ; CHECK-NEON-NEXT: movne r7, r3
3037 ; CHECK-NEON-NEXT: cmp r1, #0
3038 ; CHECK-NEON-NEXT: mvn r9, #0
3039 ; CHECK-NEON-NEXT: moveq r7, r3
3040 ; CHECK-NEON-NEXT: mov r0, r2
3041 ; CHECK-NEON-NEXT: bl __aeabi_h2f
3042 ; CHECK-NEON-NEXT: bl __aeabi_f2lz
3043 ; CHECK-NEON-NEXT: cmp r1, #0
3044 ; CHECK-NEON-NEXT: mvn r2, #0
3045 ; CHECK-NEON-NEXT: movmi r2, r0
3046 ; CHECK-NEON-NEXT: movpl r1, r6
3047 ; CHECK-NEON-NEXT: moveq r2, r0
3048 ; CHECK-NEON-NEXT: cmp r1, #0
3049 ; CHECK-NEON-NEXT: mov r4, #0
3050 ; CHECK-NEON-NEXT: mov r0, r8
3051 ; CHECK-NEON-NEXT: movwgt r4, #1
3052 ; CHECK-NEON-NEXT: cmp r4, #0
3053 ; CHECK-NEON-NEXT: movne r4, r2
3054 ; CHECK-NEON-NEXT: cmp r1, #0
3055 ; CHECK-NEON-NEXT: moveq r4, r2
3056 ; CHECK-NEON-NEXT: bl __aeabi_h2f
3057 ; CHECK-NEON-NEXT: bl __aeabi_f2lz
3058 ; CHECK-NEON-NEXT: cmp r1, #0
3059 ; CHECK-NEON-NEXT: mvn r2, #0
3060 ; CHECK-NEON-NEXT: movmi r2, r0
3061 ; CHECK-NEON-NEXT: movpl r1, r6
3062 ; CHECK-NEON-NEXT: moveq r2, r0
3063 ; CHECK-NEON-NEXT: vmov r0, s16
3064 ; CHECK-NEON-NEXT: cmp r1, #0
3065 ; CHECK-NEON-NEXT: mov r5, #0
3066 ; CHECK-NEON-NEXT: movwgt r5, #1
3067 ; CHECK-NEON-NEXT: cmp r5, #0
3068 ; CHECK-NEON-NEXT: movne r5, r2
3069 ; CHECK-NEON-NEXT: cmp r1, #0
3070 ; CHECK-NEON-NEXT: moveq r5, r2
3071 ; CHECK-NEON-NEXT: bl __aeabi_h2f
3072 ; CHECK-NEON-NEXT: bl __aeabi_f2lz
3073 ; CHECK-NEON-NEXT: cmp r1, #0
3074 ; CHECK-NEON-NEXT: vmov.32 d1[0], r5
3075 ; CHECK-NEON-NEXT: movmi r9, r0
3076 ; CHECK-NEON-NEXT: movpl r1, r6
3077 ; CHECK-NEON-NEXT: moveq r9, r0
3078 ; CHECK-NEON-NEXT: cmp r1, #0
3079 ; CHECK-NEON-NEXT: movwgt r6, #1
3080 ; CHECK-NEON-NEXT: cmp r6, #0
3081 ; CHECK-NEON-NEXT: vmov.32 d0[0], r4
3082 ; CHECK-NEON-NEXT: movne r6, r9
3083 ; CHECK-NEON-NEXT: cmp r1, #0
3084 ; CHECK-NEON-NEXT: vmov.32 d1[1], r7
3085 ; CHECK-NEON-NEXT: moveq r6, r9
3086 ; CHECK-NEON-NEXT: vmov.32 d0[1], r6
3087 ; CHECK-NEON-NEXT: vpop {d8, d9, d10}
3088 ; CHECK-NEON-NEXT: pop {r4, r5, r6, r7, r8, r9, r11, pc}
3090 ; CHECK-FP16-LABEL: ustest_f16i32_mm:
3091 ; CHECK-FP16: @ %bb.0: @ %entry
3092 ; CHECK-FP16-NEXT: .save {r4, r5, r6, r7, r8, lr}
3093 ; CHECK-FP16-NEXT: push {r4, r5, r6, r7, r8, lr}
3094 ; CHECK-FP16-NEXT: .vsave {d8, d9}
3095 ; CHECK-FP16-NEXT: vpush {d8, d9}
3096 ; CHECK-FP16-NEXT: vmov.u16 r0, d0[3]
3097 ; CHECK-FP16-NEXT: vorr d8, d0, d0
3098 ; CHECK-FP16-NEXT: vmov s0, r0
3099 ; CHECK-FP16-NEXT: bl __fixhfdi
3100 ; CHECK-FP16-NEXT: vmov.u16 r2, d8[1]
3101 ; CHECK-FP16-NEXT: cmp r1, #0
3102 ; CHECK-FP16-NEXT: vmov.u16 r7, d8[0]
3103 ; CHECK-FP16-NEXT: mov r5, #0
3104 ; CHECK-FP16-NEXT: vmov.u16 r3, d8[2]
3105 ; CHECK-FP16-NEXT: movpl r1, r5
3106 ; CHECK-FP16-NEXT: mov r6, #0
3107 ; CHECK-FP16-NEXT: mvn r8, #0
3108 ; CHECK-FP16-NEXT: vmov s16, r2
3109 ; CHECK-FP16-NEXT: mvn r2, #0
3110 ; CHECK-FP16-NEXT: movmi r2, r0
3111 ; CHECK-FP16-NEXT: vmov s0, r7
3112 ; CHECK-FP16-NEXT: moveq r2, r0
3113 ; CHECK-FP16-NEXT: cmp r1, #0
3114 ; CHECK-FP16-NEXT: movwgt r6, #1
3115 ; CHECK-FP16-NEXT: cmp r6, #0
3116 ; CHECK-FP16-NEXT: movne r6, r2
3117 ; CHECK-FP16-NEXT: cmp r1, #0
3118 ; CHECK-FP16-NEXT: vmov s18, r3
3119 ; CHECK-FP16-NEXT: moveq r6, r2
3120 ; CHECK-FP16-NEXT: bl __fixhfdi
3121 ; CHECK-FP16-NEXT: vmov.f32 s0, s18
3122 ; CHECK-FP16-NEXT: cmp r1, #0
3123 ; CHECK-FP16-NEXT: mvn r2, #0
3124 ; CHECK-FP16-NEXT: movpl r1, r5
3125 ; CHECK-FP16-NEXT: movmi r2, r0
3126 ; CHECK-FP16-NEXT: mov r7, #0
3127 ; CHECK-FP16-NEXT: moveq r2, r0
3128 ; CHECK-FP16-NEXT: cmp r1, #0
3129 ; CHECK-FP16-NEXT: movwgt r7, #1
3130 ; CHECK-FP16-NEXT: cmp r7, #0
3131 ; CHECK-FP16-NEXT: movne r7, r2
3132 ; CHECK-FP16-NEXT: cmp r1, #0
3133 ; CHECK-FP16-NEXT: moveq r7, r2
3134 ; CHECK-FP16-NEXT: bl __fixhfdi
3135 ; CHECK-FP16-NEXT: vmov.f32 s0, s16
3136 ; CHECK-FP16-NEXT: cmp r1, #0
3137 ; CHECK-FP16-NEXT: mvn r2, #0
3138 ; CHECK-FP16-NEXT: movpl r1, r5
3139 ; CHECK-FP16-NEXT: movmi r2, r0
3140 ; CHECK-FP16-NEXT: mov r4, #0
3141 ; CHECK-FP16-NEXT: moveq r2, r0
3142 ; CHECK-FP16-NEXT: cmp r1, #0
3143 ; CHECK-FP16-NEXT: movwgt r4, #1
3144 ; CHECK-FP16-NEXT: cmp r4, #0
3145 ; CHECK-FP16-NEXT: movne r4, r2
3146 ; CHECK-FP16-NEXT: cmp r1, #0
3147 ; CHECK-FP16-NEXT: moveq r4, r2
3148 ; CHECK-FP16-NEXT: bl __fixhfdi
3149 ; CHECK-FP16-NEXT: cmp r1, #0
3150 ; CHECK-FP16-NEXT: vmov.32 d1[0], r4
3151 ; CHECK-FP16-NEXT: movmi r8, r0
3152 ; CHECK-FP16-NEXT: movpl r1, r5
3153 ; CHECK-FP16-NEXT: moveq r8, r0
3154 ; CHECK-FP16-NEXT: cmp r1, #0
3155 ; CHECK-FP16-NEXT: movwgt r5, #1
3156 ; CHECK-FP16-NEXT: cmp r5, #0
3157 ; CHECK-FP16-NEXT: vmov.32 d0[0], r7
3158 ; CHECK-FP16-NEXT: movne r5, r8
3159 ; CHECK-FP16-NEXT: cmp r1, #0
3160 ; CHECK-FP16-NEXT: vmov.32 d1[1], r6
3161 ; CHECK-FP16-NEXT: moveq r5, r8
3162 ; CHECK-FP16-NEXT: vmov.32 d0[1], r5
3163 ; CHECK-FP16-NEXT: vpop {d8, d9}
3164 ; CHECK-FP16-NEXT: pop {r4, r5, r6, r7, r8, pc}
3166 %conv = fptosi <4 x half> %x to <4 x i64>
3167 %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>)
3168 %spec.store.select7 = call <4 x i64> @llvm.smax.v4i64(<4 x i64> %spec.store.select, <4 x i64> zeroinitializer)
3169 %conv6 = trunc <4 x i64> %spec.store.select7 to <4 x i32>
3170 ret <4 x i32> %conv6
3175 define <2 x i16> @stest_f64i16_mm(<2 x double> %x) {
3176 ; CHECK-LABEL: stest_f64i16_mm:
3177 ; CHECK: @ %bb.0: @ %entry
3178 ; CHECK-NEXT: vcvt.s32.f64 s4, d0
3179 ; CHECK-NEXT: vmov r0, s4
3180 ; CHECK-NEXT: vcvt.s32.f64 s0, d1
3181 ; CHECK-NEXT: vmov.i32 d17, #0x7fff
3182 ; CHECK-NEXT: vmvn.i32 d18, #0x7fff
3183 ; CHECK-NEXT: vmov.32 d16[0], r0
3184 ; CHECK-NEXT: vmov r0, s0
3185 ; CHECK-NEXT: vmov.32 d16[1], r0
3186 ; CHECK-NEXT: vmin.s32 d16, d16, d17
3187 ; CHECK-NEXT: vmax.s32 d0, d16, d18
3190 %conv = fptosi <2 x double> %x to <2 x i32>
3191 %spec.store.select = call <2 x i32> @llvm.smin.v2i32(<2 x i32> %conv, <2 x i32> <i32 32767, i32 32767>)
3192 %spec.store.select7 = call <2 x i32> @llvm.smax.v2i32(<2 x i32> %spec.store.select, <2 x i32> <i32 -32768, i32 -32768>)
3193 %conv6 = trunc <2 x i32> %spec.store.select7 to <2 x i16>
3194 ret <2 x i16> %conv6
3197 define <2 x i16> @utest_f64i16_mm(<2 x double> %x) {
3198 ; CHECK-LABEL: utest_f64i16_mm:
3199 ; CHECK: @ %bb.0: @ %entry
3200 ; CHECK-NEXT: vcvt.u32.f64 s4, d0
3201 ; CHECK-NEXT: vmov r0, s4
3202 ; CHECK-NEXT: vcvt.u32.f64 s0, d1
3203 ; CHECK-NEXT: vmov.i32 d17, #0xffff
3204 ; CHECK-NEXT: vmov.32 d16[0], r0
3205 ; CHECK-NEXT: vmov r0, s0
3206 ; CHECK-NEXT: vmov.32 d16[1], r0
3207 ; CHECK-NEXT: vmin.u32 d0, d16, d17
3210 %conv = fptoui <2 x double> %x to <2 x i32>
3211 %spec.store.select = call <2 x i32> @llvm.umin.v2i32(<2 x i32> %conv, <2 x i32> <i32 65535, i32 65535>)
3212 %conv6 = trunc <2 x i32> %spec.store.select to <2 x i16>
3213 ret <2 x i16> %conv6
3216 define <2 x i16> @ustest_f64i16_mm(<2 x double> %x) {
3217 ; CHECK-LABEL: ustest_f64i16_mm:
3218 ; CHECK: @ %bb.0: @ %entry
3219 ; CHECK-NEXT: vcvt.s32.f64 s4, d0
3220 ; CHECK-NEXT: vmov r0, s4
3221 ; CHECK-NEXT: vcvt.s32.f64 s0, d1
3222 ; CHECK-NEXT: vmov.i32 d17, #0xffff
3223 ; CHECK-NEXT: vmov.i32 d18, #0x0
3224 ; CHECK-NEXT: vmov.32 d16[0], r0
3225 ; CHECK-NEXT: vmov r0, s0
3226 ; CHECK-NEXT: vmov.32 d16[1], r0
3227 ; CHECK-NEXT: vmin.s32 d16, d16, d17
3228 ; CHECK-NEXT: vmax.s32 d0, d16, d18
3231 %conv = fptosi <2 x double> %x to <2 x i32>
3232 %spec.store.select = call <2 x i32> @llvm.smin.v2i32(<2 x i32> %conv, <2 x i32> <i32 65535, i32 65535>)
3233 %spec.store.select7 = call <2 x i32> @llvm.smax.v2i32(<2 x i32> %spec.store.select, <2 x i32> zeroinitializer)
3234 %conv6 = trunc <2 x i32> %spec.store.select7 to <2 x i16>
3235 ret <2 x i16> %conv6
3238 define <4 x i16> @stest_f32i16_mm(<4 x float> %x) {
3239 ; CHECK-LABEL: stest_f32i16_mm:
3240 ; CHECK: @ %bb.0: @ %entry
3241 ; CHECK-NEXT: vcvt.s32.f32 q8, q0
3242 ; CHECK-NEXT: vmov.i32 q9, #0x7fff
3243 ; CHECK-NEXT: vmvn.i32 q10, #0x7fff
3244 ; CHECK-NEXT: vmin.s32 q8, q8, q9
3245 ; CHECK-NEXT: vmax.s32 q8, q8, q10
3246 ; CHECK-NEXT: vmovn.i32 d0, q8
3249 %conv = fptosi <4 x float> %x to <4 x i32>
3250 %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>)
3251 %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>)
3252 %conv6 = trunc <4 x i32> %spec.store.select7 to <4 x i16>
3253 ret <4 x i16> %conv6
3256 define <4 x i16> @utest_f32i16_mm(<4 x float> %x) {
3257 ; CHECK-LABEL: utest_f32i16_mm:
3258 ; CHECK: @ %bb.0: @ %entry
3259 ; CHECK-NEXT: vcvt.u32.f32 q8, q0
3260 ; CHECK-NEXT: vmov.i32 q9, #0xffff
3261 ; CHECK-NEXT: vmin.u32 q8, q8, q9
3262 ; CHECK-NEXT: vmovn.i32 d0, q8
3265 %conv = fptoui <4 x float> %x to <4 x i32>
3266 %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>)
3267 %conv6 = trunc <4 x i32> %spec.store.select to <4 x i16>
3268 ret <4 x i16> %conv6
3271 define <4 x i16> @ustest_f32i16_mm(<4 x float> %x) {
3272 ; CHECK-LABEL: ustest_f32i16_mm:
3273 ; CHECK: @ %bb.0: @ %entry
3274 ; CHECK-NEXT: vcvt.s32.f32 q8, q0
3275 ; CHECK-NEXT: vmov.i32 q9, #0xffff
3276 ; CHECK-NEXT: vmov.i32 q10, #0x0
3277 ; CHECK-NEXT: vmin.s32 q8, q8, q9
3278 ; CHECK-NEXT: vmax.s32 q8, q8, q10
3279 ; CHECK-NEXT: vmovn.i32 d0, q8
3282 %conv = fptosi <4 x float> %x to <4 x i32>
3283 %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>)
3284 %spec.store.select7 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %spec.store.select, <4 x i32> zeroinitializer)
3285 %conv6 = trunc <4 x i32> %spec.store.select7 to <4 x i16>
3286 ret <4 x i16> %conv6
3289 define <8 x i16> @stest_f16i16_mm(<8 x half> %x) {
3290 ; CHECK-NEON-LABEL: stest_f16i16_mm:
3291 ; CHECK-NEON: @ %bb.0: @ %entry
3292 ; CHECK-NEON-NEXT: .save {r4, r5, r6, r7, r11, lr}
3293 ; CHECK-NEON-NEXT: push {r4, r5, r6, r7, r11, lr}
3294 ; CHECK-NEON-NEXT: .vsave {d8, d9, d10, d11, d12, d13, d14, d15}
3295 ; CHECK-NEON-NEXT: vpush {d8, d9, d10, d11, d12, d13, d14, d15}
3296 ; CHECK-NEON-NEXT: vmov r0, s1
3297 ; CHECK-NEON-NEXT: vmov.f32 s16, s7
3298 ; CHECK-NEON-NEXT: vmov.f32 s18, s6
3299 ; CHECK-NEON-NEXT: vmov.f32 s20, s5
3300 ; CHECK-NEON-NEXT: vmov.f32 s22, s4
3301 ; CHECK-NEON-NEXT: vmov.f32 s24, s3
3302 ; CHECK-NEON-NEXT: vmov.f32 s26, s2
3303 ; CHECK-NEON-NEXT: vmov.f32 s28, s0
3304 ; CHECK-NEON-NEXT: bl __aeabi_h2f
3305 ; CHECK-NEON-NEXT: mov r4, r0
3306 ; CHECK-NEON-NEXT: vmov r0, s26
3307 ; CHECK-NEON-NEXT: bl __aeabi_h2f
3308 ; CHECK-NEON-NEXT: mov r5, r0
3309 ; CHECK-NEON-NEXT: vmov r0, s22
3310 ; CHECK-NEON-NEXT: bl __aeabi_h2f
3311 ; CHECK-NEON-NEXT: mov r6, r0
3312 ; CHECK-NEON-NEXT: vmov r0, s24
3313 ; CHECK-NEON-NEXT: bl __aeabi_h2f
3314 ; CHECK-NEON-NEXT: mov r7, r0
3315 ; CHECK-NEON-NEXT: vmov r0, s18
3316 ; CHECK-NEON-NEXT: bl __aeabi_h2f
3317 ; CHECK-NEON-NEXT: vmov s0, r0
3318 ; CHECK-NEON-NEXT: vcvt.s32.f32 s0, s0
3319 ; CHECK-NEON-NEXT: vmov r0, s0
3320 ; CHECK-NEON-NEXT: vmov.32 d13[0], r0
3321 ; CHECK-NEON-NEXT: vmov r0, s16
3322 ; CHECK-NEON-NEXT: bl __aeabi_h2f
3323 ; CHECK-NEON-NEXT: vmov s0, r0
3324 ; CHECK-NEON-NEXT: vmov s22, r7
3325 ; CHECK-NEON-NEXT: vcvt.s32.f32 s0, s0
3326 ; CHECK-NEON-NEXT: vmov s30, r6
3327 ; CHECK-NEON-NEXT: vmov r0, s0
3328 ; CHECK-NEON-NEXT: vmov.32 d13[1], r0
3329 ; CHECK-NEON-NEXT: vmov r0, s28
3330 ; CHECK-NEON-NEXT: bl __aeabi_h2f
3331 ; CHECK-NEON-NEXT: vmov s0, r0
3332 ; CHECK-NEON-NEXT: vmov r1, s20
3333 ; CHECK-NEON-NEXT: vcvt.s32.f32 s0, s0
3334 ; CHECK-NEON-NEXT: vmov s2, r5
3335 ; CHECK-NEON-NEXT: vcvt.s32.f32 s20, s2
3336 ; CHECK-NEON-NEXT: vmov r0, s0
3337 ; CHECK-NEON-NEXT: vcvt.s32.f32 s0, s30
3338 ; CHECK-NEON-NEXT: vmov.32 d8[0], r0
3339 ; CHECK-NEON-NEXT: vmov r0, s0
3340 ; CHECK-NEON-NEXT: vmov.32 d12[0], r0
3341 ; CHECK-NEON-NEXT: mov r0, r1
3342 ; CHECK-NEON-NEXT: bl __aeabi_h2f
3343 ; CHECK-NEON-NEXT: vmov s0, r0
3344 ; CHECK-NEON-NEXT: vmov r0, s20
3345 ; CHECK-NEON-NEXT: vcvt.s32.f32 s0, s0
3346 ; CHECK-NEON-NEXT: vmov s2, r4
3347 ; CHECK-NEON-NEXT: vmov.i32 q8, #0x7fff
3348 ; CHECK-NEON-NEXT: vcvt.s32.f32 s2, s2
3349 ; CHECK-NEON-NEXT: vmvn.i32 q9, #0x7fff
3350 ; CHECK-NEON-NEXT: vmov.32 d9[0], r0
3351 ; CHECK-NEON-NEXT: vmov r0, s0
3352 ; CHECK-NEON-NEXT: vcvt.s32.f32 s0, s22
3353 ; CHECK-NEON-NEXT: vmov.32 d12[1], r0
3354 ; CHECK-NEON-NEXT: vmov r0, s0
3355 ; CHECK-NEON-NEXT: vmin.s32 q10, q6, q8
3356 ; CHECK-NEON-NEXT: vmax.s32 q10, q10, q9
3357 ; CHECK-NEON-NEXT: vmov.32 d9[1], r0
3358 ; CHECK-NEON-NEXT: vmov r0, s2
3359 ; CHECK-NEON-NEXT: vmovn.i32 d1, q10
3360 ; CHECK-NEON-NEXT: vmov.32 d8[1], r0
3361 ; CHECK-NEON-NEXT: vmin.s32 q8, q4, q8
3362 ; CHECK-NEON-NEXT: vmax.s32 q8, q8, q9
3363 ; CHECK-NEON-NEXT: vmovn.i32 d0, q8
3364 ; CHECK-NEON-NEXT: vpop {d8, d9, d10, d11, d12, d13, d14, d15}
3365 ; CHECK-NEON-NEXT: pop {r4, r5, r6, r7, r11, pc}
3367 ; CHECK-FP16-LABEL: stest_f16i16_mm:
3368 ; CHECK-FP16: @ %bb.0: @ %entry
3369 ; CHECK-FP16-NEXT: vmovx.f16 s4, s0
3370 ; CHECK-FP16-NEXT: vcvt.s32.f16 s12, s0
3371 ; CHECK-FP16-NEXT: vcvt.s32.f16 s0, s3
3372 ; CHECK-FP16-NEXT: vcvt.s32.f16 s5, s2
3373 ; CHECK-FP16-NEXT: vmov r0, s0
3374 ; CHECK-FP16-NEXT: vcvt.s32.f16 s14, s1
3375 ; CHECK-FP16-NEXT: vmovx.f16 s10, s3
3376 ; CHECK-FP16-NEXT: vmovx.f16 s8, s2
3377 ; CHECK-FP16-NEXT: vcvt.s32.f16 s10, s10
3378 ; CHECK-FP16-NEXT: vcvt.s32.f16 s8, s8
3379 ; CHECK-FP16-NEXT: vmovx.f16 s6, s1
3380 ; CHECK-FP16-NEXT: vcvt.s32.f16 s4, s4
3381 ; CHECK-FP16-NEXT: vcvt.s32.f16 s6, s6
3382 ; CHECK-FP16-NEXT: vmov.i32 q10, #0x7fff
3383 ; CHECK-FP16-NEXT: vmvn.i32 q11, #0x7fff
3384 ; CHECK-FP16-NEXT: vmov.32 d17[0], r0
3385 ; CHECK-FP16-NEXT: vmov r0, s5
3386 ; CHECK-FP16-NEXT: vmov.32 d16[0], r0
3387 ; CHECK-FP16-NEXT: vmov r0, s14
3388 ; CHECK-FP16-NEXT: vmov.32 d19[0], r0
3389 ; CHECK-FP16-NEXT: vmov r0, s12
3390 ; CHECK-FP16-NEXT: vmov.32 d18[0], r0
3391 ; CHECK-FP16-NEXT: vmov r0, s10
3392 ; CHECK-FP16-NEXT: vmov.32 d17[1], r0
3393 ; CHECK-FP16-NEXT: vmov r0, s8
3394 ; CHECK-FP16-NEXT: vmov.32 d16[1], r0
3395 ; CHECK-FP16-NEXT: vmov r0, s6
3396 ; CHECK-FP16-NEXT: vmin.s32 q8, q8, q10
3397 ; CHECK-FP16-NEXT: vmax.s32 q8, q8, q11
3398 ; CHECK-FP16-NEXT: vmovn.i32 d1, q8
3399 ; CHECK-FP16-NEXT: vmov.32 d19[1], r0
3400 ; CHECK-FP16-NEXT: vmov r0, s4
3401 ; CHECK-FP16-NEXT: vmov.32 d18[1], r0
3402 ; CHECK-FP16-NEXT: vmin.s32 q9, q9, q10
3403 ; CHECK-FP16-NEXT: vmax.s32 q9, q9, q11
3404 ; CHECK-FP16-NEXT: vmovn.i32 d0, q9
3405 ; CHECK-FP16-NEXT: bx lr
3407 %conv = fptosi <8 x half> %x to <8 x i32>
3408 %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>)
3409 %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>)
3410 %conv6 = trunc <8 x i32> %spec.store.select7 to <8 x i16>
3411 ret <8 x i16> %conv6
3414 define <8 x i16> @utesth_f16i16_mm(<8 x half> %x) {
3415 ; CHECK-NEON-LABEL: utesth_f16i16_mm:
3416 ; CHECK-NEON: @ %bb.0: @ %entry
3417 ; CHECK-NEON-NEXT: .save {r4, r5, r6, r7, r11, lr}
3418 ; CHECK-NEON-NEXT: push {r4, r5, r6, r7, r11, lr}
3419 ; CHECK-NEON-NEXT: .vsave {d8, d9, d10, d11, d12, d13, d14}
3420 ; CHECK-NEON-NEXT: vpush {d8, d9, d10, d11, d12, d13, d14}
3421 ; CHECK-NEON-NEXT: vmov r0, s1
3422 ; CHECK-NEON-NEXT: vmov.f32 s16, s7
3423 ; CHECK-NEON-NEXT: vmov.f32 s18, s6
3424 ; CHECK-NEON-NEXT: vmov.f32 s20, s5
3425 ; CHECK-NEON-NEXT: vmov.f32 s22, s4
3426 ; CHECK-NEON-NEXT: vmov.f32 s24, s3
3427 ; CHECK-NEON-NEXT: vmov.f32 s26, s2
3428 ; CHECK-NEON-NEXT: vmov.f32 s28, s0
3429 ; CHECK-NEON-NEXT: bl __aeabi_h2f
3430 ; CHECK-NEON-NEXT: mov r4, r0
3431 ; CHECK-NEON-NEXT: vmov r0, s26
3432 ; CHECK-NEON-NEXT: bl __aeabi_h2f
3433 ; CHECK-NEON-NEXT: mov r5, r0
3434 ; CHECK-NEON-NEXT: vmov r0, s22
3435 ; CHECK-NEON-NEXT: bl __aeabi_h2f
3436 ; CHECK-NEON-NEXT: mov r6, r0
3437 ; CHECK-NEON-NEXT: vmov r0, s24
3438 ; CHECK-NEON-NEXT: bl __aeabi_h2f
3439 ; CHECK-NEON-NEXT: mov r7, r0
3440 ; CHECK-NEON-NEXT: vmov r0, s18
3441 ; CHECK-NEON-NEXT: bl __aeabi_h2f
3442 ; CHECK-NEON-NEXT: vmov s0, r0
3443 ; CHECK-NEON-NEXT: vcvt.u32.f32 s0, s0
3444 ; CHECK-NEON-NEXT: vmov r0, s0
3445 ; CHECK-NEON-NEXT: vmov.32 d13[0], r0
3446 ; CHECK-NEON-NEXT: vmov r0, s16
3447 ; CHECK-NEON-NEXT: bl __aeabi_h2f
3448 ; CHECK-NEON-NEXT: vmov s0, r0
3449 ; CHECK-NEON-NEXT: vmov s16, r7
3450 ; CHECK-NEON-NEXT: vcvt.u32.f32 s0, s0
3451 ; CHECK-NEON-NEXT: vmov s18, r6
3452 ; CHECK-NEON-NEXT: vmov r0, s0
3453 ; CHECK-NEON-NEXT: vmov.32 d13[1], r0
3454 ; CHECK-NEON-NEXT: vmov r0, s28
3455 ; CHECK-NEON-NEXT: bl __aeabi_h2f
3456 ; CHECK-NEON-NEXT: vmov s0, r0
3457 ; CHECK-NEON-NEXT: vmov r1, s20
3458 ; CHECK-NEON-NEXT: vcvt.u32.f32 s0, s0
3459 ; CHECK-NEON-NEXT: vmov s2, r5
3460 ; CHECK-NEON-NEXT: vmov r0, s0
3461 ; CHECK-NEON-NEXT: vcvt.u32.f32 s0, s18
3462 ; CHECK-NEON-NEXT: vcvt.u32.f32 s18, s2
3463 ; CHECK-NEON-NEXT: vmov.32 d10[0], r0
3464 ; CHECK-NEON-NEXT: vmov r0, s0
3465 ; CHECK-NEON-NEXT: vmov.32 d12[0], r0
3466 ; CHECK-NEON-NEXT: mov r0, r1
3467 ; CHECK-NEON-NEXT: bl __aeabi_h2f
3468 ; CHECK-NEON-NEXT: vmov s0, r0
3469 ; CHECK-NEON-NEXT: vmov r0, s18
3470 ; CHECK-NEON-NEXT: vcvt.u32.f32 s0, s0
3471 ; CHECK-NEON-NEXT: vmov s2, r4
3472 ; CHECK-NEON-NEXT: vmov.i32 q8, #0xffff
3473 ; CHECK-NEON-NEXT: vcvt.u32.f32 s2, s2
3474 ; CHECK-NEON-NEXT: vmov.32 d11[0], r0
3475 ; CHECK-NEON-NEXT: vmov r0, s0
3476 ; CHECK-NEON-NEXT: vcvt.u32.f32 s0, s16
3477 ; CHECK-NEON-NEXT: vmov.32 d12[1], r0
3478 ; CHECK-NEON-NEXT: vmov r0, s0
3479 ; CHECK-NEON-NEXT: vmin.u32 q9, q6, q8
3480 ; CHECK-NEON-NEXT: vmov.32 d11[1], r0
3481 ; CHECK-NEON-NEXT: vmov r0, s2
3482 ; CHECK-NEON-NEXT: vmovn.i32 d1, q9
3483 ; CHECK-NEON-NEXT: vmov.32 d10[1], r0
3484 ; CHECK-NEON-NEXT: vmin.u32 q8, q5, q8
3485 ; CHECK-NEON-NEXT: vmovn.i32 d0, q8
3486 ; CHECK-NEON-NEXT: vpop {d8, d9, d10, d11, d12, d13, d14}
3487 ; CHECK-NEON-NEXT: pop {r4, r5, r6, r7, r11, pc}
3489 ; CHECK-FP16-LABEL: utesth_f16i16_mm:
3490 ; CHECK-FP16: @ %bb.0: @ %entry
3491 ; CHECK-FP16-NEXT: vmovx.f16 s4, s0
3492 ; CHECK-FP16-NEXT: vcvt.u32.f16 s12, s0
3493 ; CHECK-FP16-NEXT: vcvt.u32.f16 s0, s3
3494 ; CHECK-FP16-NEXT: vcvt.u32.f16 s5, s2
3495 ; CHECK-FP16-NEXT: vmov r0, s0
3496 ; CHECK-FP16-NEXT: vcvt.u32.f16 s14, s1
3497 ; CHECK-FP16-NEXT: vmovx.f16 s10, s3
3498 ; CHECK-FP16-NEXT: vmovx.f16 s8, s2
3499 ; CHECK-FP16-NEXT: vcvt.u32.f16 s10, s10
3500 ; CHECK-FP16-NEXT: vcvt.u32.f16 s8, s8
3501 ; CHECK-FP16-NEXT: vmovx.f16 s6, s1
3502 ; CHECK-FP16-NEXT: vcvt.u32.f16 s4, s4
3503 ; CHECK-FP16-NEXT: vcvt.u32.f16 s6, s6
3504 ; CHECK-FP16-NEXT: vmov.i32 q10, #0xffff
3505 ; CHECK-FP16-NEXT: vmov.32 d17[0], r0
3506 ; CHECK-FP16-NEXT: vmov r0, s5
3507 ; CHECK-FP16-NEXT: vmov.32 d16[0], r0
3508 ; CHECK-FP16-NEXT: vmov r0, s14
3509 ; CHECK-FP16-NEXT: vmov.32 d19[0], r0
3510 ; CHECK-FP16-NEXT: vmov r0, s12
3511 ; CHECK-FP16-NEXT: vmov.32 d18[0], r0
3512 ; CHECK-FP16-NEXT: vmov r0, s10
3513 ; CHECK-FP16-NEXT: vmov.32 d17[1], r0
3514 ; CHECK-FP16-NEXT: vmov r0, s8
3515 ; CHECK-FP16-NEXT: vmov.32 d16[1], r0
3516 ; CHECK-FP16-NEXT: vmov r0, s6
3517 ; CHECK-FP16-NEXT: vmin.u32 q8, q8, q10
3518 ; CHECK-FP16-NEXT: vmovn.i32 d1, q8
3519 ; CHECK-FP16-NEXT: vmov.32 d19[1], r0
3520 ; CHECK-FP16-NEXT: vmov r0, s4
3521 ; CHECK-FP16-NEXT: vmov.32 d18[1], r0
3522 ; CHECK-FP16-NEXT: vmin.u32 q9, q9, q10
3523 ; CHECK-FP16-NEXT: vmovn.i32 d0, q9
3524 ; CHECK-FP16-NEXT: bx lr
3526 %conv = fptoui <8 x half> %x to <8 x i32>
3527 %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>)
3528 %conv6 = trunc <8 x i32> %spec.store.select to <8 x i16>
3529 ret <8 x i16> %conv6
3532 define <8 x i16> @ustest_f16i16_mm(<8 x half> %x) {
3533 ; CHECK-NEON-LABEL: ustest_f16i16_mm:
3534 ; CHECK-NEON: @ %bb.0: @ %entry
3535 ; CHECK-NEON-NEXT: .save {r4, r5, r6, r7, r11, lr}
3536 ; CHECK-NEON-NEXT: push {r4, r5, r6, r7, r11, lr}
3537 ; CHECK-NEON-NEXT: .vsave {d8, d9, d10, d11, d12, d13, d14, d15}
3538 ; CHECK-NEON-NEXT: vpush {d8, d9, d10, d11, d12, d13, d14, d15}
3539 ; CHECK-NEON-NEXT: vmov r0, s1
3540 ; CHECK-NEON-NEXT: vmov.f32 s16, s7
3541 ; CHECK-NEON-NEXT: vmov.f32 s18, s6
3542 ; CHECK-NEON-NEXT: vmov.f32 s20, s5
3543 ; CHECK-NEON-NEXT: vmov.f32 s22, s4
3544 ; CHECK-NEON-NEXT: vmov.f32 s24, s3
3545 ; CHECK-NEON-NEXT: vmov.f32 s26, s2
3546 ; CHECK-NEON-NEXT: vmov.f32 s28, s0
3547 ; CHECK-NEON-NEXT: bl __aeabi_h2f
3548 ; CHECK-NEON-NEXT: mov r4, r0
3549 ; CHECK-NEON-NEXT: vmov r0, s26
3550 ; CHECK-NEON-NEXT: bl __aeabi_h2f
3551 ; CHECK-NEON-NEXT: mov r5, r0
3552 ; CHECK-NEON-NEXT: vmov r0, s22
3553 ; CHECK-NEON-NEXT: bl __aeabi_h2f
3554 ; CHECK-NEON-NEXT: mov r6, r0
3555 ; CHECK-NEON-NEXT: vmov r0, s24
3556 ; CHECK-NEON-NEXT: bl __aeabi_h2f
3557 ; CHECK-NEON-NEXT: mov r7, r0
3558 ; CHECK-NEON-NEXT: vmov r0, s18
3559 ; CHECK-NEON-NEXT: bl __aeabi_h2f
3560 ; CHECK-NEON-NEXT: vmov s0, r0
3561 ; CHECK-NEON-NEXT: vcvt.s32.f32 s0, s0
3562 ; CHECK-NEON-NEXT: vmov r0, s0
3563 ; CHECK-NEON-NEXT: vmov.32 d13[0], r0
3564 ; CHECK-NEON-NEXT: vmov r0, s16
3565 ; CHECK-NEON-NEXT: bl __aeabi_h2f
3566 ; CHECK-NEON-NEXT: vmov s0, r0
3567 ; CHECK-NEON-NEXT: vmov s22, r7
3568 ; CHECK-NEON-NEXT: vcvt.s32.f32 s0, s0
3569 ; CHECK-NEON-NEXT: vmov s30, r6
3570 ; CHECK-NEON-NEXT: vmov r0, s0
3571 ; CHECK-NEON-NEXT: vmov.32 d13[1], r0
3572 ; CHECK-NEON-NEXT: vmov r0, s28
3573 ; CHECK-NEON-NEXT: bl __aeabi_h2f
3574 ; CHECK-NEON-NEXT: vmov s0, r0
3575 ; CHECK-NEON-NEXT: vmov r1, s20
3576 ; CHECK-NEON-NEXT: vcvt.s32.f32 s0, s0
3577 ; CHECK-NEON-NEXT: vmov s2, r5
3578 ; CHECK-NEON-NEXT: vcvt.s32.f32 s20, s2
3579 ; CHECK-NEON-NEXT: vmov r0, s0
3580 ; CHECK-NEON-NEXT: vcvt.s32.f32 s0, s30
3581 ; CHECK-NEON-NEXT: vmov.32 d8[0], r0
3582 ; CHECK-NEON-NEXT: vmov r0, s0
3583 ; CHECK-NEON-NEXT: vmov.32 d12[0], r0
3584 ; CHECK-NEON-NEXT: mov r0, r1
3585 ; CHECK-NEON-NEXT: bl __aeabi_h2f
3586 ; CHECK-NEON-NEXT: vmov s0, r0
3587 ; CHECK-NEON-NEXT: vmov r0, s20
3588 ; CHECK-NEON-NEXT: vcvt.s32.f32 s0, s0
3589 ; CHECK-NEON-NEXT: vmov s2, r4
3590 ; CHECK-NEON-NEXT: vmov.i32 q8, #0xffff
3591 ; CHECK-NEON-NEXT: vcvt.s32.f32 s2, s2
3592 ; CHECK-NEON-NEXT: vmov.i32 q9, #0x0
3593 ; CHECK-NEON-NEXT: vmov.32 d9[0], r0
3594 ; CHECK-NEON-NEXT: vmov r0, s0
3595 ; CHECK-NEON-NEXT: vcvt.s32.f32 s0, s22
3596 ; CHECK-NEON-NEXT: vmov.32 d12[1], r0
3597 ; CHECK-NEON-NEXT: vmov r0, s0
3598 ; CHECK-NEON-NEXT: vmin.s32 q10, q6, q8
3599 ; CHECK-NEON-NEXT: vmax.s32 q10, q10, q9
3600 ; CHECK-NEON-NEXT: vmov.32 d9[1], r0
3601 ; CHECK-NEON-NEXT: vmov r0, s2
3602 ; CHECK-NEON-NEXT: vmovn.i32 d1, q10
3603 ; CHECK-NEON-NEXT: vmov.32 d8[1], r0
3604 ; CHECK-NEON-NEXT: vmin.s32 q8, q4, q8
3605 ; CHECK-NEON-NEXT: vmax.s32 q8, q8, q9
3606 ; CHECK-NEON-NEXT: vmovn.i32 d0, q8
3607 ; CHECK-NEON-NEXT: vpop {d8, d9, d10, d11, d12, d13, d14, d15}
3608 ; CHECK-NEON-NEXT: pop {r4, r5, r6, r7, r11, pc}
3610 ; CHECK-FP16-LABEL: ustest_f16i16_mm:
3611 ; CHECK-FP16: @ %bb.0: @ %entry
3612 ; CHECK-FP16-NEXT: vmovx.f16 s4, s0
3613 ; CHECK-FP16-NEXT: vcvt.s32.f16 s12, s0
3614 ; CHECK-FP16-NEXT: vcvt.s32.f16 s0, s3
3615 ; CHECK-FP16-NEXT: vcvt.s32.f16 s5, s2
3616 ; CHECK-FP16-NEXT: vmov r0, s0
3617 ; CHECK-FP16-NEXT: vcvt.s32.f16 s14, s1
3618 ; CHECK-FP16-NEXT: vmovx.f16 s10, s3
3619 ; CHECK-FP16-NEXT: vmovx.f16 s8, s2
3620 ; CHECK-FP16-NEXT: vcvt.s32.f16 s10, s10
3621 ; CHECK-FP16-NEXT: vcvt.s32.f16 s8, s8
3622 ; CHECK-FP16-NEXT: vmovx.f16 s6, s1
3623 ; CHECK-FP16-NEXT: vcvt.s32.f16 s4, s4
3624 ; CHECK-FP16-NEXT: vcvt.s32.f16 s6, s6
3625 ; CHECK-FP16-NEXT: vmov.i32 q10, #0xffff
3626 ; CHECK-FP16-NEXT: vmov.i32 q11, #0x0
3627 ; CHECK-FP16-NEXT: vmov.32 d17[0], r0
3628 ; CHECK-FP16-NEXT: vmov r0, s5
3629 ; CHECK-FP16-NEXT: vmov.32 d16[0], r0
3630 ; CHECK-FP16-NEXT: vmov r0, s14
3631 ; CHECK-FP16-NEXT: vmov.32 d19[0], r0
3632 ; CHECK-FP16-NEXT: vmov r0, s12
3633 ; CHECK-FP16-NEXT: vmov.32 d18[0], r0
3634 ; CHECK-FP16-NEXT: vmov r0, s10
3635 ; CHECK-FP16-NEXT: vmov.32 d17[1], r0
3636 ; CHECK-FP16-NEXT: vmov r0, s8
3637 ; CHECK-FP16-NEXT: vmov.32 d16[1], r0
3638 ; CHECK-FP16-NEXT: vmov r0, s6
3639 ; CHECK-FP16-NEXT: vmin.s32 q8, q8, q10
3640 ; CHECK-FP16-NEXT: vmax.s32 q8, q8, q11
3641 ; CHECK-FP16-NEXT: vmovn.i32 d1, q8
3642 ; CHECK-FP16-NEXT: vmov.32 d19[1], r0
3643 ; CHECK-FP16-NEXT: vmov r0, s4
3644 ; CHECK-FP16-NEXT: vmov.32 d18[1], r0
3645 ; CHECK-FP16-NEXT: vmin.s32 q9, q9, q10
3646 ; CHECK-FP16-NEXT: vmax.s32 q9, q9, q11
3647 ; CHECK-FP16-NEXT: vmovn.i32 d0, q9
3648 ; CHECK-FP16-NEXT: bx lr
3650 %conv = fptosi <8 x half> %x to <8 x i32>
3651 %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>)
3652 %spec.store.select7 = call <8 x i32> @llvm.smax.v8i32(<8 x i32> %spec.store.select, <8 x i32> zeroinitializer)
3653 %conv6 = trunc <8 x i32> %spec.store.select7 to <8 x i16>
3654 ret <8 x i16> %conv6
3659 define <2 x i64> @stest_f64i64_mm(<2 x double> %x) {
3660 ; CHECK-LABEL: stest_f64i64_mm:
3661 ; CHECK: @ %bb.0: @ %entry
3662 ; CHECK-NEXT: .save {r4, r5, r6, r7, r8, r9, r10, r11, lr}
3663 ; CHECK-NEXT: push {r4, r5, r6, r7, r8, r9, r10, r11, lr}
3664 ; CHECK-NEXT: .pad #4
3665 ; CHECK-NEXT: sub sp, sp, #4
3666 ; CHECK-NEXT: .vsave {d8, d9}
3667 ; CHECK-NEXT: vpush {d8, d9}
3668 ; CHECK-NEXT: .pad #16
3669 ; CHECK-NEXT: sub sp, sp, #16
3670 ; CHECK-NEXT: vorr q4, q0, q0
3671 ; CHECK-NEXT: vorr d0, d9, d9
3672 ; CHECK-NEXT: bl __fixdfti
3673 ; CHECK-NEXT: str r0, [sp, #12] @ 4-byte Spill
3674 ; CHECK-NEXT: cmp r3, #0
3675 ; CHECK-NEXT: mov r0, r3
3676 ; CHECK-NEXT: mov r10, #0
3677 ; CHECK-NEXT: andne r0, r2, r0, asr #31
3678 ; CHECK-NEXT: mov r11, r1
3679 ; CHECK-NEXT: movmi r10, r3
3680 ; CHECK-NEXT: and r1, r0, r10
3681 ; CHECK-NEXT: cmn r11, #-2147483647
3682 ; CHECK-NEXT: mvn r0, #-2147483648
3683 ; CHECK-NEXT: movlo r0, r11
3684 ; CHECK-NEXT: cmp r3, #0
3685 ; CHECK-NEXT: mvn r8, #-2147483648
3686 ; CHECK-NEXT: vorr d0, d8, d8
3687 ; CHECK-NEXT: movmi r8, r11
3688 ; CHECK-NEXT: orrs r2, r2, r3
3689 ; CHECK-NEXT: moveq r8, r0
3690 ; CHECK-NEXT: cmn r10, #1
3691 ; CHECK-NEXT: mov r0, #-2147483648
3692 ; CHECK-NEXT: mov r9, #-2147483648
3693 ; CHECK-NEXT: movgt r0, r8
3694 ; CHECK-NEXT: cmp r8, #-2147483648
3695 ; CHECK-NEXT: movhi r9, r8
3696 ; CHECK-NEXT: cmn r1, #1
3697 ; CHECK-NEXT: mov r6, r3
3698 ; CHECK-NEXT: str r1, [sp, #8] @ 4-byte Spill
3699 ; CHECK-NEXT: mvn r7, #-2147483648
3700 ; CHECK-NEXT: str r2, [sp, #4] @ 4-byte Spill
3701 ; CHECK-NEXT: movne r9, r0
3702 ; CHECK-NEXT: bl __fixdfti
3703 ; CHECK-NEXT: cmn r1, #-2147483647
3704 ; CHECK-NEXT: mvn r5, #0
3705 ; CHECK-NEXT: movlo r5, r0
3706 ; CHECK-NEXT: mvn r4, #0
3707 ; CHECK-NEXT: moveq r5, r0
3708 ; CHECK-NEXT: cmp r3, #0
3709 ; CHECK-NEXT: movpl r0, r4
3710 ; CHECK-NEXT: orrs r12, r2, r3
3711 ; CHECK-NEXT: moveq r0, r5
3712 ; CHECK-NEXT: cmn r1, #-2147483647
3713 ; CHECK-NEXT: mvn r5, #-2147483648
3714 ; CHECK-NEXT: movlo r5, r1
3715 ; CHECK-NEXT: cmp r3, #0
3716 ; CHECK-NEXT: movmi r7, r1
3717 ; CHECK-NEXT: cmp r12, #0
3718 ; CHECK-NEXT: moveq r7, r5
3719 ; CHECK-NEXT: cmp r7, #-2147483648
3720 ; CHECK-NEXT: mov r1, #0
3721 ; CHECK-NEXT: ldr r5, [sp, #12] @ 4-byte Reload
3722 ; CHECK-NEXT: movhi r1, r0
3723 ; CHECK-NEXT: mov r12, #0
3724 ; CHECK-NEXT: moveq r1, r0
3725 ; CHECK-NEXT: cmp r6, #0
3726 ; CHECK-NEXT: mvn r6, #0
3727 ; CHECK-NEXT: movmi r6, r5
3728 ; CHECK-NEXT: cmn r11, #-2147483647
3729 ; CHECK-NEXT: movlo r4, r5
3730 ; CHECK-NEXT: moveq r4, r5
3731 ; CHECK-NEXT: ldr r5, [sp, #4] @ 4-byte Reload
3732 ; CHECK-NEXT: cmp r5, #0
3733 ; CHECK-NEXT: ldr r5, [sp, #8] @ 4-byte Reload
3734 ; CHECK-NEXT: movne r4, r6
3735 ; CHECK-NEXT: cmp r8, #-2147483648
3736 ; CHECK-NEXT: mov r6, #0
3737 ; CHECK-NEXT: movhi r6, r4
3738 ; CHECK-NEXT: moveq r6, r4
3739 ; CHECK-NEXT: cmn r10, #1
3740 ; CHECK-NEXT: movle r4, r12
3741 ; CHECK-NEXT: cmn r5, #1
3742 ; CHECK-NEXT: moveq r4, r6
3743 ; CHECK-NEXT: cmp r3, #0
3744 ; CHECK-NEXT: mov r6, #0
3745 ; CHECK-NEXT: vmov.32 d1[0], r4
3746 ; CHECK-NEXT: movmi r6, r3
3747 ; CHECK-NEXT: cmn r6, #1
3748 ; CHECK-NEXT: movle r0, r12
3749 ; CHECK-NEXT: cmp r3, #0
3750 ; CHECK-NEXT: andne r3, r2, r3, asr #31
3751 ; CHECK-NEXT: and r2, r3, r6
3752 ; CHECK-NEXT: cmn r2, #1
3753 ; CHECK-NEXT: moveq r0, r1
3754 ; CHECK-NEXT: cmn r6, #1
3755 ; CHECK-NEXT: mov r1, #-2147483648
3756 ; CHECK-NEXT: vmov.32 d0[0], r0
3757 ; CHECK-NEXT: movgt r1, r7
3758 ; CHECK-NEXT: cmp r7, #-2147483648
3759 ; CHECK-NEXT: mov r0, #-2147483648
3760 ; CHECK-NEXT: vmov.32 d1[1], r9
3761 ; CHECK-NEXT: movls r7, r0
3762 ; CHECK-NEXT: cmn r2, #1
3763 ; CHECK-NEXT: movne r7, r1
3764 ; CHECK-NEXT: vmov.32 d0[1], r7
3765 ; CHECK-NEXT: add sp, sp, #16
3766 ; CHECK-NEXT: vpop {d8, d9}
3767 ; CHECK-NEXT: add sp, sp, #4
3768 ; CHECK-NEXT: pop {r4, r5, r6, r7, r8, r9, r10, r11, pc}
3770 %conv = fptosi <2 x double> %x to <2 x i128>
3771 %spec.store.select = call <2 x i128> @llvm.smin.v2i128(<2 x i128> %conv, <2 x i128> <i128 9223372036854775807, i128 9223372036854775807>)
3772 %spec.store.select7 = call <2 x i128> @llvm.smax.v2i128(<2 x i128> %spec.store.select, <2 x i128> <i128 -9223372036854775808, i128 -9223372036854775808>)
3773 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
3774 ret <2 x i64> %conv6
3777 define <2 x i64> @utest_f64i64_mm(<2 x double> %x) {
3778 ; CHECK-LABEL: utest_f64i64_mm:
3779 ; CHECK: @ %bb.0: @ %entry
3780 ; CHECK-NEXT: .save {r4, r5, r6, r7, r11, lr}
3781 ; CHECK-NEXT: push {r4, r5, r6, r7, r11, lr}
3782 ; CHECK-NEXT: .vsave {d8, d9}
3783 ; CHECK-NEXT: vpush {d8, d9}
3784 ; CHECK-NEXT: vorr q4, q0, q0
3785 ; CHECK-NEXT: vorr d0, d9, d9
3786 ; CHECK-NEXT: bl __fixunsdfti
3787 ; CHECK-NEXT: mov r7, r1
3788 ; CHECK-NEXT: eor r1, r2, #1
3789 ; CHECK-NEXT: subs r2, r2, #1
3790 ; CHECK-NEXT: mov r6, #0
3791 ; CHECK-NEXT: sbcs r2, r3, #0
3792 ; CHECK-NEXT: orr r1, r1, r3
3793 ; CHECK-NEXT: movwlo r6, #1
3794 ; CHECK-NEXT: cmp r6, #0
3795 ; CHECK-NEXT: moveq r7, r6
3796 ; CHECK-NEXT: cmp r1, #0
3797 ; CHECK-NEXT: vorr d0, d8, d8
3798 ; CHECK-NEXT: moveq r7, r1
3799 ; CHECK-NEXT: cmp r6, #0
3800 ; CHECK-NEXT: mov r5, #0
3801 ; CHECK-NEXT: movne r6, r0
3802 ; CHECK-NEXT: cmp r1, #0
3803 ; CHECK-NEXT: moveq r6, r1
3804 ; CHECK-NEXT: bl __fixunsdfti
3805 ; CHECK-NEXT: eor r4, r2, #1
3806 ; CHECK-NEXT: subs r2, r2, #1
3807 ; CHECK-NEXT: sbcs r2, r3, #0
3808 ; CHECK-NEXT: orr r4, r4, r3
3809 ; CHECK-NEXT: movwlo r5, #1
3810 ; CHECK-NEXT: cmp r5, #0
3811 ; CHECK-NEXT: moveq r0, r5
3812 ; CHECK-NEXT: cmp r4, #0
3813 ; CHECK-NEXT: moveq r0, r4
3814 ; CHECK-NEXT: vmov.32 d1[0], r6
3815 ; CHECK-NEXT: cmp r5, #0
3816 ; CHECK-NEXT: vmov.32 d0[0], r0
3817 ; CHECK-NEXT: movne r5, r1
3818 ; CHECK-NEXT: cmp r4, #0
3819 ; CHECK-NEXT: vmov.32 d1[1], r7
3820 ; CHECK-NEXT: moveq r5, r4
3821 ; CHECK-NEXT: vmov.32 d0[1], r5
3822 ; CHECK-NEXT: vpop {d8, d9}
3823 ; CHECK-NEXT: pop {r4, r5, r6, r7, r11, pc}
3825 %conv = fptoui <2 x double> %x to <2 x i128>
3826 %spec.store.select = call <2 x i128> @llvm.umin.v2i128(<2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>)
3827 %conv6 = trunc <2 x i128> %spec.store.select to <2 x i64>
3828 ret <2 x i64> %conv6
3831 define <2 x i64> @ustest_f64i64_mm(<2 x double> %x) {
3832 ; CHECK-LABEL: ustest_f64i64_mm:
3833 ; CHECK: @ %bb.0: @ %entry
3834 ; CHECK-NEXT: .save {r4, r5, r6, r7, r8, r9, r10, r11, lr}
3835 ; CHECK-NEXT: push {r4, r5, r6, r7, r8, r9, r10, r11, lr}
3836 ; CHECK-NEXT: .pad #4
3837 ; CHECK-NEXT: sub sp, sp, #4
3838 ; CHECK-NEXT: .vsave {d8, d9}
3839 ; CHECK-NEXT: vpush {d8, d9}
3840 ; CHECK-NEXT: vorr q4, q0, q0
3841 ; CHECK-NEXT: bl __fixdfti
3842 ; CHECK-NEXT: subs r7, r2, #1
3843 ; CHECK-NEXT: mov r10, r0
3844 ; CHECK-NEXT: eor r0, r2, #1
3845 ; CHECK-NEXT: sbcs r7, r3, #0
3846 ; CHECK-NEXT: mov r5, #0
3847 ; CHECK-NEXT: orr r0, r0, r3
3848 ; CHECK-NEXT: movwlt r5, #1
3849 ; CHECK-NEXT: cmp r5, #0
3850 ; CHECK-NEXT: moveq r10, r5
3851 ; CHECK-NEXT: cmp r0, #0
3852 ; CHECK-NEXT: moveq r10, r0
3853 ; CHECK-NEXT: cmp r5, #0
3854 ; CHECK-NEXT: movne r5, r1
3855 ; CHECK-NEXT: cmp r0, #0
3856 ; CHECK-NEXT: moveq r5, r0
3857 ; CHECK-NEXT: cmp r5, #0
3858 ; CHECK-NEXT: mov r0, r5
3859 ; CHECK-NEXT: mov r1, #1
3860 ; CHECK-NEXT: movne r0, r10
3861 ; CHECK-NEXT: mov r8, #1
3862 ; CHECK-NEXT: moveq r0, r10
3863 ; CHECK-NEXT: cmp r2, #1
3864 ; CHECK-NEXT: movlo r1, r2
3865 ; CHECK-NEXT: cmp r3, #0
3866 ; CHECK-NEXT: movpl r2, r8
3867 ; CHECK-NEXT: mov r11, #0
3868 ; CHECK-NEXT: moveq r2, r1
3869 ; CHECK-NEXT: movpl r3, r11
3870 ; CHECK-NEXT: rsbs r1, r2, #0
3871 ; CHECK-NEXT: vorr d0, d9, d9
3872 ; CHECK-NEXT: rscs r1, r3, #0
3873 ; CHECK-NEXT: mov r7, #0
3874 ; CHECK-NEXT: movwlt r7, #1
3875 ; CHECK-NEXT: cmp r7, #0
3876 ; CHECK-NEXT: moveq r10, r7
3877 ; CHECK-NEXT: orrs r9, r2, r3
3878 ; CHECK-NEXT: moveq r10, r0
3879 ; CHECK-NEXT: bl __fixdfti
3880 ; CHECK-NEXT: eor r4, r2, #1
3881 ; CHECK-NEXT: orr r6, r4, r3
3882 ; CHECK-NEXT: subs r4, r2, #1
3883 ; CHECK-NEXT: sbcs r4, r3, #0
3884 ; CHECK-NEXT: mov r4, #0
3885 ; CHECK-NEXT: movwlt r4, #1
3886 ; CHECK-NEXT: cmp r4, #0
3887 ; CHECK-NEXT: moveq r0, r4
3888 ; CHECK-NEXT: cmp r6, #0
3889 ; CHECK-NEXT: moveq r0, r6
3890 ; CHECK-NEXT: cmp r4, #0
3891 ; CHECK-NEXT: movne r4, r1
3892 ; CHECK-NEXT: cmp r6, #0
3893 ; CHECK-NEXT: moveq r4, r6
3894 ; CHECK-NEXT: cmp r4, #0
3895 ; CHECK-NEXT: mov r1, r4
3896 ; CHECK-NEXT: mov r6, #1
3897 ; CHECK-NEXT: movne r1, r0
3898 ; CHECK-NEXT: moveq r1, r0
3899 ; CHECK-NEXT: cmp r2, #1
3900 ; CHECK-NEXT: movlo r6, r2
3901 ; CHECK-NEXT: cmp r3, #0
3902 ; CHECK-NEXT: movmi r8, r2
3903 ; CHECK-NEXT: movpl r3, r11
3904 ; CHECK-NEXT: moveq r8, r6
3905 ; CHECK-NEXT: rsbs r2, r8, #0
3906 ; CHECK-NEXT: rscs r2, r3, #0
3907 ; CHECK-NEXT: movwlt r11, #1
3908 ; CHECK-NEXT: cmp r11, #0
3909 ; CHECK-NEXT: moveq r0, r11
3910 ; CHECK-NEXT: orrs r2, r8, r3
3911 ; CHECK-NEXT: moveq r0, r1
3912 ; CHECK-NEXT: cmp r11, #0
3913 ; CHECK-NEXT: movne r11, r4
3914 ; CHECK-NEXT: cmp r2, #0
3915 ; CHECK-NEXT: vmov.32 d1[0], r0
3916 ; CHECK-NEXT: moveq r11, r4
3917 ; CHECK-NEXT: cmp r7, #0
3918 ; CHECK-NEXT: vmov.32 d0[0], r10
3919 ; CHECK-NEXT: movne r7, r5
3920 ; CHECK-NEXT: cmp r9, #0
3921 ; CHECK-NEXT: vmov.32 d1[1], r11
3922 ; CHECK-NEXT: moveq r7, r5
3923 ; CHECK-NEXT: vmov.32 d0[1], r7
3924 ; CHECK-NEXT: vpop {d8, d9}
3925 ; CHECK-NEXT: add sp, sp, #4
3926 ; CHECK-NEXT: pop {r4, r5, r6, r7, r8, r9, r10, r11, pc}
3928 %conv = fptosi <2 x double> %x to <2 x i128>
3929 %spec.store.select = call <2 x i128> @llvm.smin.v2i128(<2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>)
3930 %spec.store.select7 = call <2 x i128> @llvm.smax.v2i128(<2 x i128> %spec.store.select, <2 x i128> zeroinitializer)
3931 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
3932 ret <2 x i64> %conv6
3935 define <2 x i64> @stest_f32i64_mm(<2 x float> %x) {
3936 ; CHECK-LABEL: stest_f32i64_mm:
3937 ; CHECK: @ %bb.0: @ %entry
3938 ; CHECK-NEXT: .save {r4, r5, r6, r7, r8, r9, r10, r11, lr}
3939 ; CHECK-NEXT: push {r4, r5, r6, r7, r8, r9, r10, r11, lr}
3940 ; CHECK-NEXT: .pad #4
3941 ; CHECK-NEXT: sub sp, sp, #4
3942 ; CHECK-NEXT: .vsave {d8}
3943 ; CHECK-NEXT: vpush {d8}
3944 ; CHECK-NEXT: .pad #16
3945 ; CHECK-NEXT: sub sp, sp, #16
3946 ; CHECK-NEXT: vmov.f64 d8, d0
3947 ; CHECK-NEXT: vmov.f32 s0, s17
3948 ; CHECK-NEXT: bl __fixsfti
3949 ; CHECK-NEXT: str r0, [sp, #12] @ 4-byte Spill
3950 ; CHECK-NEXT: cmp r3, #0
3951 ; CHECK-NEXT: mov r0, r3
3952 ; CHECK-NEXT: mov r10, #0
3953 ; CHECK-NEXT: vmov.f32 s0, s16
3954 ; CHECK-NEXT: andne r0, r2, r0, asr #31
3955 ; CHECK-NEXT: mov r11, r1
3956 ; CHECK-NEXT: movmi r10, r3
3957 ; CHECK-NEXT: and r1, r0, r10
3958 ; CHECK-NEXT: cmn r11, #-2147483647
3959 ; CHECK-NEXT: mvn r0, #-2147483648
3960 ; CHECK-NEXT: mvn r8, #-2147483648
3961 ; CHECK-NEXT: movlo r0, r11
3962 ; CHECK-NEXT: cmp r3, #0
3963 ; CHECK-NEXT: movmi r8, r11
3964 ; CHECK-NEXT: orrs r2, r2, r3
3965 ; CHECK-NEXT: moveq r8, r0
3966 ; CHECK-NEXT: cmn r10, #1
3967 ; CHECK-NEXT: mov r0, #-2147483648
3968 ; CHECK-NEXT: mov r9, #-2147483648
3969 ; CHECK-NEXT: movgt r0, r8
3970 ; CHECK-NEXT: cmp r8, #-2147483648
3971 ; CHECK-NEXT: movhi r9, r8
3972 ; CHECK-NEXT: cmn r1, #1
3973 ; CHECK-NEXT: mov r6, r3
3974 ; CHECK-NEXT: str r1, [sp, #8] @ 4-byte Spill
3975 ; CHECK-NEXT: mvn r7, #-2147483648
3976 ; CHECK-NEXT: str r2, [sp, #4] @ 4-byte Spill
3977 ; CHECK-NEXT: movne r9, r0
3978 ; CHECK-NEXT: bl __fixsfti
3979 ; CHECK-NEXT: cmn r1, #-2147483647
3980 ; CHECK-NEXT: mvn r5, #0
3981 ; CHECK-NEXT: movlo r5, r0
3982 ; CHECK-NEXT: mvn r4, #0
3983 ; CHECK-NEXT: moveq r5, r0
3984 ; CHECK-NEXT: cmp r3, #0
3985 ; CHECK-NEXT: movpl r0, r4
3986 ; CHECK-NEXT: orrs r12, r2, r3
3987 ; CHECK-NEXT: moveq r0, r5
3988 ; CHECK-NEXT: cmn r1, #-2147483647
3989 ; CHECK-NEXT: mvn r5, #-2147483648
3990 ; CHECK-NEXT: movlo r5, r1
3991 ; CHECK-NEXT: cmp r3, #0
3992 ; CHECK-NEXT: movmi r7, r1
3993 ; CHECK-NEXT: cmp r12, #0
3994 ; CHECK-NEXT: moveq r7, r5
3995 ; CHECK-NEXT: cmp r7, #-2147483648
3996 ; CHECK-NEXT: mov r1, #0
3997 ; CHECK-NEXT: ldr r5, [sp, #12] @ 4-byte Reload
3998 ; CHECK-NEXT: movhi r1, r0
3999 ; CHECK-NEXT: mov r12, #0
4000 ; CHECK-NEXT: moveq r1, r0
4001 ; CHECK-NEXT: cmp r6, #0
4002 ; CHECK-NEXT: mvn r6, #0
4003 ; CHECK-NEXT: movmi r6, r5
4004 ; CHECK-NEXT: cmn r11, #-2147483647
4005 ; CHECK-NEXT: movlo r4, r5
4006 ; CHECK-NEXT: moveq r4, r5
4007 ; CHECK-NEXT: ldr r5, [sp, #4] @ 4-byte Reload
4008 ; CHECK-NEXT: cmp r5, #0
4009 ; CHECK-NEXT: ldr r5, [sp, #8] @ 4-byte Reload
4010 ; CHECK-NEXT: movne r4, r6
4011 ; CHECK-NEXT: cmp r8, #-2147483648
4012 ; CHECK-NEXT: mov r6, #0
4013 ; CHECK-NEXT: movhi r6, r4
4014 ; CHECK-NEXT: moveq r6, r4
4015 ; CHECK-NEXT: cmn r10, #1
4016 ; CHECK-NEXT: movle r4, r12
4017 ; CHECK-NEXT: cmn r5, #1
4018 ; CHECK-NEXT: moveq r4, r6
4019 ; CHECK-NEXT: cmp r3, #0
4020 ; CHECK-NEXT: mov r6, #0
4021 ; CHECK-NEXT: vmov.32 d1[0], r4
4022 ; CHECK-NEXT: movmi r6, r3
4023 ; CHECK-NEXT: cmn r6, #1
4024 ; CHECK-NEXT: movle r0, r12
4025 ; CHECK-NEXT: cmp r3, #0
4026 ; CHECK-NEXT: andne r3, r2, r3, asr #31
4027 ; CHECK-NEXT: and r2, r3, r6
4028 ; CHECK-NEXT: cmn r2, #1
4029 ; CHECK-NEXT: moveq r0, r1
4030 ; CHECK-NEXT: cmn r6, #1
4031 ; CHECK-NEXT: mov r1, #-2147483648
4032 ; CHECK-NEXT: vmov.32 d0[0], r0
4033 ; CHECK-NEXT: movgt r1, r7
4034 ; CHECK-NEXT: cmp r7, #-2147483648
4035 ; CHECK-NEXT: mov r0, #-2147483648
4036 ; CHECK-NEXT: vmov.32 d1[1], r9
4037 ; CHECK-NEXT: movls r7, r0
4038 ; CHECK-NEXT: cmn r2, #1
4039 ; CHECK-NEXT: movne r7, r1
4040 ; CHECK-NEXT: vmov.32 d0[1], r7
4041 ; CHECK-NEXT: add sp, sp, #16
4042 ; CHECK-NEXT: vpop {d8}
4043 ; CHECK-NEXT: add sp, sp, #4
4044 ; CHECK-NEXT: pop {r4, r5, r6, r7, r8, r9, r10, r11, pc}
4046 %conv = fptosi <2 x float> %x to <2 x i128>
4047 %spec.store.select = call <2 x i128> @llvm.smin.v2i128(<2 x i128> %conv, <2 x i128> <i128 9223372036854775807, i128 9223372036854775807>)
4048 %spec.store.select7 = call <2 x i128> @llvm.smax.v2i128(<2 x i128> %spec.store.select, <2 x i128> <i128 -9223372036854775808, i128 -9223372036854775808>)
4049 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
4050 ret <2 x i64> %conv6
4053 define <2 x i64> @utest_f32i64_mm(<2 x float> %x) {
4054 ; CHECK-LABEL: utest_f32i64_mm:
4055 ; CHECK: @ %bb.0: @ %entry
4056 ; CHECK-NEXT: .save {r4, r5, r6, r7, r11, lr}
4057 ; CHECK-NEXT: push {r4, r5, r6, r7, r11, lr}
4058 ; CHECK-NEXT: .vsave {d8}
4059 ; CHECK-NEXT: vpush {d8}
4060 ; CHECK-NEXT: vmov.f64 d8, d0
4061 ; CHECK-NEXT: vmov.f32 s0, s17
4062 ; CHECK-NEXT: bl __fixunssfti
4063 ; CHECK-NEXT: vmov.f32 s0, s16
4064 ; CHECK-NEXT: mov r7, r1
4065 ; CHECK-NEXT: eor r1, r2, #1
4066 ; CHECK-NEXT: subs r2, r2, #1
4067 ; CHECK-NEXT: sbcs r2, r3, #0
4068 ; CHECK-NEXT: mov r6, #0
4069 ; CHECK-NEXT: movwlo r6, #1
4070 ; CHECK-NEXT: cmp r6, #0
4071 ; CHECK-NEXT: orr r1, r1, r3
4072 ; CHECK-NEXT: moveq r7, r6
4073 ; CHECK-NEXT: cmp r1, #0
4074 ; CHECK-NEXT: mov r5, #0
4075 ; CHECK-NEXT: moveq r7, r1
4076 ; CHECK-NEXT: cmp r6, #0
4077 ; CHECK-NEXT: movne r6, r0
4078 ; CHECK-NEXT: cmp r1, #0
4079 ; CHECK-NEXT: moveq r6, r1
4080 ; CHECK-NEXT: bl __fixunssfti
4081 ; CHECK-NEXT: eor r4, r2, #1
4082 ; CHECK-NEXT: subs r2, r2, #1
4083 ; CHECK-NEXT: sbcs r2, r3, #0
4084 ; CHECK-NEXT: orr r4, r4, r3
4085 ; CHECK-NEXT: movwlo r5, #1
4086 ; CHECK-NEXT: cmp r5, #0
4087 ; CHECK-NEXT: moveq r0, r5
4088 ; CHECK-NEXT: cmp r4, #0
4089 ; CHECK-NEXT: moveq r0, r4
4090 ; CHECK-NEXT: vmov.32 d1[0], r6
4091 ; CHECK-NEXT: cmp r5, #0
4092 ; CHECK-NEXT: vmov.32 d0[0], r0
4093 ; CHECK-NEXT: movne r5, r1
4094 ; CHECK-NEXT: cmp r4, #0
4095 ; CHECK-NEXT: vmov.32 d1[1], r7
4096 ; CHECK-NEXT: moveq r5, r4
4097 ; CHECK-NEXT: vmov.32 d0[1], r5
4098 ; CHECK-NEXT: vpop {d8}
4099 ; CHECK-NEXT: pop {r4, r5, r6, r7, r11, pc}
4101 %conv = fptoui <2 x float> %x to <2 x i128>
4102 %spec.store.select = call <2 x i128> @llvm.umin.v2i128(<2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>)
4103 %conv6 = trunc <2 x i128> %spec.store.select to <2 x i64>
4104 ret <2 x i64> %conv6
4107 define <2 x i64> @ustest_f32i64_mm(<2 x float> %x) {
4108 ; CHECK-LABEL: ustest_f32i64_mm:
4109 ; CHECK: @ %bb.0: @ %entry
4110 ; CHECK-NEXT: .save {r4, r5, r6, r7, r8, r9, r10, r11, lr}
4111 ; CHECK-NEXT: push {r4, r5, r6, r7, r8, r9, r10, r11, lr}
4112 ; CHECK-NEXT: .pad #4
4113 ; CHECK-NEXT: sub sp, sp, #4
4114 ; CHECK-NEXT: .vsave {d8}
4115 ; CHECK-NEXT: vpush {d8}
4116 ; CHECK-NEXT: vmov.f64 d8, d0
4117 ; CHECK-NEXT: bl __fixsfti
4118 ; CHECK-NEXT: subs r7, r2, #1
4119 ; CHECK-NEXT: mov r10, r0
4120 ; CHECK-NEXT: eor r0, r2, #1
4121 ; CHECK-NEXT: sbcs r7, r3, #0
4122 ; CHECK-NEXT: mov r5, #0
4123 ; CHECK-NEXT: orr r0, r0, r3
4124 ; CHECK-NEXT: movwlt r5, #1
4125 ; CHECK-NEXT: cmp r5, #0
4126 ; CHECK-NEXT: moveq r10, r5
4127 ; CHECK-NEXT: cmp r0, #0
4128 ; CHECK-NEXT: moveq r10, r0
4129 ; CHECK-NEXT: cmp r5, #0
4130 ; CHECK-NEXT: movne r5, r1
4131 ; CHECK-NEXT: cmp r0, #0
4132 ; CHECK-NEXT: moveq r5, r0
4133 ; CHECK-NEXT: cmp r5, #0
4134 ; CHECK-NEXT: mov r0, r5
4135 ; CHECK-NEXT: vmov.f32 s0, s17
4136 ; CHECK-NEXT: movne r0, r10
4137 ; CHECK-NEXT: mov r1, #1
4138 ; CHECK-NEXT: moveq r0, r10
4139 ; CHECK-NEXT: cmp r2, #1
4140 ; CHECK-NEXT: movlo r1, r2
4141 ; CHECK-NEXT: mov r8, #1
4142 ; CHECK-NEXT: cmp r3, #0
4143 ; CHECK-NEXT: mov r11, #0
4144 ; CHECK-NEXT: movpl r2, r8
4145 ; CHECK-NEXT: movpl r3, r11
4146 ; CHECK-NEXT: moveq r2, r1
4147 ; CHECK-NEXT: rsbs r1, r2, #0
4148 ; CHECK-NEXT: rscs r1, r3, #0
4149 ; CHECK-NEXT: mov r7, #0
4150 ; CHECK-NEXT: movwlt r7, #1
4151 ; CHECK-NEXT: cmp r7, #0
4152 ; CHECK-NEXT: moveq r10, r7
4153 ; CHECK-NEXT: orrs r9, r2, r3
4154 ; CHECK-NEXT: moveq r10, r0
4155 ; CHECK-NEXT: bl __fixsfti
4156 ; CHECK-NEXT: eor r4, r2, #1
4157 ; CHECK-NEXT: orr r6, r4, r3
4158 ; CHECK-NEXT: subs r4, r2, #1
4159 ; CHECK-NEXT: sbcs r4, r3, #0
4160 ; CHECK-NEXT: mov r4, #0
4161 ; CHECK-NEXT: movwlt r4, #1
4162 ; CHECK-NEXT: cmp r4, #0
4163 ; CHECK-NEXT: moveq r0, r4
4164 ; CHECK-NEXT: cmp r6, #0
4165 ; CHECK-NEXT: moveq r0, r6
4166 ; CHECK-NEXT: cmp r4, #0
4167 ; CHECK-NEXT: movne r4, r1
4168 ; CHECK-NEXT: cmp r6, #0
4169 ; CHECK-NEXT: moveq r4, r6
4170 ; CHECK-NEXT: cmp r4, #0
4171 ; CHECK-NEXT: mov r1, r4
4172 ; CHECK-NEXT: mov r6, #1
4173 ; CHECK-NEXT: movne r1, r0
4174 ; CHECK-NEXT: moveq r1, r0
4175 ; CHECK-NEXT: cmp r2, #1
4176 ; CHECK-NEXT: movlo r6, r2
4177 ; CHECK-NEXT: cmp r3, #0
4178 ; CHECK-NEXT: movmi r8, r2
4179 ; CHECK-NEXT: movpl r3, r11
4180 ; CHECK-NEXT: moveq r8, r6
4181 ; CHECK-NEXT: rsbs r2, r8, #0
4182 ; CHECK-NEXT: rscs r2, r3, #0
4183 ; CHECK-NEXT: movwlt r11, #1
4184 ; CHECK-NEXT: cmp r11, #0
4185 ; CHECK-NEXT: moveq r0, r11
4186 ; CHECK-NEXT: orrs r2, r8, r3
4187 ; CHECK-NEXT: moveq r0, r1
4188 ; CHECK-NEXT: cmp r11, #0
4189 ; CHECK-NEXT: movne r11, r4
4190 ; CHECK-NEXT: cmp r2, #0
4191 ; CHECK-NEXT: vmov.32 d1[0], r0
4192 ; CHECK-NEXT: moveq r11, r4
4193 ; CHECK-NEXT: cmp r7, #0
4194 ; CHECK-NEXT: vmov.32 d0[0], r10
4195 ; CHECK-NEXT: movne r7, r5
4196 ; CHECK-NEXT: cmp r9, #0
4197 ; CHECK-NEXT: vmov.32 d1[1], r11
4198 ; CHECK-NEXT: moveq r7, r5
4199 ; CHECK-NEXT: vmov.32 d0[1], r7
4200 ; CHECK-NEXT: vpop {d8}
4201 ; CHECK-NEXT: add sp, sp, #4
4202 ; CHECK-NEXT: pop {r4, r5, r6, r7, r8, r9, r10, r11, pc}
4204 %conv = fptosi <2 x float> %x to <2 x i128>
4205 %spec.store.select = call <2 x i128> @llvm.smin.v2i128(<2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>)
4206 %spec.store.select7 = call <2 x i128> @llvm.smax.v2i128(<2 x i128> %spec.store.select, <2 x i128> zeroinitializer)
4207 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
4208 ret <2 x i64> %conv6
4211 define <2 x i64> @stest_f16i64_mm(<2 x half> %x) {
4212 ; CHECK-NEON-LABEL: stest_f16i64_mm:
4213 ; CHECK-NEON: @ %bb.0: @ %entry
4214 ; CHECK-NEON-NEXT: .save {r4, r5, r6, r7, r8, r9, r10, r11, lr}
4215 ; CHECK-NEON-NEXT: push {r4, r5, r6, r7, r8, r9, r10, r11, lr}
4216 ; CHECK-NEON-NEXT: .pad #4
4217 ; CHECK-NEON-NEXT: sub sp, sp, #4
4218 ; CHECK-NEON-NEXT: .vsave {d8}
4219 ; CHECK-NEON-NEXT: vpush {d8}
4220 ; CHECK-NEON-NEXT: .pad #16
4221 ; CHECK-NEON-NEXT: sub sp, sp, #16
4222 ; CHECK-NEON-NEXT: vmov r0, s1
4223 ; CHECK-NEON-NEXT: vmov.f32 s16, s0
4224 ; CHECK-NEON-NEXT: bl __aeabi_h2f
4225 ; CHECK-NEON-NEXT: vmov s0, r0
4226 ; CHECK-NEON-NEXT: bl __fixsfti
4227 ; CHECK-NEON-NEXT: str r0, [sp, #12] @ 4-byte Spill
4228 ; CHECK-NEON-NEXT: cmp r3, #0
4229 ; CHECK-NEON-NEXT: mov r0, r3
4230 ; CHECK-NEON-NEXT: mov r10, #0
4231 ; CHECK-NEON-NEXT: andne r0, r2, r0, asr #31
4232 ; CHECK-NEON-NEXT: mov r11, r1
4233 ; CHECK-NEON-NEXT: movmi r10, r3
4234 ; CHECK-NEON-NEXT: and r1, r0, r10
4235 ; CHECK-NEON-NEXT: cmn r11, #-2147483647
4236 ; CHECK-NEON-NEXT: mvn r0, #-2147483648
4237 ; CHECK-NEON-NEXT: movlo r0, r11
4238 ; CHECK-NEON-NEXT: cmp r3, #0
4239 ; CHECK-NEON-NEXT: mvn r8, #-2147483648
4240 ; CHECK-NEON-NEXT: mov r9, #-2147483648
4241 ; CHECK-NEON-NEXT: movmi r8, r11
4242 ; CHECK-NEON-NEXT: orrs r2, r2, r3
4243 ; CHECK-NEON-NEXT: moveq r8, r0
4244 ; CHECK-NEON-NEXT: cmn r10, #1
4245 ; CHECK-NEON-NEXT: mov r0, #-2147483648
4246 ; CHECK-NEON-NEXT: mov r6, r3
4247 ; CHECK-NEON-NEXT: movgt r0, r8
4248 ; CHECK-NEON-NEXT: cmp r8, #-2147483648
4249 ; CHECK-NEON-NEXT: movhi r9, r8
4250 ; CHECK-NEON-NEXT: cmn r1, #1
4251 ; CHECK-NEON-NEXT: movne r9, r0
4252 ; CHECK-NEON-NEXT: vmov r0, s16
4253 ; CHECK-NEON-NEXT: str r1, [sp, #8] @ 4-byte Spill
4254 ; CHECK-NEON-NEXT: mvn r7, #-2147483648
4255 ; CHECK-NEON-NEXT: str r2, [sp, #4] @ 4-byte Spill
4256 ; CHECK-NEON-NEXT: bl __aeabi_h2f
4257 ; CHECK-NEON-NEXT: vmov s0, r0
4258 ; CHECK-NEON-NEXT: bl __fixsfti
4259 ; CHECK-NEON-NEXT: cmn r1, #-2147483647
4260 ; CHECK-NEON-NEXT: mvn r5, #0
4261 ; CHECK-NEON-NEXT: movlo r5, r0
4262 ; CHECK-NEON-NEXT: mvn r4, #0
4263 ; CHECK-NEON-NEXT: moveq r5, r0
4264 ; CHECK-NEON-NEXT: cmp r3, #0
4265 ; CHECK-NEON-NEXT: movpl r0, r4
4266 ; CHECK-NEON-NEXT: orrs r12, r2, r3
4267 ; CHECK-NEON-NEXT: moveq r0, r5
4268 ; CHECK-NEON-NEXT: cmn r1, #-2147483647
4269 ; CHECK-NEON-NEXT: mvn r5, #-2147483648
4270 ; CHECK-NEON-NEXT: movlo r5, r1
4271 ; CHECK-NEON-NEXT: cmp r3, #0
4272 ; CHECK-NEON-NEXT: movmi r7, r1
4273 ; CHECK-NEON-NEXT: cmp r12, #0
4274 ; CHECK-NEON-NEXT: moveq r7, r5
4275 ; CHECK-NEON-NEXT: cmp r7, #-2147483648
4276 ; CHECK-NEON-NEXT: mov r1, #0
4277 ; CHECK-NEON-NEXT: ldr r5, [sp, #12] @ 4-byte Reload
4278 ; CHECK-NEON-NEXT: movhi r1, r0
4279 ; CHECK-NEON-NEXT: mov r12, #0
4280 ; CHECK-NEON-NEXT: moveq r1, r0
4281 ; CHECK-NEON-NEXT: cmp r6, #0
4282 ; CHECK-NEON-NEXT: mvn r6, #0
4283 ; CHECK-NEON-NEXT: movmi r6, r5
4284 ; CHECK-NEON-NEXT: cmn r11, #-2147483647
4285 ; CHECK-NEON-NEXT: movlo r4, r5
4286 ; CHECK-NEON-NEXT: moveq r4, r5
4287 ; CHECK-NEON-NEXT: ldr r5, [sp, #4] @ 4-byte Reload
4288 ; CHECK-NEON-NEXT: cmp r5, #0
4289 ; CHECK-NEON-NEXT: ldr r5, [sp, #8] @ 4-byte Reload
4290 ; CHECK-NEON-NEXT: movne r4, r6
4291 ; CHECK-NEON-NEXT: cmp r8, #-2147483648
4292 ; CHECK-NEON-NEXT: mov r6, #0
4293 ; CHECK-NEON-NEXT: movhi r6, r4
4294 ; CHECK-NEON-NEXT: moveq r6, r4
4295 ; CHECK-NEON-NEXT: cmn r10, #1
4296 ; CHECK-NEON-NEXT: movle r4, r12
4297 ; CHECK-NEON-NEXT: cmn r5, #1
4298 ; CHECK-NEON-NEXT: moveq r4, r6
4299 ; CHECK-NEON-NEXT: cmp r3, #0
4300 ; CHECK-NEON-NEXT: mov r6, #0
4301 ; CHECK-NEON-NEXT: vmov.32 d1[0], r4
4302 ; CHECK-NEON-NEXT: movmi r6, r3
4303 ; CHECK-NEON-NEXT: cmn r6, #1
4304 ; CHECK-NEON-NEXT: movle r0, r12
4305 ; CHECK-NEON-NEXT: cmp r3, #0
4306 ; CHECK-NEON-NEXT: andne r3, r2, r3, asr #31
4307 ; CHECK-NEON-NEXT: and r2, r3, r6
4308 ; CHECK-NEON-NEXT: cmn r2, #1
4309 ; CHECK-NEON-NEXT: moveq r0, r1
4310 ; CHECK-NEON-NEXT: cmn r6, #1
4311 ; CHECK-NEON-NEXT: mov r1, #-2147483648
4312 ; CHECK-NEON-NEXT: vmov.32 d0[0], r0
4313 ; CHECK-NEON-NEXT: movgt r1, r7
4314 ; CHECK-NEON-NEXT: cmp r7, #-2147483648
4315 ; CHECK-NEON-NEXT: mov r0, #-2147483648
4316 ; CHECK-NEON-NEXT: vmov.32 d1[1], r9
4317 ; CHECK-NEON-NEXT: movls r7, r0
4318 ; CHECK-NEON-NEXT: cmn r2, #1
4319 ; CHECK-NEON-NEXT: movne r7, r1
4320 ; CHECK-NEON-NEXT: vmov.32 d0[1], r7
4321 ; CHECK-NEON-NEXT: add sp, sp, #16
4322 ; CHECK-NEON-NEXT: vpop {d8}
4323 ; CHECK-NEON-NEXT: add sp, sp, #4
4324 ; CHECK-NEON-NEXT: pop {r4, r5, r6, r7, r8, r9, r10, r11, pc}
4326 ; CHECK-FP16-LABEL: stest_f16i64_mm:
4327 ; CHECK-FP16: @ %bb.0: @ %entry
4328 ; CHECK-FP16-NEXT: .save {r4, r5, r6, r7, r8, r9, r10, r11, lr}
4329 ; CHECK-FP16-NEXT: push {r4, r5, r6, r7, r8, r9, r10, r11, lr}
4330 ; CHECK-FP16-NEXT: .pad #4
4331 ; CHECK-FP16-NEXT: sub sp, sp, #4
4332 ; CHECK-FP16-NEXT: .vsave {d8}
4333 ; CHECK-FP16-NEXT: vpush {d8}
4334 ; CHECK-FP16-NEXT: .pad #16
4335 ; CHECK-FP16-NEXT: sub sp, sp, #16
4336 ; CHECK-FP16-NEXT: vmov.u16 r0, d0[1]
4337 ; CHECK-FP16-NEXT: vorr d8, d0, d0
4338 ; CHECK-FP16-NEXT: vmov s0, r0
4339 ; CHECK-FP16-NEXT: bl __fixhfti
4340 ; CHECK-FP16-NEXT: str r0, [sp, #12] @ 4-byte Spill
4341 ; CHECK-FP16-NEXT: cmp r3, #0
4342 ; CHECK-FP16-NEXT: mov r0, r3
4343 ; CHECK-FP16-NEXT: mov r10, #0
4344 ; CHECK-FP16-NEXT: andne r0, r2, r0, asr #31
4345 ; CHECK-FP16-NEXT: mov r11, r1
4346 ; CHECK-FP16-NEXT: movmi r10, r3
4347 ; CHECK-FP16-NEXT: and r1, r0, r10
4348 ; CHECK-FP16-NEXT: cmn r11, #-2147483647
4349 ; CHECK-FP16-NEXT: mvn r0, #-2147483648
4350 ; CHECK-FP16-NEXT: movlo r0, r11
4351 ; CHECK-FP16-NEXT: cmp r3, #0
4352 ; CHECK-FP16-NEXT: mvn r8, #-2147483648
4353 ; CHECK-FP16-NEXT: mov r9, #-2147483648
4354 ; CHECK-FP16-NEXT: movmi r8, r11
4355 ; CHECK-FP16-NEXT: orrs r2, r2, r3
4356 ; CHECK-FP16-NEXT: moveq r8, r0
4357 ; CHECK-FP16-NEXT: cmn r10, #1
4358 ; CHECK-FP16-NEXT: mov r0, #-2147483648
4359 ; CHECK-FP16-NEXT: mov r6, r3
4360 ; CHECK-FP16-NEXT: movgt r0, r8
4361 ; CHECK-FP16-NEXT: cmp r8, #-2147483648
4362 ; CHECK-FP16-NEXT: movhi r9, r8
4363 ; CHECK-FP16-NEXT: cmn r1, #1
4364 ; CHECK-FP16-NEXT: movne r9, r0
4365 ; CHECK-FP16-NEXT: vmov.u16 r0, d8[0]
4366 ; CHECK-FP16-NEXT: str r1, [sp, #8] @ 4-byte Spill
4367 ; CHECK-FP16-NEXT: mvn r7, #-2147483648
4368 ; CHECK-FP16-NEXT: str r2, [sp, #4] @ 4-byte Spill
4369 ; CHECK-FP16-NEXT: vmov s0, r0
4370 ; CHECK-FP16-NEXT: bl __fixhfti
4371 ; CHECK-FP16-NEXT: cmn r1, #-2147483647
4372 ; CHECK-FP16-NEXT: mvn r5, #0
4373 ; CHECK-FP16-NEXT: movlo r5, r0
4374 ; CHECK-FP16-NEXT: mvn r4, #0
4375 ; CHECK-FP16-NEXT: moveq r5, r0
4376 ; CHECK-FP16-NEXT: cmp r3, #0
4377 ; CHECK-FP16-NEXT: movpl r0, r4
4378 ; CHECK-FP16-NEXT: orrs r12, r2, r3
4379 ; CHECK-FP16-NEXT: moveq r0, r5
4380 ; CHECK-FP16-NEXT: cmn r1, #-2147483647
4381 ; CHECK-FP16-NEXT: mvn r5, #-2147483648
4382 ; CHECK-FP16-NEXT: movlo r5, r1
4383 ; CHECK-FP16-NEXT: cmp r3, #0
4384 ; CHECK-FP16-NEXT: movmi r7, r1
4385 ; CHECK-FP16-NEXT: cmp r12, #0
4386 ; CHECK-FP16-NEXT: moveq r7, r5
4387 ; CHECK-FP16-NEXT: cmp r7, #-2147483648
4388 ; CHECK-FP16-NEXT: mov r1, #0
4389 ; CHECK-FP16-NEXT: ldr r5, [sp, #12] @ 4-byte Reload
4390 ; CHECK-FP16-NEXT: movhi r1, r0
4391 ; CHECK-FP16-NEXT: mov r12, #0
4392 ; CHECK-FP16-NEXT: moveq r1, r0
4393 ; CHECK-FP16-NEXT: cmp r6, #0
4394 ; CHECK-FP16-NEXT: mvn r6, #0
4395 ; CHECK-FP16-NEXT: movmi r6, r5
4396 ; CHECK-FP16-NEXT: cmn r11, #-2147483647
4397 ; CHECK-FP16-NEXT: movlo r4, r5
4398 ; CHECK-FP16-NEXT: moveq r4, r5
4399 ; CHECK-FP16-NEXT: ldr r5, [sp, #4] @ 4-byte Reload
4400 ; CHECK-FP16-NEXT: cmp r5, #0
4401 ; CHECK-FP16-NEXT: ldr r5, [sp, #8] @ 4-byte Reload
4402 ; CHECK-FP16-NEXT: movne r4, r6
4403 ; CHECK-FP16-NEXT: cmp r8, #-2147483648
4404 ; CHECK-FP16-NEXT: mov r6, #0
4405 ; CHECK-FP16-NEXT: movhi r6, r4
4406 ; CHECK-FP16-NEXT: moveq r6, r4
4407 ; CHECK-FP16-NEXT: cmn r10, #1
4408 ; CHECK-FP16-NEXT: movle r4, r12
4409 ; CHECK-FP16-NEXT: cmn r5, #1
4410 ; CHECK-FP16-NEXT: moveq r4, r6
4411 ; CHECK-FP16-NEXT: cmp r3, #0
4412 ; CHECK-FP16-NEXT: mov r6, #0
4413 ; CHECK-FP16-NEXT: vmov.32 d1[0], r4
4414 ; CHECK-FP16-NEXT: movmi r6, r3
4415 ; CHECK-FP16-NEXT: cmn r6, #1
4416 ; CHECK-FP16-NEXT: movle r0, r12
4417 ; CHECK-FP16-NEXT: cmp r3, #0
4418 ; CHECK-FP16-NEXT: andne r3, r2, r3, asr #31
4419 ; CHECK-FP16-NEXT: and r2, r3, r6
4420 ; CHECK-FP16-NEXT: cmn r2, #1
4421 ; CHECK-FP16-NEXT: moveq r0, r1
4422 ; CHECK-FP16-NEXT: cmn r6, #1
4423 ; CHECK-FP16-NEXT: mov r1, #-2147483648
4424 ; CHECK-FP16-NEXT: vmov.32 d0[0], r0
4425 ; CHECK-FP16-NEXT: movgt r1, r7
4426 ; CHECK-FP16-NEXT: cmp r7, #-2147483648
4427 ; CHECK-FP16-NEXT: mov r0, #-2147483648
4428 ; CHECK-FP16-NEXT: vmov.32 d1[1], r9
4429 ; CHECK-FP16-NEXT: movls r7, r0
4430 ; CHECK-FP16-NEXT: cmn r2, #1
4431 ; CHECK-FP16-NEXT: movne r7, r1
4432 ; CHECK-FP16-NEXT: vmov.32 d0[1], r7
4433 ; CHECK-FP16-NEXT: add sp, sp, #16
4434 ; CHECK-FP16-NEXT: vpop {d8}
4435 ; CHECK-FP16-NEXT: add sp, sp, #4
4436 ; CHECK-FP16-NEXT: pop {r4, r5, r6, r7, r8, r9, r10, r11, pc}
4438 %conv = fptosi <2 x half> %x to <2 x i128>
4439 %spec.store.select = call <2 x i128> @llvm.smin.v2i128(<2 x i128> %conv, <2 x i128> <i128 9223372036854775807, i128 9223372036854775807>)
4440 %spec.store.select7 = call <2 x i128> @llvm.smax.v2i128(<2 x i128> %spec.store.select, <2 x i128> <i128 -9223372036854775808, i128 -9223372036854775808>)
4441 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
4442 ret <2 x i64> %conv6
4445 define <2 x i64> @utesth_f16i64_mm(<2 x half> %x) {
4446 ; CHECK-NEON-LABEL: utesth_f16i64_mm:
4447 ; CHECK-NEON: @ %bb.0: @ %entry
4448 ; CHECK-NEON-NEXT: .save {r4, r5, r6, r7, r11, lr}
4449 ; CHECK-NEON-NEXT: push {r4, r5, r6, r7, r11, lr}
4450 ; CHECK-NEON-NEXT: .vsave {d8}
4451 ; CHECK-NEON-NEXT: vpush {d8}
4452 ; CHECK-NEON-NEXT: vmov r0, s0
4453 ; CHECK-NEON-NEXT: vmov.f32 s16, s1
4454 ; CHECK-NEON-NEXT: bl __aeabi_h2f
4455 ; CHECK-NEON-NEXT: mov r5, r0
4456 ; CHECK-NEON-NEXT: vmov r0, s16
4457 ; CHECK-NEON-NEXT: bl __aeabi_h2f
4458 ; CHECK-NEON-NEXT: vmov s0, r0
4459 ; CHECK-NEON-NEXT: bl __fixunssfti
4460 ; CHECK-NEON-NEXT: mov r7, r1
4461 ; CHECK-NEON-NEXT: eor r1, r2, #1
4462 ; CHECK-NEON-NEXT: subs r2, r2, #1
4463 ; CHECK-NEON-NEXT: mov r6, #0
4464 ; CHECK-NEON-NEXT: sbcs r2, r3, #0
4465 ; CHECK-NEON-NEXT: orr r1, r1, r3
4466 ; CHECK-NEON-NEXT: movwlo r6, #1
4467 ; CHECK-NEON-NEXT: cmp r6, #0
4468 ; CHECK-NEON-NEXT: moveq r7, r6
4469 ; CHECK-NEON-NEXT: cmp r1, #0
4470 ; CHECK-NEON-NEXT: vmov s0, r5
4471 ; CHECK-NEON-NEXT: moveq r7, r1
4472 ; CHECK-NEON-NEXT: cmp r6, #0
4473 ; CHECK-NEON-NEXT: mov r5, #0
4474 ; CHECK-NEON-NEXT: movne r6, r0
4475 ; CHECK-NEON-NEXT: cmp r1, #0
4476 ; CHECK-NEON-NEXT: moveq r6, r1
4477 ; CHECK-NEON-NEXT: bl __fixunssfti
4478 ; CHECK-NEON-NEXT: eor r4, r2, #1
4479 ; CHECK-NEON-NEXT: subs r2, r2, #1
4480 ; CHECK-NEON-NEXT: sbcs r2, r3, #0
4481 ; CHECK-NEON-NEXT: orr r4, r4, r3
4482 ; CHECK-NEON-NEXT: movwlo r5, #1
4483 ; CHECK-NEON-NEXT: cmp r5, #0
4484 ; CHECK-NEON-NEXT: moveq r0, r5
4485 ; CHECK-NEON-NEXT: cmp r4, #0
4486 ; CHECK-NEON-NEXT: moveq r0, r4
4487 ; CHECK-NEON-NEXT: vmov.32 d1[0], r6
4488 ; CHECK-NEON-NEXT: cmp r5, #0
4489 ; CHECK-NEON-NEXT: vmov.32 d0[0], r0
4490 ; CHECK-NEON-NEXT: movne r5, r1
4491 ; CHECK-NEON-NEXT: cmp r4, #0
4492 ; CHECK-NEON-NEXT: vmov.32 d1[1], r7
4493 ; CHECK-NEON-NEXT: moveq r5, r4
4494 ; CHECK-NEON-NEXT: vmov.32 d0[1], r5
4495 ; CHECK-NEON-NEXT: vpop {d8}
4496 ; CHECK-NEON-NEXT: pop {r4, r5, r6, r7, r11, pc}
4498 ; CHECK-FP16-LABEL: utesth_f16i64_mm:
4499 ; CHECK-FP16: @ %bb.0: @ %entry
4500 ; CHECK-FP16-NEXT: .save {r4, r5, r6, r7, r11, lr}
4501 ; CHECK-FP16-NEXT: push {r4, r5, r6, r7, r11, lr}
4502 ; CHECK-FP16-NEXT: vmov.u16 r0, d0[1]
4503 ; CHECK-FP16-NEXT: vmov.u16 r5, d0[0]
4504 ; CHECK-FP16-NEXT: vmov s0, r0
4505 ; CHECK-FP16-NEXT: bl __fixunshfti
4506 ; CHECK-FP16-NEXT: mov r7, r1
4507 ; CHECK-FP16-NEXT: eor r1, r2, #1
4508 ; CHECK-FP16-NEXT: subs r2, r2, #1
4509 ; CHECK-FP16-NEXT: mov r6, #0
4510 ; CHECK-FP16-NEXT: sbcs r2, r3, #0
4511 ; CHECK-FP16-NEXT: orr r1, r1, r3
4512 ; CHECK-FP16-NEXT: movwlo r6, #1
4513 ; CHECK-FP16-NEXT: cmp r6, #0
4514 ; CHECK-FP16-NEXT: moveq r7, r6
4515 ; CHECK-FP16-NEXT: cmp r1, #0
4516 ; CHECK-FP16-NEXT: vmov s0, r5
4517 ; CHECK-FP16-NEXT: moveq r7, r1
4518 ; CHECK-FP16-NEXT: cmp r6, #0
4519 ; CHECK-FP16-NEXT: mov r5, #0
4520 ; CHECK-FP16-NEXT: movne r6, r0
4521 ; CHECK-FP16-NEXT: cmp r1, #0
4522 ; CHECK-FP16-NEXT: moveq r6, r1
4523 ; CHECK-FP16-NEXT: bl __fixunshfti
4524 ; CHECK-FP16-NEXT: eor r4, r2, #1
4525 ; CHECK-FP16-NEXT: subs r2, r2, #1
4526 ; CHECK-FP16-NEXT: sbcs r2, r3, #0
4527 ; CHECK-FP16-NEXT: orr r4, r4, r3
4528 ; CHECK-FP16-NEXT: movwlo r5, #1
4529 ; CHECK-FP16-NEXT: cmp r5, #0
4530 ; CHECK-FP16-NEXT: moveq r0, r5
4531 ; CHECK-FP16-NEXT: cmp r4, #0
4532 ; CHECK-FP16-NEXT: moveq r0, r4
4533 ; CHECK-FP16-NEXT: vmov.32 d1[0], r6
4534 ; CHECK-FP16-NEXT: cmp r5, #0
4535 ; CHECK-FP16-NEXT: vmov.32 d0[0], r0
4536 ; CHECK-FP16-NEXT: movne r5, r1
4537 ; CHECK-FP16-NEXT: cmp r4, #0
4538 ; CHECK-FP16-NEXT: vmov.32 d1[1], r7
4539 ; CHECK-FP16-NEXT: moveq r5, r4
4540 ; CHECK-FP16-NEXT: vmov.32 d0[1], r5
4541 ; CHECK-FP16-NEXT: pop {r4, r5, r6, r7, r11, pc}
4543 %conv = fptoui <2 x half> %x to <2 x i128>
4544 %spec.store.select = call <2 x i128> @llvm.umin.v2i128(<2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>)
4545 %conv6 = trunc <2 x i128> %spec.store.select to <2 x i64>
4546 ret <2 x i64> %conv6
4549 define <2 x i64> @ustest_f16i64_mm(<2 x half> %x) {
4550 ; CHECK-NEON-LABEL: ustest_f16i64_mm:
4551 ; CHECK-NEON: @ %bb.0: @ %entry
4552 ; CHECK-NEON-NEXT: .save {r4, r5, r6, r7, r8, r9, r10, r11, lr}
4553 ; CHECK-NEON-NEXT: push {r4, r5, r6, r7, r8, r9, r10, r11, lr}
4554 ; CHECK-NEON-NEXT: .pad #4
4555 ; CHECK-NEON-NEXT: sub sp, sp, #4
4556 ; CHECK-NEON-NEXT: .vsave {d8}
4557 ; CHECK-NEON-NEXT: vpush {d8}
4558 ; CHECK-NEON-NEXT: vmov r0, s0
4559 ; CHECK-NEON-NEXT: vmov.f32 s16, s1
4560 ; CHECK-NEON-NEXT: bl __aeabi_h2f
4561 ; CHECK-NEON-NEXT: vmov s0, r0
4562 ; CHECK-NEON-NEXT: bl __fixsfti
4563 ; CHECK-NEON-NEXT: mov r8, r0
4564 ; CHECK-NEON-NEXT: eor r0, r2, #1
4565 ; CHECK-NEON-NEXT: mov r5, r2
4566 ; CHECK-NEON-NEXT: subs r2, r2, #1
4567 ; CHECK-NEON-NEXT: sbcs r2, r3, #0
4568 ; CHECK-NEON-NEXT: mov r4, #0
4569 ; CHECK-NEON-NEXT: movwlt r4, #1
4570 ; CHECK-NEON-NEXT: cmp r4, #0
4571 ; CHECK-NEON-NEXT: orr r0, r0, r3
4572 ; CHECK-NEON-NEXT: moveq r8, r4
4573 ; CHECK-NEON-NEXT: cmp r0, #0
4574 ; CHECK-NEON-NEXT: mov r10, #1
4575 ; CHECK-NEON-NEXT: moveq r8, r0
4576 ; CHECK-NEON-NEXT: cmp r4, #0
4577 ; CHECK-NEON-NEXT: movne r4, r1
4578 ; CHECK-NEON-NEXT: cmp r0, #0
4579 ; CHECK-NEON-NEXT: moveq r4, r0
4580 ; CHECK-NEON-NEXT: cmp r4, #0
4581 ; CHECK-NEON-NEXT: mov r7, r4
4582 ; CHECK-NEON-NEXT: mov r0, #1
4583 ; CHECK-NEON-NEXT: movne r7, r8
4584 ; CHECK-NEON-NEXT: mov r6, r3
4585 ; CHECK-NEON-NEXT: moveq r7, r8
4586 ; CHECK-NEON-NEXT: cmp r5, #1
4587 ; CHECK-NEON-NEXT: movlo r0, r5
4588 ; CHECK-NEON-NEXT: cmp r3, #0
4589 ; CHECK-NEON-NEXT: movpl r5, r10
4590 ; CHECK-NEON-NEXT: mov r9, #0
4591 ; CHECK-NEON-NEXT: moveq r5, r0
4592 ; CHECK-NEON-NEXT: movpl r6, r9
4593 ; CHECK-NEON-NEXT: rsbs r0, r5, #0
4594 ; CHECK-NEON-NEXT: mov r11, #0
4595 ; CHECK-NEON-NEXT: rscs r0, r6, #0
4596 ; CHECK-NEON-NEXT: vmov r0, s16
4597 ; CHECK-NEON-NEXT: movwlt r11, #1
4598 ; CHECK-NEON-NEXT: cmp r11, #0
4599 ; CHECK-NEON-NEXT: moveq r8, r11
4600 ; CHECK-NEON-NEXT: bl __aeabi_h2f
4601 ; CHECK-NEON-NEXT: vmov s0, r0
4602 ; CHECK-NEON-NEXT: orrs r5, r5, r6
4603 ; CHECK-NEON-NEXT: moveq r8, r7
4604 ; CHECK-NEON-NEXT: bl __fixsfti
4605 ; CHECK-NEON-NEXT: subs r6, r2, #1
4606 ; CHECK-NEON-NEXT: eor r7, r2, #1
4607 ; CHECK-NEON-NEXT: sbcs r6, r3, #0
4608 ; CHECK-NEON-NEXT: orr r7, r7, r3
4609 ; CHECK-NEON-NEXT: mov r6, #0
4610 ; CHECK-NEON-NEXT: movwlt r6, #1
4611 ; CHECK-NEON-NEXT: cmp r6, #0
4612 ; CHECK-NEON-NEXT: moveq r0, r6
4613 ; CHECK-NEON-NEXT: cmp r7, #0
4614 ; CHECK-NEON-NEXT: moveq r0, r7
4615 ; CHECK-NEON-NEXT: cmp r6, #0
4616 ; CHECK-NEON-NEXT: movne r6, r1
4617 ; CHECK-NEON-NEXT: cmp r7, #0
4618 ; CHECK-NEON-NEXT: moveq r6, r7
4619 ; CHECK-NEON-NEXT: cmp r6, #0
4620 ; CHECK-NEON-NEXT: mov r1, r6
4621 ; CHECK-NEON-NEXT: mov r7, #1
4622 ; CHECK-NEON-NEXT: movne r1, r0
4623 ; CHECK-NEON-NEXT: moveq r1, r0
4624 ; CHECK-NEON-NEXT: cmp r2, #1
4625 ; CHECK-NEON-NEXT: movlo r7, r2
4626 ; CHECK-NEON-NEXT: cmp r3, #0
4627 ; CHECK-NEON-NEXT: movmi r10, r2
4628 ; CHECK-NEON-NEXT: movpl r3, r9
4629 ; CHECK-NEON-NEXT: moveq r10, r7
4630 ; CHECK-NEON-NEXT: rsbs r2, r10, #0
4631 ; CHECK-NEON-NEXT: rscs r2, r3, #0
4632 ; CHECK-NEON-NEXT: movwlt r9, #1
4633 ; CHECK-NEON-NEXT: cmp r9, #0
4634 ; CHECK-NEON-NEXT: moveq r0, r9
4635 ; CHECK-NEON-NEXT: orrs r2, r10, r3
4636 ; CHECK-NEON-NEXT: moveq r0, r1
4637 ; CHECK-NEON-NEXT: cmp r9, #0
4638 ; CHECK-NEON-NEXT: movne r9, r6
4639 ; CHECK-NEON-NEXT: cmp r2, #0
4640 ; CHECK-NEON-NEXT: vmov.32 d1[0], r0
4641 ; CHECK-NEON-NEXT: moveq r9, r6
4642 ; CHECK-NEON-NEXT: cmp r11, #0
4643 ; CHECK-NEON-NEXT: vmov.32 d0[0], r8
4644 ; CHECK-NEON-NEXT: movne r11, r4
4645 ; CHECK-NEON-NEXT: cmp r5, #0
4646 ; CHECK-NEON-NEXT: vmov.32 d1[1], r9
4647 ; CHECK-NEON-NEXT: moveq r11, r4
4648 ; CHECK-NEON-NEXT: vmov.32 d0[1], r11
4649 ; CHECK-NEON-NEXT: vpop {d8}
4650 ; CHECK-NEON-NEXT: add sp, sp, #4
4651 ; CHECK-NEON-NEXT: pop {r4, r5, r6, r7, r8, r9, r10, r11, pc}
4653 ; CHECK-FP16-LABEL: ustest_f16i64_mm:
4654 ; CHECK-FP16: @ %bb.0: @ %entry
4655 ; CHECK-FP16-NEXT: .save {r4, r5, r6, r7, r8, r9, r10, r11, lr}
4656 ; CHECK-FP16-NEXT: push {r4, r5, r6, r7, r8, r9, r10, r11, lr}
4657 ; CHECK-FP16-NEXT: .pad #4
4658 ; CHECK-FP16-NEXT: sub sp, sp, #4
4659 ; CHECK-FP16-NEXT: .vsave {d8}
4660 ; CHECK-FP16-NEXT: vpush {d8}
4661 ; CHECK-FP16-NEXT: vmov.u16 r0, d0[0]
4662 ; CHECK-FP16-NEXT: vorr d8, d0, d0
4663 ; CHECK-FP16-NEXT: vmov s0, r0
4664 ; CHECK-FP16-NEXT: bl __fixhfti
4665 ; CHECK-FP16-NEXT: subs r7, r2, #1
4666 ; CHECK-FP16-NEXT: mov r10, r0
4667 ; CHECK-FP16-NEXT: eor r0, r2, #1
4668 ; CHECK-FP16-NEXT: sbcs r7, r3, #0
4669 ; CHECK-FP16-NEXT: mov r5, #0
4670 ; CHECK-FP16-NEXT: orr r0, r0, r3
4671 ; CHECK-FP16-NEXT: movwlt r5, #1
4672 ; CHECK-FP16-NEXT: cmp r5, #0
4673 ; CHECK-FP16-NEXT: moveq r10, r5
4674 ; CHECK-FP16-NEXT: cmp r0, #0
4675 ; CHECK-FP16-NEXT: moveq r10, r0
4676 ; CHECK-FP16-NEXT: cmp r5, #0
4677 ; CHECK-FP16-NEXT: movne r5, r1
4678 ; CHECK-FP16-NEXT: cmp r0, #0
4679 ; CHECK-FP16-NEXT: moveq r5, r0
4680 ; CHECK-FP16-NEXT: cmp r5, #0
4681 ; CHECK-FP16-NEXT: mov r0, r5
4682 ; CHECK-FP16-NEXT: mov r1, #1
4683 ; CHECK-FP16-NEXT: movne r0, r10
4684 ; CHECK-FP16-NEXT: mov r8, #1
4685 ; CHECK-FP16-NEXT: moveq r0, r10
4686 ; CHECK-FP16-NEXT: cmp r2, #1
4687 ; CHECK-FP16-NEXT: movlo r1, r2
4688 ; CHECK-FP16-NEXT: cmp r3, #0
4689 ; CHECK-FP16-NEXT: movpl r2, r8
4690 ; CHECK-FP16-NEXT: mov r11, #0
4691 ; CHECK-FP16-NEXT: moveq r2, r1
4692 ; CHECK-FP16-NEXT: movpl r3, r11
4693 ; CHECK-FP16-NEXT: rsbs r1, r2, #0
4694 ; CHECK-FP16-NEXT: mov r7, #0
4695 ; CHECK-FP16-NEXT: rscs r1, r3, #0
4696 ; CHECK-FP16-NEXT: vmov.u16 r1, d8[1]
4697 ; CHECK-FP16-NEXT: movwlt r7, #1
4698 ; CHECK-FP16-NEXT: cmp r7, #0
4699 ; CHECK-FP16-NEXT: moveq r10, r7
4700 ; CHECK-FP16-NEXT: orrs r9, r2, r3
4701 ; CHECK-FP16-NEXT: moveq r10, r0
4702 ; CHECK-FP16-NEXT: vmov s0, r1
4703 ; CHECK-FP16-NEXT: bl __fixhfti
4704 ; CHECK-FP16-NEXT: eor r4, r2, #1
4705 ; CHECK-FP16-NEXT: orr r6, r4, r3
4706 ; CHECK-FP16-NEXT: subs r4, r2, #1
4707 ; CHECK-FP16-NEXT: sbcs r4, r3, #0
4708 ; CHECK-FP16-NEXT: mov r4, #0
4709 ; CHECK-FP16-NEXT: movwlt r4, #1
4710 ; CHECK-FP16-NEXT: cmp r4, #0
4711 ; CHECK-FP16-NEXT: moveq r0, r4
4712 ; CHECK-FP16-NEXT: cmp r6, #0
4713 ; CHECK-FP16-NEXT: moveq r0, r6
4714 ; CHECK-FP16-NEXT: cmp r4, #0
4715 ; CHECK-FP16-NEXT: movne r4, r1
4716 ; CHECK-FP16-NEXT: cmp r6, #0
4717 ; CHECK-FP16-NEXT: moveq r4, r6
4718 ; CHECK-FP16-NEXT: cmp r4, #0
4719 ; CHECK-FP16-NEXT: mov r1, r4
4720 ; CHECK-FP16-NEXT: mov r6, #1
4721 ; CHECK-FP16-NEXT: movne r1, r0
4722 ; CHECK-FP16-NEXT: moveq r1, r0
4723 ; CHECK-FP16-NEXT: cmp r2, #1
4724 ; CHECK-FP16-NEXT: movlo r6, r2
4725 ; CHECK-FP16-NEXT: cmp r3, #0
4726 ; CHECK-FP16-NEXT: movmi r8, r2
4727 ; CHECK-FP16-NEXT: movpl r3, r11
4728 ; CHECK-FP16-NEXT: moveq r8, r6
4729 ; CHECK-FP16-NEXT: rsbs r2, r8, #0
4730 ; CHECK-FP16-NEXT: rscs r2, r3, #0
4731 ; CHECK-FP16-NEXT: movwlt r11, #1
4732 ; CHECK-FP16-NEXT: cmp r11, #0
4733 ; CHECK-FP16-NEXT: moveq r0, r11
4734 ; CHECK-FP16-NEXT: orrs r2, r8, r3
4735 ; CHECK-FP16-NEXT: moveq r0, r1
4736 ; CHECK-FP16-NEXT: cmp r11, #0
4737 ; CHECK-FP16-NEXT: movne r11, r4
4738 ; CHECK-FP16-NEXT: cmp r2, #0
4739 ; CHECK-FP16-NEXT: vmov.32 d1[0], r0
4740 ; CHECK-FP16-NEXT: moveq r11, r4
4741 ; CHECK-FP16-NEXT: cmp r7, #0
4742 ; CHECK-FP16-NEXT: vmov.32 d0[0], r10
4743 ; CHECK-FP16-NEXT: movne r7, r5
4744 ; CHECK-FP16-NEXT: cmp r9, #0
4745 ; CHECK-FP16-NEXT: vmov.32 d1[1], r11
4746 ; CHECK-FP16-NEXT: moveq r7, r5
4747 ; CHECK-FP16-NEXT: vmov.32 d0[1], r7
4748 ; CHECK-FP16-NEXT: vpop {d8}
4749 ; CHECK-FP16-NEXT: add sp, sp, #4
4750 ; CHECK-FP16-NEXT: pop {r4, r5, r6, r7, r8, r9, r10, r11, pc}
4752 %conv = fptosi <2 x half> %x to <2 x i128>
4753 %spec.store.select = call <2 x i128> @llvm.smin.v2i128(<2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>)
4754 %spec.store.select7 = call <2 x i128> @llvm.smax.v2i128(<2 x i128> %spec.store.select, <2 x i128> zeroinitializer)
4755 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
4756 ret <2 x i64> %conv6
4759 declare <2 x i32> @llvm.smin.v2i32(<2 x i32>, <2 x i32>)
4760 declare <2 x i32> @llvm.smax.v2i32(<2 x i32>, <2 x i32>)
4761 declare <2 x i32> @llvm.umin.v2i32(<2 x i32>, <2 x i32>)
4762 declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>)
4763 declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>)
4764 declare <4 x i32> @llvm.umin.v4i32(<4 x i32>, <4 x i32>)
4765 declare <8 x i32> @llvm.smin.v8i32(<8 x i32>, <8 x i32>)
4766 declare <8 x i32> @llvm.smax.v8i32(<8 x i32>, <8 x i32>)
4767 declare <8 x i32> @llvm.umin.v8i32(<8 x i32>, <8 x i32>)
4768 declare <2 x i64> @llvm.smin.v2i64(<2 x i64>, <2 x i64>)
4769 declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>)
4770 declare <2 x i64> @llvm.umin.v2i64(<2 x i64>, <2 x i64>)
4771 declare <4 x i64> @llvm.smin.v4i64(<4 x i64>, <4 x i64>)
4772 declare <4 x i64> @llvm.smax.v4i64(<4 x i64>, <4 x i64>)
4773 declare <4 x i64> @llvm.umin.v4i64(<4 x i64>, <4 x i64>)
4774 declare <2 x i128> @llvm.smin.v2i128(<2 x i128>, <2 x i128>)
4775 declare <2 x i128> @llvm.smax.v2i128(<2 x i128>, <2 x i128>)
4776 declare <2 x i128> @llvm.umin.v2i128(<2 x i128>, <2 x i128>)