1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=thumbv6m-none-eabi -float-abi=soft %s -o - | FileCheck %s --check-prefixes=SOFT
3 ; RUN: llc -mtriple=thumbv7m-none-eabihf -mattr=+vfp2sp %s -o - | FileCheck %s --check-prefixes=VFP,VFP2
4 ; RUN: llc -mtriple=thumbv8.1m.main-none-eabihf -mattr=+fullfp16,+fp64 %s -o - | FileCheck %s --check-prefixes=VFP,FULL
8 define i32 @stest_f64i32(double %x) {
9 ; SOFT-LABEL: stest_f64i32:
10 ; SOFT: @ %bb.0: @ %entry
11 ; SOFT-NEXT: .save {r4, r5, r7, lr}
12 ; SOFT-NEXT: push {r4, r5, r7, lr}
13 ; SOFT-NEXT: bl __aeabi_d2lz
14 ; SOFT-NEXT: movs r2, #1
15 ; SOFT-NEXT: movs r3, #0
16 ; SOFT-NEXT: ldr r4, .LCPI0_0
17 ; SOFT-NEXT: subs r5, r0, r4
18 ; SOFT-NEXT: mov r5, r1
19 ; SOFT-NEXT: sbcs r5, r3
20 ; SOFT-NEXT: mov r5, r2
21 ; SOFT-NEXT: bge .LBB0_7
22 ; SOFT-NEXT: @ %bb.1: @ %entry
23 ; SOFT-NEXT: cmp r5, #0
24 ; SOFT-NEXT: beq .LBB0_8
25 ; SOFT-NEXT: .LBB0_2: @ %entry
26 ; SOFT-NEXT: cmp r5, #0
27 ; SOFT-NEXT: bne .LBB0_4
28 ; SOFT-NEXT: .LBB0_3: @ %entry
29 ; SOFT-NEXT: mov r0, r4
30 ; SOFT-NEXT: .LBB0_4: @ %entry
31 ; SOFT-NEXT: mvns r3, r3
32 ; SOFT-NEXT: lsls r2, r2, #31
33 ; SOFT-NEXT: subs r4, r2, r0
34 ; SOFT-NEXT: sbcs r3, r1
35 ; SOFT-NEXT: blt .LBB0_6
36 ; SOFT-NEXT: @ %bb.5: @ %entry
37 ; SOFT-NEXT: mov r0, r2
38 ; SOFT-NEXT: .LBB0_6: @ %entry
39 ; SOFT-NEXT: pop {r4, r5, r7, pc}
40 ; SOFT-NEXT: .LBB0_7: @ %entry
41 ; SOFT-NEXT: mov r5, r3
42 ; SOFT-NEXT: cmp r5, #0
43 ; SOFT-NEXT: bne .LBB0_2
44 ; SOFT-NEXT: .LBB0_8: @ %entry
45 ; SOFT-NEXT: mov r1, r3
46 ; SOFT-NEXT: cmp r5, #0
47 ; SOFT-NEXT: beq .LBB0_3
48 ; SOFT-NEXT: b .LBB0_4
49 ; SOFT-NEXT: .p2align 2
51 ; SOFT-NEXT: .LCPI0_0:
52 ; SOFT-NEXT: .long 2147483647 @ 0x7fffffff
54 ; VFP2-LABEL: stest_f64i32:
55 ; VFP2: @ %bb.0: @ %entry
56 ; VFP2-NEXT: .save {r7, lr}
57 ; VFP2-NEXT: push {r7, lr}
58 ; VFP2-NEXT: vmov r0, r1, d0
59 ; VFP2-NEXT: bl __aeabi_d2lz
60 ; VFP2-NEXT: mvn r12, #-2147483648
61 ; VFP2-NEXT: subs.w r3, r0, r12
62 ; VFP2-NEXT: mov.w r2, #0
63 ; VFP2-NEXT: sbcs r3, r1, #0
65 ; VFP2-NEXT: movlt r2, #1
66 ; VFP2-NEXT: cmp r2, #0
68 ; VFP2-NEXT: movne r2, r1
69 ; VFP2-NEXT: moveq r0, r12
70 ; VFP2-NEXT: mov.w r1, #-1
71 ; VFP2-NEXT: rsbs.w r3, r0, #-2147483648
72 ; VFP2-NEXT: sbcs r1, r2
74 ; VFP2-NEXT: movge.w r0, #-2147483648
75 ; VFP2-NEXT: pop {r7, pc}
77 ; FULL-LABEL: stest_f64i32:
78 ; FULL: @ %bb.0: @ %entry
79 ; FULL-NEXT: vcvt.s32.f64 s0, d0
80 ; FULL-NEXT: vmov r0, s0
83 %conv = fptosi double %x to i64
84 %0 = icmp slt i64 %conv, 2147483647
85 %spec.store.select = select i1 %0, i64 %conv, i64 2147483647
86 %1 = icmp sgt i64 %spec.store.select, -2147483648
87 %spec.store.select7 = select i1 %1, i64 %spec.store.select, i64 -2147483648
88 %conv6 = trunc i64 %spec.store.select7 to i32
92 define i32 @utest_f64i32(double %x) {
93 ; SOFT-LABEL: utest_f64i32:
94 ; SOFT: @ %bb.0: @ %entry
95 ; SOFT-NEXT: .save {r7, lr}
96 ; SOFT-NEXT: push {r7, lr}
97 ; SOFT-NEXT: bl __aeabi_d2ulz
98 ; SOFT-NEXT: movs r2, #0
99 ; SOFT-NEXT: adds r3, r0, #1
100 ; SOFT-NEXT: sbcs r1, r2
101 ; SOFT-NEXT: blo .LBB1_2
102 ; SOFT-NEXT: @ %bb.1: @ %entry
103 ; SOFT-NEXT: mvns r0, r2
104 ; SOFT-NEXT: .LBB1_2: @ %entry
105 ; SOFT-NEXT: pop {r7, pc}
107 ; VFP2-LABEL: utest_f64i32:
108 ; VFP2: @ %bb.0: @ %entry
109 ; VFP2-NEXT: .save {r7, lr}
110 ; VFP2-NEXT: push {r7, lr}
111 ; VFP2-NEXT: vmov r0, r1, d0
112 ; VFP2-NEXT: bl __aeabi_d2ulz
113 ; VFP2-NEXT: subs.w r2, r0, #-1
114 ; VFP2-NEXT: sbcs r1, r1, #0
116 ; VFP2-NEXT: movhs.w r0, #-1
117 ; VFP2-NEXT: pop {r7, pc}
119 ; FULL-LABEL: utest_f64i32:
120 ; FULL: @ %bb.0: @ %entry
121 ; FULL-NEXT: vcvt.u32.f64 s0, d0
122 ; FULL-NEXT: vmov r0, s0
125 %conv = fptoui double %x to i64
126 %0 = icmp ult i64 %conv, 4294967295
127 %spec.store.select = select i1 %0, i64 %conv, i64 4294967295
128 %conv6 = trunc i64 %spec.store.select to i32
132 define i32 @ustest_f64i32(double %x) {
133 ; SOFT-LABEL: ustest_f64i32:
134 ; SOFT: @ %bb.0: @ %entry
135 ; SOFT-NEXT: .save {r4, lr}
136 ; SOFT-NEXT: push {r4, lr}
137 ; SOFT-NEXT: bl __aeabi_d2lz
138 ; SOFT-NEXT: movs r2, #1
139 ; SOFT-NEXT: movs r3, #0
140 ; SOFT-NEXT: adds r4, r0, #1
141 ; SOFT-NEXT: mov r4, r1
142 ; SOFT-NEXT: sbcs r4, r3
143 ; SOFT-NEXT: mov r4, r2
144 ; SOFT-NEXT: bge .LBB2_7
145 ; SOFT-NEXT: @ %bb.1: @ %entry
146 ; SOFT-NEXT: cmp r4, #0
147 ; SOFT-NEXT: beq .LBB2_8
148 ; SOFT-NEXT: .LBB2_2: @ %entry
149 ; SOFT-NEXT: cmp r4, #0
150 ; SOFT-NEXT: bne .LBB2_4
151 ; SOFT-NEXT: .LBB2_3: @ %entry
152 ; SOFT-NEXT: mvns r0, r3
153 ; SOFT-NEXT: .LBB2_4: @ %entry
154 ; SOFT-NEXT: rsbs r4, r0, #0
155 ; SOFT-NEXT: mov r4, r3
156 ; SOFT-NEXT: sbcs r4, r1
157 ; SOFT-NEXT: bge .LBB2_9
158 ; SOFT-NEXT: @ %bb.5: @ %entry
159 ; SOFT-NEXT: cmp r2, #0
160 ; SOFT-NEXT: beq .LBB2_10
161 ; SOFT-NEXT: .LBB2_6: @ %entry
162 ; SOFT-NEXT: pop {r4, pc}
163 ; SOFT-NEXT: .LBB2_7: @ %entry
164 ; SOFT-NEXT: mov r4, r3
165 ; SOFT-NEXT: cmp r4, #0
166 ; SOFT-NEXT: bne .LBB2_2
167 ; SOFT-NEXT: .LBB2_8: @ %entry
168 ; SOFT-NEXT: mov r1, r3
169 ; SOFT-NEXT: cmp r4, #0
170 ; SOFT-NEXT: beq .LBB2_3
171 ; SOFT-NEXT: b .LBB2_4
172 ; SOFT-NEXT: .LBB2_9: @ %entry
173 ; SOFT-NEXT: mov r2, r3
174 ; SOFT-NEXT: cmp r2, #0
175 ; SOFT-NEXT: bne .LBB2_6
176 ; SOFT-NEXT: .LBB2_10: @ %entry
177 ; SOFT-NEXT: mov r0, r2
178 ; SOFT-NEXT: pop {r4, pc}
180 ; VFP2-LABEL: ustest_f64i32:
181 ; VFP2: @ %bb.0: @ %entry
182 ; VFP2-NEXT: .save {r7, lr}
183 ; VFP2-NEXT: push {r7, lr}
184 ; VFP2-NEXT: vmov r0, r1, d0
185 ; VFP2-NEXT: bl __aeabi_d2lz
186 ; VFP2-NEXT: subs.w r3, r0, #-1
187 ; VFP2-NEXT: mov.w r2, #0
188 ; VFP2-NEXT: sbcs r3, r1, #0
189 ; VFP2-NEXT: mov.w r3, #0
191 ; VFP2-NEXT: movlt r3, #1
192 ; VFP2-NEXT: cmp r3, #0
194 ; VFP2-NEXT: movne r3, r1
195 ; VFP2-NEXT: moveq.w r0, #-1
196 ; VFP2-NEXT: rsbs r1, r0, #0
197 ; VFP2-NEXT: sbcs.w r1, r2, r3
199 ; VFP2-NEXT: movlt r2, #1
200 ; VFP2-NEXT: cmp r2, #0
202 ; VFP2-NEXT: moveq r0, r2
203 ; VFP2-NEXT: pop {r7, pc}
205 ; FULL-LABEL: ustest_f64i32:
206 ; FULL: @ %bb.0: @ %entry
207 ; FULL-NEXT: vcvt.u32.f64 s0, d0
208 ; FULL-NEXT: vmov r0, s0
211 %conv = fptosi double %x to i64
212 %0 = icmp slt i64 %conv, 4294967295
213 %spec.store.select = select i1 %0, i64 %conv, i64 4294967295
214 %1 = icmp sgt i64 %spec.store.select, 0
215 %spec.store.select7 = select i1 %1, i64 %spec.store.select, i64 0
216 %conv6 = trunc i64 %spec.store.select7 to i32
220 define i32 @stest_f32i32(float %x) {
221 ; SOFT-LABEL: stest_f32i32:
222 ; SOFT: @ %bb.0: @ %entry
223 ; SOFT-NEXT: .save {r4, r5, r7, lr}
224 ; SOFT-NEXT: push {r4, r5, r7, lr}
225 ; SOFT-NEXT: bl __aeabi_f2lz
226 ; SOFT-NEXT: movs r2, #1
227 ; SOFT-NEXT: movs r3, #0
228 ; SOFT-NEXT: ldr r4, .LCPI3_0
229 ; SOFT-NEXT: subs r5, r0, r4
230 ; SOFT-NEXT: mov r5, r1
231 ; SOFT-NEXT: sbcs r5, r3
232 ; SOFT-NEXT: mov r5, r2
233 ; SOFT-NEXT: bge .LBB3_7
234 ; SOFT-NEXT: @ %bb.1: @ %entry
235 ; SOFT-NEXT: cmp r5, #0
236 ; SOFT-NEXT: beq .LBB3_8
237 ; SOFT-NEXT: .LBB3_2: @ %entry
238 ; SOFT-NEXT: cmp r5, #0
239 ; SOFT-NEXT: bne .LBB3_4
240 ; SOFT-NEXT: .LBB3_3: @ %entry
241 ; SOFT-NEXT: mov r0, r4
242 ; SOFT-NEXT: .LBB3_4: @ %entry
243 ; SOFT-NEXT: mvns r3, r3
244 ; SOFT-NEXT: lsls r2, r2, #31
245 ; SOFT-NEXT: subs r4, r2, r0
246 ; SOFT-NEXT: sbcs r3, r1
247 ; SOFT-NEXT: blt .LBB3_6
248 ; SOFT-NEXT: @ %bb.5: @ %entry
249 ; SOFT-NEXT: mov r0, r2
250 ; SOFT-NEXT: .LBB3_6: @ %entry
251 ; SOFT-NEXT: pop {r4, r5, r7, pc}
252 ; SOFT-NEXT: .LBB3_7: @ %entry
253 ; SOFT-NEXT: mov r5, r3
254 ; SOFT-NEXT: cmp r5, #0
255 ; SOFT-NEXT: bne .LBB3_2
256 ; SOFT-NEXT: .LBB3_8: @ %entry
257 ; SOFT-NEXT: mov r1, r3
258 ; SOFT-NEXT: cmp r5, #0
259 ; SOFT-NEXT: beq .LBB3_3
260 ; SOFT-NEXT: b .LBB3_4
261 ; SOFT-NEXT: .p2align 2
262 ; SOFT-NEXT: @ %bb.9:
263 ; SOFT-NEXT: .LCPI3_0:
264 ; SOFT-NEXT: .long 2147483647 @ 0x7fffffff
266 ; VFP-LABEL: stest_f32i32:
267 ; VFP: @ %bb.0: @ %entry
268 ; VFP-NEXT: vcvt.s32.f32 s0, s0
269 ; VFP-NEXT: vmov r0, s0
272 %conv = fptosi float %x to i64
273 %0 = icmp slt i64 %conv, 2147483647
274 %spec.store.select = select i1 %0, i64 %conv, i64 2147483647
275 %1 = icmp sgt i64 %spec.store.select, -2147483648
276 %spec.store.select7 = select i1 %1, i64 %spec.store.select, i64 -2147483648
277 %conv6 = trunc i64 %spec.store.select7 to i32
281 define i32 @utest_f32i32(float %x) {
282 ; SOFT-LABEL: utest_f32i32:
283 ; SOFT: @ %bb.0: @ %entry
284 ; SOFT-NEXT: .save {r7, lr}
285 ; SOFT-NEXT: push {r7, lr}
286 ; SOFT-NEXT: bl __aeabi_f2ulz
287 ; SOFT-NEXT: movs r2, #0
288 ; SOFT-NEXT: adds r3, r0, #1
289 ; SOFT-NEXT: sbcs r1, r2
290 ; SOFT-NEXT: blo .LBB4_2
291 ; SOFT-NEXT: @ %bb.1: @ %entry
292 ; SOFT-NEXT: mvns r0, r2
293 ; SOFT-NEXT: .LBB4_2: @ %entry
294 ; SOFT-NEXT: pop {r7, pc}
296 ; VFP-LABEL: utest_f32i32:
297 ; VFP: @ %bb.0: @ %entry
298 ; VFP-NEXT: vcvt.u32.f32 s0, s0
299 ; VFP-NEXT: vmov r0, s0
302 %conv = fptoui float %x to i64
303 %0 = icmp ult i64 %conv, 4294967295
304 %spec.store.select = select i1 %0, i64 %conv, i64 4294967295
305 %conv6 = trunc i64 %spec.store.select to i32
309 define i32 @ustest_f32i32(float %x) {
310 ; SOFT-LABEL: ustest_f32i32:
311 ; SOFT: @ %bb.0: @ %entry
312 ; SOFT-NEXT: .save {r4, lr}
313 ; SOFT-NEXT: push {r4, lr}
314 ; SOFT-NEXT: bl __aeabi_f2lz
315 ; SOFT-NEXT: movs r2, #1
316 ; SOFT-NEXT: movs r3, #0
317 ; SOFT-NEXT: adds r4, r0, #1
318 ; SOFT-NEXT: mov r4, r1
319 ; SOFT-NEXT: sbcs r4, r3
320 ; SOFT-NEXT: mov r4, r2
321 ; SOFT-NEXT: bge .LBB5_7
322 ; SOFT-NEXT: @ %bb.1: @ %entry
323 ; SOFT-NEXT: cmp r4, #0
324 ; SOFT-NEXT: beq .LBB5_8
325 ; SOFT-NEXT: .LBB5_2: @ %entry
326 ; SOFT-NEXT: cmp r4, #0
327 ; SOFT-NEXT: bne .LBB5_4
328 ; SOFT-NEXT: .LBB5_3: @ %entry
329 ; SOFT-NEXT: mvns r0, r3
330 ; SOFT-NEXT: .LBB5_4: @ %entry
331 ; SOFT-NEXT: rsbs r4, r0, #0
332 ; SOFT-NEXT: mov r4, r3
333 ; SOFT-NEXT: sbcs r4, r1
334 ; SOFT-NEXT: bge .LBB5_9
335 ; SOFT-NEXT: @ %bb.5: @ %entry
336 ; SOFT-NEXT: cmp r2, #0
337 ; SOFT-NEXT: beq .LBB5_10
338 ; SOFT-NEXT: .LBB5_6: @ %entry
339 ; SOFT-NEXT: pop {r4, pc}
340 ; SOFT-NEXT: .LBB5_7: @ %entry
341 ; SOFT-NEXT: mov r4, r3
342 ; SOFT-NEXT: cmp r4, #0
343 ; SOFT-NEXT: bne .LBB5_2
344 ; SOFT-NEXT: .LBB5_8: @ %entry
345 ; SOFT-NEXT: mov r1, r3
346 ; SOFT-NEXT: cmp r4, #0
347 ; SOFT-NEXT: beq .LBB5_3
348 ; SOFT-NEXT: b .LBB5_4
349 ; SOFT-NEXT: .LBB5_9: @ %entry
350 ; SOFT-NEXT: mov r2, r3
351 ; SOFT-NEXT: cmp r2, #0
352 ; SOFT-NEXT: bne .LBB5_6
353 ; SOFT-NEXT: .LBB5_10: @ %entry
354 ; SOFT-NEXT: mov r0, r2
355 ; SOFT-NEXT: pop {r4, pc}
357 ; VFP-LABEL: ustest_f32i32:
358 ; VFP: @ %bb.0: @ %entry
359 ; VFP-NEXT: vcvt.u32.f32 s0, s0
360 ; VFP-NEXT: vmov r0, s0
363 %conv = fptosi float %x to i64
364 %0 = icmp slt i64 %conv, 4294967295
365 %spec.store.select = select i1 %0, i64 %conv, i64 4294967295
366 %1 = icmp sgt i64 %spec.store.select, 0
367 %spec.store.select7 = select i1 %1, i64 %spec.store.select, i64 0
368 %conv6 = trunc i64 %spec.store.select7 to i32
372 define i32 @stest_f16i32(half %x) {
373 ; SOFT-LABEL: stest_f16i32:
374 ; SOFT: @ %bb.0: @ %entry
375 ; SOFT-NEXT: .save {r4, r5, r7, lr}
376 ; SOFT-NEXT: push {r4, r5, r7, lr}
377 ; SOFT-NEXT: uxth r0, r0
378 ; SOFT-NEXT: bl __aeabi_h2f
379 ; SOFT-NEXT: bl __aeabi_f2lz
380 ; SOFT-NEXT: movs r2, #1
381 ; SOFT-NEXT: movs r3, #0
382 ; SOFT-NEXT: ldr r4, .LCPI6_0
383 ; SOFT-NEXT: subs r5, r0, r4
384 ; SOFT-NEXT: mov r5, r1
385 ; SOFT-NEXT: sbcs r5, r3
386 ; SOFT-NEXT: mov r5, r2
387 ; SOFT-NEXT: bge .LBB6_7
388 ; SOFT-NEXT: @ %bb.1: @ %entry
389 ; SOFT-NEXT: cmp r5, #0
390 ; SOFT-NEXT: beq .LBB6_8
391 ; SOFT-NEXT: .LBB6_2: @ %entry
392 ; SOFT-NEXT: cmp r5, #0
393 ; SOFT-NEXT: bne .LBB6_4
394 ; SOFT-NEXT: .LBB6_3: @ %entry
395 ; SOFT-NEXT: mov r0, r4
396 ; SOFT-NEXT: .LBB6_4: @ %entry
397 ; SOFT-NEXT: mvns r3, r3
398 ; SOFT-NEXT: lsls r2, r2, #31
399 ; SOFT-NEXT: subs r4, r2, r0
400 ; SOFT-NEXT: sbcs r3, r1
401 ; SOFT-NEXT: blt .LBB6_6
402 ; SOFT-NEXT: @ %bb.5: @ %entry
403 ; SOFT-NEXT: mov r0, r2
404 ; SOFT-NEXT: .LBB6_6: @ %entry
405 ; SOFT-NEXT: pop {r4, r5, r7, pc}
406 ; SOFT-NEXT: .LBB6_7: @ %entry
407 ; SOFT-NEXT: mov r5, r3
408 ; SOFT-NEXT: cmp r5, #0
409 ; SOFT-NEXT: bne .LBB6_2
410 ; SOFT-NEXT: .LBB6_8: @ %entry
411 ; SOFT-NEXT: mov r1, r3
412 ; SOFT-NEXT: cmp r5, #0
413 ; SOFT-NEXT: beq .LBB6_3
414 ; SOFT-NEXT: b .LBB6_4
415 ; SOFT-NEXT: .p2align 2
416 ; SOFT-NEXT: @ %bb.9:
417 ; SOFT-NEXT: .LCPI6_0:
418 ; SOFT-NEXT: .long 2147483647 @ 0x7fffffff
420 ; VFP2-LABEL: stest_f16i32:
421 ; VFP2: @ %bb.0: @ %entry
422 ; VFP2-NEXT: .save {r7, lr}
423 ; VFP2-NEXT: push {r7, lr}
424 ; VFP2-NEXT: vmov r0, s0
425 ; VFP2-NEXT: bl __aeabi_h2f
426 ; VFP2-NEXT: vmov s0, r0
427 ; VFP2-NEXT: vcvt.s32.f32 s0, s0
428 ; VFP2-NEXT: vmov r0, s0
429 ; VFP2-NEXT: pop {r7, pc}
431 ; FULL-LABEL: stest_f16i32:
432 ; FULL: @ %bb.0: @ %entry
433 ; FULL-NEXT: vcvt.s32.f16 s0, s0
434 ; FULL-NEXT: vmov r0, s0
437 %conv = fptosi half %x to i64
438 %0 = icmp slt i64 %conv, 2147483647
439 %spec.store.select = select i1 %0, i64 %conv, i64 2147483647
440 %1 = icmp sgt i64 %spec.store.select, -2147483648
441 %spec.store.select7 = select i1 %1, i64 %spec.store.select, i64 -2147483648
442 %conv6 = trunc i64 %spec.store.select7 to i32
446 define i32 @utesth_f16i32(half %x) {
447 ; SOFT-LABEL: utesth_f16i32:
448 ; SOFT: @ %bb.0: @ %entry
449 ; SOFT-NEXT: .save {r7, lr}
450 ; SOFT-NEXT: push {r7, lr}
451 ; SOFT-NEXT: uxth r0, r0
452 ; SOFT-NEXT: bl __aeabi_h2f
453 ; SOFT-NEXT: bl __aeabi_f2ulz
454 ; SOFT-NEXT: movs r2, #0
455 ; SOFT-NEXT: adds r3, r0, #1
456 ; SOFT-NEXT: sbcs r1, r2
457 ; SOFT-NEXT: blo .LBB7_2
458 ; SOFT-NEXT: @ %bb.1: @ %entry
459 ; SOFT-NEXT: mvns r0, r2
460 ; SOFT-NEXT: .LBB7_2: @ %entry
461 ; SOFT-NEXT: pop {r7, pc}
463 ; VFP2-LABEL: utesth_f16i32:
464 ; VFP2: @ %bb.0: @ %entry
465 ; VFP2-NEXT: .save {r7, lr}
466 ; VFP2-NEXT: push {r7, lr}
467 ; VFP2-NEXT: vmov r0, s0
468 ; VFP2-NEXT: bl __aeabi_h2f
469 ; VFP2-NEXT: vmov s0, r0
470 ; VFP2-NEXT: vcvt.u32.f32 s0, s0
471 ; VFP2-NEXT: vmov r0, s0
472 ; VFP2-NEXT: pop {r7, pc}
474 ; FULL-LABEL: utesth_f16i32:
475 ; FULL: @ %bb.0: @ %entry
476 ; FULL-NEXT: vcvt.u32.f16 s0, s0
477 ; FULL-NEXT: vmov r0, s0
480 %conv = fptoui half %x to i64
481 %0 = icmp ult i64 %conv, 4294967295
482 %spec.store.select = select i1 %0, i64 %conv, i64 4294967295
483 %conv6 = trunc i64 %spec.store.select to i32
487 define i32 @ustest_f16i32(half %x) {
488 ; SOFT-LABEL: ustest_f16i32:
489 ; SOFT: @ %bb.0: @ %entry
490 ; SOFT-NEXT: .save {r4, lr}
491 ; SOFT-NEXT: push {r4, lr}
492 ; SOFT-NEXT: uxth r0, r0
493 ; SOFT-NEXT: bl __aeabi_h2f
494 ; SOFT-NEXT: bl __aeabi_f2lz
495 ; SOFT-NEXT: movs r2, #1
496 ; SOFT-NEXT: movs r3, #0
497 ; SOFT-NEXT: adds r4, r0, #1
498 ; SOFT-NEXT: mov r4, r1
499 ; SOFT-NEXT: sbcs r4, r3
500 ; SOFT-NEXT: mov r4, r2
501 ; SOFT-NEXT: bge .LBB8_7
502 ; SOFT-NEXT: @ %bb.1: @ %entry
503 ; SOFT-NEXT: cmp r4, #0
504 ; SOFT-NEXT: beq .LBB8_8
505 ; SOFT-NEXT: .LBB8_2: @ %entry
506 ; SOFT-NEXT: cmp r4, #0
507 ; SOFT-NEXT: bne .LBB8_4
508 ; SOFT-NEXT: .LBB8_3: @ %entry
509 ; SOFT-NEXT: mvns r0, r3
510 ; SOFT-NEXT: .LBB8_4: @ %entry
511 ; SOFT-NEXT: rsbs r4, r0, #0
512 ; SOFT-NEXT: mov r4, r3
513 ; SOFT-NEXT: sbcs r4, r1
514 ; SOFT-NEXT: bge .LBB8_9
515 ; SOFT-NEXT: @ %bb.5: @ %entry
516 ; SOFT-NEXT: cmp r2, #0
517 ; SOFT-NEXT: beq .LBB8_10
518 ; SOFT-NEXT: .LBB8_6: @ %entry
519 ; SOFT-NEXT: pop {r4, pc}
520 ; SOFT-NEXT: .LBB8_7: @ %entry
521 ; SOFT-NEXT: mov r4, r3
522 ; SOFT-NEXT: cmp r4, #0
523 ; SOFT-NEXT: bne .LBB8_2
524 ; SOFT-NEXT: .LBB8_8: @ %entry
525 ; SOFT-NEXT: mov r1, r3
526 ; SOFT-NEXT: cmp r4, #0
527 ; SOFT-NEXT: beq .LBB8_3
528 ; SOFT-NEXT: b .LBB8_4
529 ; SOFT-NEXT: .LBB8_9: @ %entry
530 ; SOFT-NEXT: mov r2, r3
531 ; SOFT-NEXT: cmp r2, #0
532 ; SOFT-NEXT: bne .LBB8_6
533 ; SOFT-NEXT: .LBB8_10: @ %entry
534 ; SOFT-NEXT: mov r0, r2
535 ; SOFT-NEXT: pop {r4, pc}
537 ; VFP2-LABEL: ustest_f16i32:
538 ; VFP2: @ %bb.0: @ %entry
539 ; VFP2-NEXT: .save {r7, lr}
540 ; VFP2-NEXT: push {r7, lr}
541 ; VFP2-NEXT: vmov r0, s0
542 ; VFP2-NEXT: bl __aeabi_h2f
543 ; VFP2-NEXT: vmov s0, r0
544 ; VFP2-NEXT: vcvt.u32.f32 s0, s0
545 ; VFP2-NEXT: vmov r0, s0
546 ; VFP2-NEXT: pop {r7, pc}
548 ; FULL-LABEL: ustest_f16i32:
549 ; FULL: @ %bb.0: @ %entry
550 ; FULL-NEXT: vcvt.u32.f16 s0, s0
551 ; FULL-NEXT: vmov r0, s0
554 %conv = fptosi half %x to i64
555 %0 = icmp slt i64 %conv, 4294967295
556 %spec.store.select = select i1 %0, i64 %conv, i64 4294967295
557 %1 = icmp sgt i64 %spec.store.select, 0
558 %spec.store.select7 = select i1 %1, i64 %spec.store.select, i64 0
559 %conv6 = trunc i64 %spec.store.select7 to i32
565 define i16 @stest_f64i16(double %x) {
566 ; SOFT-LABEL: stest_f64i16:
567 ; SOFT: @ %bb.0: @ %entry
568 ; SOFT-NEXT: .save {r7, lr}
569 ; SOFT-NEXT: push {r7, lr}
570 ; SOFT-NEXT: bl __aeabi_d2iz
571 ; SOFT-NEXT: ldr r1, .LCPI9_0
572 ; SOFT-NEXT: cmp r0, r1
573 ; SOFT-NEXT: blt .LBB9_2
574 ; SOFT-NEXT: @ %bb.1: @ %entry
575 ; SOFT-NEXT: mov r0, r1
576 ; SOFT-NEXT: .LBB9_2: @ %entry
577 ; SOFT-NEXT: ldr r1, .LCPI9_1
578 ; SOFT-NEXT: cmp r0, r1
579 ; SOFT-NEXT: bgt .LBB9_4
580 ; SOFT-NEXT: @ %bb.3: @ %entry
581 ; SOFT-NEXT: mov r0, r1
582 ; SOFT-NEXT: .LBB9_4: @ %entry
583 ; SOFT-NEXT: pop {r7, pc}
584 ; SOFT-NEXT: .p2align 2
585 ; SOFT-NEXT: @ %bb.5:
586 ; SOFT-NEXT: .LCPI9_0:
587 ; SOFT-NEXT: .long 32767 @ 0x7fff
588 ; SOFT-NEXT: .LCPI9_1:
589 ; SOFT-NEXT: .long 4294934528 @ 0xffff8000
591 ; VFP2-LABEL: stest_f64i16:
592 ; VFP2: @ %bb.0: @ %entry
593 ; VFP2-NEXT: .save {r7, lr}
594 ; VFP2-NEXT: push {r7, lr}
595 ; VFP2-NEXT: vmov r0, r1, d0
596 ; VFP2-NEXT: bl __aeabi_d2iz
597 ; VFP2-NEXT: ssat r0, #16, r0
598 ; VFP2-NEXT: pop {r7, pc}
600 ; FULL-LABEL: stest_f64i16:
601 ; FULL: @ %bb.0: @ %entry
602 ; FULL-NEXT: vcvt.s32.f64 s0, d0
603 ; FULL-NEXT: vmov r0, s0
604 ; FULL-NEXT: ssat r0, #16, r0
607 %conv = fptosi double %x to i32
608 %0 = icmp slt i32 %conv, 32767
609 %spec.store.select = select i1 %0, i32 %conv, i32 32767
610 %1 = icmp sgt i32 %spec.store.select, -32768
611 %spec.store.select7 = select i1 %1, i32 %spec.store.select, i32 -32768
612 %conv6 = trunc i32 %spec.store.select7 to i16
616 define i16 @utest_f64i16(double %x) {
617 ; SOFT-LABEL: utest_f64i16:
618 ; SOFT: @ %bb.0: @ %entry
619 ; SOFT-NEXT: .save {r7, lr}
620 ; SOFT-NEXT: push {r7, lr}
621 ; SOFT-NEXT: bl __aeabi_d2uiz
622 ; SOFT-NEXT: ldr r1, .LCPI10_0
623 ; SOFT-NEXT: cmp r0, r1
624 ; SOFT-NEXT: blo .LBB10_2
625 ; SOFT-NEXT: @ %bb.1: @ %entry
626 ; SOFT-NEXT: mov r0, r1
627 ; SOFT-NEXT: .LBB10_2: @ %entry
628 ; SOFT-NEXT: pop {r7, pc}
629 ; SOFT-NEXT: .p2align 2
630 ; SOFT-NEXT: @ %bb.3:
631 ; SOFT-NEXT: .LCPI10_0:
632 ; SOFT-NEXT: .long 65535 @ 0xffff
634 ; VFP2-LABEL: utest_f64i16:
635 ; VFP2: @ %bb.0: @ %entry
636 ; VFP2-NEXT: .save {r7, lr}
637 ; VFP2-NEXT: push {r7, lr}
638 ; VFP2-NEXT: vmov r0, r1, d0
639 ; VFP2-NEXT: bl __aeabi_d2uiz
640 ; VFP2-NEXT: movw r1, #65535
641 ; VFP2-NEXT: cmp r0, r1
643 ; VFP2-NEXT: movhs r0, r1
644 ; VFP2-NEXT: pop {r7, pc}
646 ; FULL-LABEL: utest_f64i16:
647 ; FULL: @ %bb.0: @ %entry
648 ; FULL-NEXT: vcvt.u32.f64 s0, d0
649 ; FULL-NEXT: movw r1, #65535
650 ; FULL-NEXT: vmov r0, s0
651 ; FULL-NEXT: cmp r0, r1
652 ; FULL-NEXT: csel r0, r0, r1, lo
655 %conv = fptoui double %x to i32
656 %0 = icmp ult i32 %conv, 65535
657 %spec.store.select = select i1 %0, i32 %conv, i32 65535
658 %conv6 = trunc i32 %spec.store.select to i16
662 define i16 @ustest_f64i16(double %x) {
663 ; SOFT-LABEL: ustest_f64i16:
664 ; SOFT: @ %bb.0: @ %entry
665 ; SOFT-NEXT: .save {r7, lr}
666 ; SOFT-NEXT: push {r7, lr}
667 ; SOFT-NEXT: bl __aeabi_d2iz
668 ; SOFT-NEXT: ldr r1, .LCPI11_0
669 ; SOFT-NEXT: cmp r0, r1
670 ; SOFT-NEXT: blt .LBB11_2
671 ; SOFT-NEXT: @ %bb.1: @ %entry
672 ; SOFT-NEXT: mov r0, r1
673 ; SOFT-NEXT: .LBB11_2: @ %entry
674 ; SOFT-NEXT: asrs r1, r0, #31
675 ; SOFT-NEXT: bics r0, r1
676 ; SOFT-NEXT: pop {r7, pc}
677 ; SOFT-NEXT: .p2align 2
678 ; SOFT-NEXT: @ %bb.3:
679 ; SOFT-NEXT: .LCPI11_0:
680 ; SOFT-NEXT: .long 65535 @ 0xffff
682 ; VFP2-LABEL: ustest_f64i16:
683 ; VFP2: @ %bb.0: @ %entry
684 ; VFP2-NEXT: .save {r7, lr}
685 ; VFP2-NEXT: push {r7, lr}
686 ; VFP2-NEXT: vmov r0, r1, d0
687 ; VFP2-NEXT: bl __aeabi_d2iz
688 ; VFP2-NEXT: usat r0, #16, r0
689 ; VFP2-NEXT: pop {r7, pc}
691 ; FULL-LABEL: ustest_f64i16:
692 ; FULL: @ %bb.0: @ %entry
693 ; FULL-NEXT: vcvt.s32.f64 s0, d0
694 ; FULL-NEXT: vmov r0, s0
695 ; FULL-NEXT: usat r0, #16, r0
698 %conv = fptosi double %x to i32
699 %0 = icmp slt i32 %conv, 65535
700 %spec.store.select = select i1 %0, i32 %conv, i32 65535
701 %1 = icmp sgt i32 %spec.store.select, 0
702 %spec.store.select7 = select i1 %1, i32 %spec.store.select, i32 0
703 %conv6 = trunc i32 %spec.store.select7 to i16
707 define i16 @stest_f32i16(float %x) {
708 ; SOFT-LABEL: stest_f32i16:
709 ; SOFT: @ %bb.0: @ %entry
710 ; SOFT-NEXT: .save {r7, lr}
711 ; SOFT-NEXT: push {r7, lr}
712 ; SOFT-NEXT: bl __aeabi_f2iz
713 ; SOFT-NEXT: ldr r1, .LCPI12_0
714 ; SOFT-NEXT: cmp r0, r1
715 ; SOFT-NEXT: blt .LBB12_2
716 ; SOFT-NEXT: @ %bb.1: @ %entry
717 ; SOFT-NEXT: mov r0, r1
718 ; SOFT-NEXT: .LBB12_2: @ %entry
719 ; SOFT-NEXT: ldr r1, .LCPI12_1
720 ; SOFT-NEXT: cmp r0, r1
721 ; SOFT-NEXT: bgt .LBB12_4
722 ; SOFT-NEXT: @ %bb.3: @ %entry
723 ; SOFT-NEXT: mov r0, r1
724 ; SOFT-NEXT: .LBB12_4: @ %entry
725 ; SOFT-NEXT: pop {r7, pc}
726 ; SOFT-NEXT: .p2align 2
727 ; SOFT-NEXT: @ %bb.5:
728 ; SOFT-NEXT: .LCPI12_0:
729 ; SOFT-NEXT: .long 32767 @ 0x7fff
730 ; SOFT-NEXT: .LCPI12_1:
731 ; SOFT-NEXT: .long 4294934528 @ 0xffff8000
733 ; VFP-LABEL: stest_f32i16:
734 ; VFP: @ %bb.0: @ %entry
735 ; VFP-NEXT: vcvt.s32.f32 s0, s0
736 ; VFP-NEXT: vmov r0, s0
737 ; VFP-NEXT: ssat r0, #16, r0
740 %conv = fptosi float %x to i32
741 %0 = icmp slt i32 %conv, 32767
742 %spec.store.select = select i1 %0, i32 %conv, i32 32767
743 %1 = icmp sgt i32 %spec.store.select, -32768
744 %spec.store.select7 = select i1 %1, i32 %spec.store.select, i32 -32768
745 %conv6 = trunc i32 %spec.store.select7 to i16
749 define i16 @utest_f32i16(float %x) {
750 ; SOFT-LABEL: utest_f32i16:
751 ; SOFT: @ %bb.0: @ %entry
752 ; SOFT-NEXT: .save {r7, lr}
753 ; SOFT-NEXT: push {r7, lr}
754 ; SOFT-NEXT: bl __aeabi_f2uiz
755 ; SOFT-NEXT: ldr r1, .LCPI13_0
756 ; SOFT-NEXT: cmp r0, r1
757 ; SOFT-NEXT: blo .LBB13_2
758 ; SOFT-NEXT: @ %bb.1: @ %entry
759 ; SOFT-NEXT: mov r0, r1
760 ; SOFT-NEXT: .LBB13_2: @ %entry
761 ; SOFT-NEXT: pop {r7, pc}
762 ; SOFT-NEXT: .p2align 2
763 ; SOFT-NEXT: @ %bb.3:
764 ; SOFT-NEXT: .LCPI13_0:
765 ; SOFT-NEXT: .long 65535 @ 0xffff
767 ; VFP2-LABEL: utest_f32i16:
768 ; VFP2: @ %bb.0: @ %entry
769 ; VFP2-NEXT: vcvt.u32.f32 s0, s0
770 ; VFP2-NEXT: movw r0, #65535
771 ; VFP2-NEXT: vmov r1, s0
772 ; VFP2-NEXT: cmp r1, r0
774 ; VFP2-NEXT: movlo r0, r1
777 ; FULL-LABEL: utest_f32i16:
778 ; FULL: @ %bb.0: @ %entry
779 ; FULL-NEXT: vcvt.u32.f32 s0, s0
780 ; FULL-NEXT: movw r1, #65535
781 ; FULL-NEXT: vmov r0, s0
782 ; FULL-NEXT: cmp r0, r1
783 ; FULL-NEXT: csel r0, r0, r1, lo
786 %conv = fptoui float %x to i32
787 %0 = icmp ult i32 %conv, 65535
788 %spec.store.select = select i1 %0, i32 %conv, i32 65535
789 %conv6 = trunc i32 %spec.store.select to i16
793 define i16 @ustest_f32i16(float %x) {
794 ; SOFT-LABEL: ustest_f32i16:
795 ; SOFT: @ %bb.0: @ %entry
796 ; SOFT-NEXT: .save {r7, lr}
797 ; SOFT-NEXT: push {r7, lr}
798 ; SOFT-NEXT: bl __aeabi_f2iz
799 ; SOFT-NEXT: ldr r1, .LCPI14_0
800 ; SOFT-NEXT: cmp r0, r1
801 ; SOFT-NEXT: blt .LBB14_2
802 ; SOFT-NEXT: @ %bb.1: @ %entry
803 ; SOFT-NEXT: mov r0, r1
804 ; SOFT-NEXT: .LBB14_2: @ %entry
805 ; SOFT-NEXT: asrs r1, r0, #31
806 ; SOFT-NEXT: bics r0, r1
807 ; SOFT-NEXT: pop {r7, pc}
808 ; SOFT-NEXT: .p2align 2
809 ; SOFT-NEXT: @ %bb.3:
810 ; SOFT-NEXT: .LCPI14_0:
811 ; SOFT-NEXT: .long 65535 @ 0xffff
813 ; VFP-LABEL: ustest_f32i16:
814 ; VFP: @ %bb.0: @ %entry
815 ; VFP-NEXT: vcvt.s32.f32 s0, s0
816 ; VFP-NEXT: vmov r0, s0
817 ; VFP-NEXT: usat r0, #16, r0
820 %conv = fptosi float %x to i32
821 %0 = icmp slt i32 %conv, 65535
822 %spec.store.select = select i1 %0, i32 %conv, i32 65535
823 %1 = icmp sgt i32 %spec.store.select, 0
824 %spec.store.select7 = select i1 %1, i32 %spec.store.select, i32 0
825 %conv6 = trunc i32 %spec.store.select7 to i16
829 define i16 @stest_f16i16(half %x) {
830 ; SOFT-LABEL: stest_f16i16:
831 ; SOFT: @ %bb.0: @ %entry
832 ; SOFT-NEXT: .save {r7, lr}
833 ; SOFT-NEXT: push {r7, lr}
834 ; SOFT-NEXT: uxth r0, r0
835 ; SOFT-NEXT: bl __aeabi_h2f
836 ; SOFT-NEXT: bl __aeabi_f2iz
837 ; SOFT-NEXT: ldr r1, .LCPI15_0
838 ; SOFT-NEXT: cmp r0, r1
839 ; SOFT-NEXT: blt .LBB15_2
840 ; SOFT-NEXT: @ %bb.1: @ %entry
841 ; SOFT-NEXT: mov r0, r1
842 ; SOFT-NEXT: .LBB15_2: @ %entry
843 ; SOFT-NEXT: ldr r1, .LCPI15_1
844 ; SOFT-NEXT: cmp r0, r1
845 ; SOFT-NEXT: bgt .LBB15_4
846 ; SOFT-NEXT: @ %bb.3: @ %entry
847 ; SOFT-NEXT: mov r0, r1
848 ; SOFT-NEXT: .LBB15_4: @ %entry
849 ; SOFT-NEXT: pop {r7, pc}
850 ; SOFT-NEXT: .p2align 2
851 ; SOFT-NEXT: @ %bb.5:
852 ; SOFT-NEXT: .LCPI15_0:
853 ; SOFT-NEXT: .long 32767 @ 0x7fff
854 ; SOFT-NEXT: .LCPI15_1:
855 ; SOFT-NEXT: .long 4294934528 @ 0xffff8000
857 ; VFP2-LABEL: stest_f16i16:
858 ; VFP2: @ %bb.0: @ %entry
859 ; VFP2-NEXT: .save {r7, lr}
860 ; VFP2-NEXT: push {r7, lr}
861 ; VFP2-NEXT: vmov r0, s0
862 ; VFP2-NEXT: bl __aeabi_h2f
863 ; VFP2-NEXT: vmov s0, r0
864 ; VFP2-NEXT: vcvt.s32.f32 s0, s0
865 ; VFP2-NEXT: vmov r0, s0
866 ; VFP2-NEXT: ssat r0, #16, r0
867 ; VFP2-NEXT: pop {r7, pc}
869 ; FULL-LABEL: stest_f16i16:
870 ; FULL: @ %bb.0: @ %entry
871 ; FULL-NEXT: vcvt.s32.f16 s0, s0
872 ; FULL-NEXT: vmov r0, s0
873 ; FULL-NEXT: ssat r0, #16, r0
876 %conv = fptosi half %x to i32
877 %0 = icmp slt i32 %conv, 32767
878 %spec.store.select = select i1 %0, i32 %conv, i32 32767
879 %1 = icmp sgt i32 %spec.store.select, -32768
880 %spec.store.select7 = select i1 %1, i32 %spec.store.select, i32 -32768
881 %conv6 = trunc i32 %spec.store.select7 to i16
885 define i16 @utesth_f16i16(half %x) {
886 ; SOFT-LABEL: utesth_f16i16:
887 ; SOFT: @ %bb.0: @ %entry
888 ; SOFT-NEXT: .save {r7, lr}
889 ; SOFT-NEXT: push {r7, lr}
890 ; SOFT-NEXT: uxth r0, r0
891 ; SOFT-NEXT: bl __aeabi_h2f
892 ; SOFT-NEXT: bl __aeabi_f2uiz
893 ; SOFT-NEXT: ldr r1, .LCPI16_0
894 ; SOFT-NEXT: cmp r0, r1
895 ; SOFT-NEXT: blo .LBB16_2
896 ; SOFT-NEXT: @ %bb.1: @ %entry
897 ; SOFT-NEXT: mov r0, r1
898 ; SOFT-NEXT: .LBB16_2: @ %entry
899 ; SOFT-NEXT: pop {r7, pc}
900 ; SOFT-NEXT: .p2align 2
901 ; SOFT-NEXT: @ %bb.3:
902 ; SOFT-NEXT: .LCPI16_0:
903 ; SOFT-NEXT: .long 65535 @ 0xffff
905 ; VFP2-LABEL: utesth_f16i16:
906 ; VFP2: @ %bb.0: @ %entry
907 ; VFP2-NEXT: .save {r7, lr}
908 ; VFP2-NEXT: push {r7, lr}
909 ; VFP2-NEXT: vmov r0, s0
910 ; VFP2-NEXT: bl __aeabi_h2f
911 ; VFP2-NEXT: vmov s0, r0
912 ; VFP2-NEXT: movw r0, #65535
913 ; VFP2-NEXT: vcvt.u32.f32 s0, s0
914 ; VFP2-NEXT: vmov r1, s0
915 ; VFP2-NEXT: cmp r1, r0
917 ; VFP2-NEXT: movlo r0, r1
918 ; VFP2-NEXT: pop {r7, pc}
920 ; FULL-LABEL: utesth_f16i16:
921 ; FULL: @ %bb.0: @ %entry
922 ; FULL-NEXT: vcvt.u32.f16 s0, s0
923 ; FULL-NEXT: movw r1, #65535
924 ; FULL-NEXT: vmov r0, s0
925 ; FULL-NEXT: cmp r0, r1
926 ; FULL-NEXT: csel r0, r0, r1, lo
929 %conv = fptoui half %x to i32
930 %0 = icmp ult i32 %conv, 65535
931 %spec.store.select = select i1 %0, i32 %conv, i32 65535
932 %conv6 = trunc i32 %spec.store.select to i16
936 define i16 @ustest_f16i16(half %x) {
937 ; SOFT-LABEL: ustest_f16i16:
938 ; SOFT: @ %bb.0: @ %entry
939 ; SOFT-NEXT: .save {r7, lr}
940 ; SOFT-NEXT: push {r7, lr}
941 ; SOFT-NEXT: uxth r0, r0
942 ; SOFT-NEXT: bl __aeabi_h2f
943 ; SOFT-NEXT: bl __aeabi_f2iz
944 ; SOFT-NEXT: ldr r1, .LCPI17_0
945 ; SOFT-NEXT: cmp r0, r1
946 ; SOFT-NEXT: blt .LBB17_2
947 ; SOFT-NEXT: @ %bb.1: @ %entry
948 ; SOFT-NEXT: mov r0, r1
949 ; SOFT-NEXT: .LBB17_2: @ %entry
950 ; SOFT-NEXT: asrs r1, r0, #31
951 ; SOFT-NEXT: bics r0, r1
952 ; SOFT-NEXT: pop {r7, pc}
953 ; SOFT-NEXT: .p2align 2
954 ; SOFT-NEXT: @ %bb.3:
955 ; SOFT-NEXT: .LCPI17_0:
956 ; SOFT-NEXT: .long 65535 @ 0xffff
958 ; VFP2-LABEL: ustest_f16i16:
959 ; VFP2: @ %bb.0: @ %entry
960 ; VFP2-NEXT: .save {r7, lr}
961 ; VFP2-NEXT: push {r7, lr}
962 ; VFP2-NEXT: vmov r0, s0
963 ; VFP2-NEXT: bl __aeabi_h2f
964 ; VFP2-NEXT: vmov s0, r0
965 ; VFP2-NEXT: vcvt.s32.f32 s0, s0
966 ; VFP2-NEXT: vmov r0, s0
967 ; VFP2-NEXT: usat r0, #16, r0
968 ; VFP2-NEXT: pop {r7, pc}
970 ; FULL-LABEL: ustest_f16i16:
971 ; FULL: @ %bb.0: @ %entry
972 ; FULL-NEXT: vcvt.s32.f16 s0, s0
973 ; FULL-NEXT: vmov r0, s0
974 ; FULL-NEXT: usat r0, #16, r0
977 %conv = fptosi half %x to i32
978 %0 = icmp slt i32 %conv, 65535
979 %spec.store.select = select i1 %0, i32 %conv, i32 65535
980 %1 = icmp sgt i32 %spec.store.select, 0
981 %spec.store.select7 = select i1 %1, i32 %spec.store.select, i32 0
982 %conv6 = trunc i32 %spec.store.select7 to i16
988 define i64 @stest_f64i64(double %x) {
989 ; SOFT-LABEL: stest_f64i64:
990 ; SOFT: @ %bb.0: @ %entry
991 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
992 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
993 ; SOFT-NEXT: .pad #12
994 ; SOFT-NEXT: sub sp, #12
995 ; SOFT-NEXT: bl __fixdfti
996 ; SOFT-NEXT: mov r6, r0
997 ; SOFT-NEXT: movs r4, #1
998 ; SOFT-NEXT: movs r5, #0
999 ; SOFT-NEXT: ldr r0, .LCPI18_0
1000 ; SOFT-NEXT: adds r7, r6, #1
1001 ; SOFT-NEXT: mov r7, r1
1002 ; SOFT-NEXT: sbcs r7, r0
1003 ; SOFT-NEXT: mov r7, r2
1004 ; SOFT-NEXT: sbcs r7, r5
1005 ; SOFT-NEXT: mov r7, r3
1006 ; SOFT-NEXT: sbcs r7, r5
1007 ; SOFT-NEXT: mov r7, r4
1008 ; SOFT-NEXT: bge .LBB18_13
1009 ; SOFT-NEXT: @ %bb.1: @ %entry
1010 ; SOFT-NEXT: cmp r7, #0
1011 ; SOFT-NEXT: beq .LBB18_14
1012 ; SOFT-NEXT: .LBB18_2: @ %entry
1013 ; SOFT-NEXT: cmp r7, #0
1014 ; SOFT-NEXT: bne .LBB18_4
1015 ; SOFT-NEXT: .LBB18_3: @ %entry
1016 ; SOFT-NEXT: mov r2, r5
1017 ; SOFT-NEXT: .LBB18_4: @ %entry
1018 ; SOFT-NEXT: str r2, [sp, #8] @ 4-byte Spill
1019 ; SOFT-NEXT: cmp r7, #0
1020 ; SOFT-NEXT: bne .LBB18_6
1021 ; SOFT-NEXT: @ %bb.5: @ %entry
1022 ; SOFT-NEXT: mov r1, r0
1023 ; SOFT-NEXT: .LBB18_6: @ %entry
1024 ; SOFT-NEXT: str r3, [sp, #4] @ 4-byte Spill
1025 ; SOFT-NEXT: mvns r0, r5
1026 ; SOFT-NEXT: cmp r7, #0
1027 ; SOFT-NEXT: bne .LBB18_8
1028 ; SOFT-NEXT: @ %bb.7: @ %entry
1029 ; SOFT-NEXT: mov r6, r0
1030 ; SOFT-NEXT: .LBB18_8: @ %entry
1031 ; SOFT-NEXT: lsls r3, r4, #31
1032 ; SOFT-NEXT: rsbs r7, r6, #0
1033 ; SOFT-NEXT: mov r7, r3
1034 ; SOFT-NEXT: sbcs r7, r1
1035 ; SOFT-NEXT: mov r7, r0
1036 ; SOFT-NEXT: ldr r2, [sp, #8] @ 4-byte Reload
1037 ; SOFT-NEXT: sbcs r7, r2
1038 ; SOFT-NEXT: ldr r2, [sp, #4] @ 4-byte Reload
1039 ; SOFT-NEXT: sbcs r0, r2
1040 ; SOFT-NEXT: bge .LBB18_15
1041 ; SOFT-NEXT: @ %bb.9: @ %entry
1042 ; SOFT-NEXT: cmp r4, #0
1043 ; SOFT-NEXT: beq .LBB18_16
1044 ; SOFT-NEXT: .LBB18_10: @ %entry
1045 ; SOFT-NEXT: cmp r4, #0
1046 ; SOFT-NEXT: bne .LBB18_12
1047 ; SOFT-NEXT: .LBB18_11: @ %entry
1048 ; SOFT-NEXT: mov r1, r3
1049 ; SOFT-NEXT: .LBB18_12: @ %entry
1050 ; SOFT-NEXT: mov r0, r6
1051 ; SOFT-NEXT: add sp, #12
1052 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
1053 ; SOFT-NEXT: .LBB18_13: @ %entry
1054 ; SOFT-NEXT: mov r7, r5
1055 ; SOFT-NEXT: cmp r7, #0
1056 ; SOFT-NEXT: bne .LBB18_2
1057 ; SOFT-NEXT: .LBB18_14: @ %entry
1058 ; SOFT-NEXT: mov r3, r5
1059 ; SOFT-NEXT: cmp r7, #0
1060 ; SOFT-NEXT: beq .LBB18_3
1061 ; SOFT-NEXT: b .LBB18_4
1062 ; SOFT-NEXT: .LBB18_15: @ %entry
1063 ; SOFT-NEXT: mov r4, r5
1064 ; SOFT-NEXT: cmp r4, #0
1065 ; SOFT-NEXT: bne .LBB18_10
1066 ; SOFT-NEXT: .LBB18_16: @ %entry
1067 ; SOFT-NEXT: mov r6, r5
1068 ; SOFT-NEXT: cmp r4, #0
1069 ; SOFT-NEXT: beq .LBB18_11
1070 ; SOFT-NEXT: b .LBB18_12
1071 ; SOFT-NEXT: .p2align 2
1072 ; SOFT-NEXT: @ %bb.17:
1073 ; SOFT-NEXT: .LCPI18_0:
1074 ; SOFT-NEXT: .long 2147483647 @ 0x7fffffff
1076 ; VFP2-LABEL: stest_f64i64:
1077 ; VFP2: @ %bb.0: @ %entry
1078 ; VFP2-NEXT: .save {r4, r5, r7, lr}
1079 ; VFP2-NEXT: push {r4, r5, r7, lr}
1080 ; VFP2-NEXT: bl __fixdfti
1081 ; VFP2-NEXT: subs.w r4, r0, #-1
1082 ; VFP2-NEXT: mvn lr, #-2147483648
1083 ; VFP2-NEXT: sbcs.w r4, r1, lr
1084 ; VFP2-NEXT: mov.w r12, #0
1085 ; VFP2-NEXT: sbcs r4, r2, #0
1086 ; VFP2-NEXT: sbcs r4, r3, #0
1087 ; VFP2-NEXT: mov.w r4, #0
1089 ; VFP2-NEXT: movlt r4, #1
1090 ; VFP2-NEXT: cmp r4, #0
1091 ; VFP2-NEXT: itet eq
1092 ; VFP2-NEXT: moveq r3, r4
1093 ; VFP2-NEXT: movne r4, r2
1094 ; VFP2-NEXT: moveq r1, lr
1095 ; VFP2-NEXT: mov.w r2, #-1
1097 ; VFP2-NEXT: moveq r0, r2
1098 ; VFP2-NEXT: rsbs r5, r0, #0
1099 ; VFP2-NEXT: mov.w lr, #-2147483648
1100 ; VFP2-NEXT: sbcs.w r5, lr, r1
1101 ; VFP2-NEXT: sbcs.w r4, r2, r4
1102 ; VFP2-NEXT: sbcs r2, r3
1103 ; VFP2-NEXT: mov.w r2, #0
1105 ; VFP2-NEXT: movlt r2, #1
1106 ; VFP2-NEXT: cmp r2, #0
1108 ; VFP2-NEXT: moveq r0, r12
1109 ; VFP2-NEXT: moveq r1, lr
1110 ; VFP2-NEXT: pop {r4, r5, r7, pc}
1112 ; FULL-LABEL: stest_f64i64:
1113 ; FULL: @ %bb.0: @ %entry
1114 ; FULL-NEXT: .save {r4, r5, r7, lr}
1115 ; FULL-NEXT: push {r4, r5, r7, lr}
1116 ; FULL-NEXT: bl __fixdfti
1117 ; FULL-NEXT: subs.w lr, r0, #-1
1118 ; FULL-NEXT: mvn r12, #-2147483648
1119 ; FULL-NEXT: sbcs.w lr, r1, r12
1120 ; FULL-NEXT: sbcs lr, r2, #0
1121 ; FULL-NEXT: sbcs lr, r3, #0
1122 ; FULL-NEXT: cset lr, lt
1123 ; FULL-NEXT: cmp.w lr, #0
1124 ; FULL-NEXT: csel r5, r3, lr, ne
1125 ; FULL-NEXT: mov.w r3, #-1
1126 ; FULL-NEXT: csel r0, r0, r3, ne
1127 ; FULL-NEXT: csel r1, r1, r12, ne
1128 ; FULL-NEXT: csel r2, r2, lr, ne
1129 ; FULL-NEXT: rsbs r4, r0, #0
1130 ; FULL-NEXT: mov.w r12, #-2147483648
1131 ; FULL-NEXT: sbcs.w r4, r12, r1
1132 ; FULL-NEXT: sbcs.w r2, r3, r2
1133 ; FULL-NEXT: sbcs.w r2, r3, r5
1134 ; FULL-NEXT: cset r2, lt
1135 ; FULL-NEXT: cmp r2, #0
1137 ; FULL-NEXT: moveq r0, #0
1138 ; FULL-NEXT: csel r1, r1, r12, ne
1139 ; FULL-NEXT: pop {r4, r5, r7, pc}
1141 %conv = fptosi double %x to i128
1142 %0 = icmp slt i128 %conv, 9223372036854775807
1143 %spec.store.select = select i1 %0, i128 %conv, i128 9223372036854775807
1144 %1 = icmp sgt i128 %spec.store.select, -9223372036854775808
1145 %spec.store.select7 = select i1 %1, i128 %spec.store.select, i128 -9223372036854775808
1146 %conv6 = trunc i128 %spec.store.select7 to i64
1150 define i64 @utest_f64i64(double %x) {
1151 ; SOFT-LABEL: utest_f64i64:
1152 ; SOFT: @ %bb.0: @ %entry
1153 ; SOFT-NEXT: .save {r4, lr}
1154 ; SOFT-NEXT: push {r4, lr}
1155 ; SOFT-NEXT: bl __fixunsdfti
1156 ; SOFT-NEXT: movs r4, #0
1157 ; SOFT-NEXT: subs r2, r2, #1
1158 ; SOFT-NEXT: sbcs r3, r4
1159 ; SOFT-NEXT: blo .LBB19_2
1160 ; SOFT-NEXT: @ %bb.1: @ %entry
1161 ; SOFT-NEXT: mov r2, r4
1162 ; SOFT-NEXT: cmp r2, #0
1163 ; SOFT-NEXT: beq .LBB19_3
1164 ; SOFT-NEXT: b .LBB19_4
1165 ; SOFT-NEXT: .LBB19_2:
1166 ; SOFT-NEXT: movs r2, #1
1167 ; SOFT-NEXT: cmp r2, #0
1168 ; SOFT-NEXT: bne .LBB19_4
1169 ; SOFT-NEXT: .LBB19_3: @ %entry
1170 ; SOFT-NEXT: mov r0, r4
1171 ; SOFT-NEXT: .LBB19_4: @ %entry
1172 ; SOFT-NEXT: cmp r2, #0
1173 ; SOFT-NEXT: beq .LBB19_6
1174 ; SOFT-NEXT: @ %bb.5: @ %entry
1175 ; SOFT-NEXT: pop {r4, pc}
1176 ; SOFT-NEXT: .LBB19_6: @ %entry
1177 ; SOFT-NEXT: mov r1, r4
1178 ; SOFT-NEXT: pop {r4, pc}
1180 ; VFP2-LABEL: utest_f64i64:
1181 ; VFP2: @ %bb.0: @ %entry
1182 ; VFP2-NEXT: .save {r7, lr}
1183 ; VFP2-NEXT: push {r7, lr}
1184 ; VFP2-NEXT: bl __fixunsdfti
1185 ; VFP2-NEXT: subs r2, #1
1186 ; VFP2-NEXT: mov.w r12, #0
1187 ; VFP2-NEXT: sbcs r2, r3, #0
1188 ; VFP2-NEXT: mov.w r2, #0
1190 ; VFP2-NEXT: movlo r2, #1
1191 ; VFP2-NEXT: cmp r2, #0
1193 ; VFP2-NEXT: moveq r0, r12
1194 ; VFP2-NEXT: moveq r1, r12
1195 ; VFP2-NEXT: pop {r7, pc}
1197 ; FULL-LABEL: utest_f64i64:
1198 ; FULL: @ %bb.0: @ %entry
1199 ; FULL-NEXT: .save {r7, lr}
1200 ; FULL-NEXT: push {r7, lr}
1201 ; FULL-NEXT: bl __fixunsdfti
1202 ; FULL-NEXT: subs r2, #1
1203 ; FULL-NEXT: sbcs r2, r3, #0
1204 ; FULL-NEXT: mov.w r3, #0
1205 ; FULL-NEXT: cset r2, lo
1206 ; FULL-NEXT: cmp r2, #0
1207 ; FULL-NEXT: csel r0, r0, r3, ne
1208 ; FULL-NEXT: csel r1, r1, r3, ne
1209 ; FULL-NEXT: pop {r7, pc}
1211 %conv = fptoui double %x to i128
1212 %0 = icmp ult i128 %conv, 18446744073709551616
1213 %spec.store.select = select i1 %0, i128 %conv, i128 18446744073709551616
1214 %conv6 = trunc i128 %spec.store.select to i64
1218 define i64 @ustest_f64i64(double %x) {
1219 ; SOFT-LABEL: ustest_f64i64:
1220 ; SOFT: @ %bb.0: @ %entry
1221 ; SOFT-NEXT: .save {r4, r5, r6, lr}
1222 ; SOFT-NEXT: push {r4, r5, r6, lr}
1223 ; SOFT-NEXT: bl __fixdfti
1224 ; SOFT-NEXT: movs r4, #1
1225 ; SOFT-NEXT: movs r5, #0
1226 ; SOFT-NEXT: subs r6, r2, #1
1227 ; SOFT-NEXT: mov r6, r3
1228 ; SOFT-NEXT: sbcs r6, r5
1229 ; SOFT-NEXT: mov r6, r4
1230 ; SOFT-NEXT: bge .LBB20_10
1231 ; SOFT-NEXT: @ %bb.1: @ %entry
1232 ; SOFT-NEXT: cmp r6, #0
1233 ; SOFT-NEXT: beq .LBB20_11
1234 ; SOFT-NEXT: .LBB20_2: @ %entry
1235 ; SOFT-NEXT: cmp r6, #0
1236 ; SOFT-NEXT: beq .LBB20_12
1237 ; SOFT-NEXT: .LBB20_3: @ %entry
1238 ; SOFT-NEXT: cmp r6, #0
1239 ; SOFT-NEXT: beq .LBB20_13
1240 ; SOFT-NEXT: .LBB20_4: @ %entry
1241 ; SOFT-NEXT: cmp r6, #0
1242 ; SOFT-NEXT: bne .LBB20_6
1243 ; SOFT-NEXT: .LBB20_5: @ %entry
1244 ; SOFT-NEXT: mov r0, r5
1245 ; SOFT-NEXT: .LBB20_6: @ %entry
1246 ; SOFT-NEXT: rsbs r6, r0, #0
1247 ; SOFT-NEXT: mov r6, r5
1248 ; SOFT-NEXT: sbcs r6, r1
1249 ; SOFT-NEXT: mov r6, r5
1250 ; SOFT-NEXT: sbcs r6, r2
1251 ; SOFT-NEXT: mov r2, r5
1252 ; SOFT-NEXT: sbcs r2, r3
1253 ; SOFT-NEXT: bge .LBB20_14
1254 ; SOFT-NEXT: @ %bb.7: @ %entry
1255 ; SOFT-NEXT: cmp r4, #0
1256 ; SOFT-NEXT: beq .LBB20_15
1257 ; SOFT-NEXT: .LBB20_8: @ %entry
1258 ; SOFT-NEXT: cmp r4, #0
1259 ; SOFT-NEXT: beq .LBB20_16
1260 ; SOFT-NEXT: .LBB20_9: @ %entry
1261 ; SOFT-NEXT: pop {r4, r5, r6, pc}
1262 ; SOFT-NEXT: .LBB20_10: @ %entry
1263 ; SOFT-NEXT: mov r6, r5
1264 ; SOFT-NEXT: cmp r6, #0
1265 ; SOFT-NEXT: bne .LBB20_2
1266 ; SOFT-NEXT: .LBB20_11: @ %entry
1267 ; SOFT-NEXT: mov r3, r5
1268 ; SOFT-NEXT: cmp r6, #0
1269 ; SOFT-NEXT: bne .LBB20_3
1270 ; SOFT-NEXT: .LBB20_12: @ %entry
1271 ; SOFT-NEXT: mov r2, r4
1272 ; SOFT-NEXT: cmp r6, #0
1273 ; SOFT-NEXT: bne .LBB20_4
1274 ; SOFT-NEXT: .LBB20_13: @ %entry
1275 ; SOFT-NEXT: mov r1, r5
1276 ; SOFT-NEXT: cmp r6, #0
1277 ; SOFT-NEXT: beq .LBB20_5
1278 ; SOFT-NEXT: b .LBB20_6
1279 ; SOFT-NEXT: .LBB20_14: @ %entry
1280 ; SOFT-NEXT: mov r4, r5
1281 ; SOFT-NEXT: cmp r4, #0
1282 ; SOFT-NEXT: bne .LBB20_8
1283 ; SOFT-NEXT: .LBB20_15: @ %entry
1284 ; SOFT-NEXT: mov r0, r4
1285 ; SOFT-NEXT: cmp r4, #0
1286 ; SOFT-NEXT: bne .LBB20_9
1287 ; SOFT-NEXT: .LBB20_16: @ %entry
1288 ; SOFT-NEXT: mov r1, r4
1289 ; SOFT-NEXT: pop {r4, r5, r6, pc}
1291 ; VFP2-LABEL: ustest_f64i64:
1292 ; VFP2: @ %bb.0: @ %entry
1293 ; VFP2-NEXT: .save {r7, lr}
1294 ; VFP2-NEXT: push {r7, lr}
1295 ; VFP2-NEXT: bl __fixdfti
1296 ; VFP2-NEXT: subs.w lr, r2, #1
1297 ; VFP2-NEXT: mov.w r12, #0
1298 ; VFP2-NEXT: sbcs lr, r3, #0
1299 ; VFP2-NEXT: mov.w lr, #0
1301 ; VFP2-NEXT: movlt.w lr, #1
1302 ; VFP2-NEXT: cmp.w lr, #0
1303 ; VFP2-NEXT: itttt eq
1304 ; VFP2-NEXT: moveq r3, r12
1305 ; VFP2-NEXT: moveq r2, #1
1306 ; VFP2-NEXT: moveq r1, r12
1307 ; VFP2-NEXT: moveq r0, r12
1308 ; VFP2-NEXT: rsbs.w lr, r0, #0
1309 ; VFP2-NEXT: sbcs.w lr, r12, r1
1310 ; VFP2-NEXT: sbcs.w r2, r12, r2
1311 ; VFP2-NEXT: sbcs.w r2, r12, r3
1313 ; VFP2-NEXT: movlt.w r12, #1
1314 ; VFP2-NEXT: cmp.w r12, #0
1316 ; VFP2-NEXT: moveq r0, r12
1317 ; VFP2-NEXT: moveq r1, r12
1318 ; VFP2-NEXT: pop {r7, pc}
1320 ; FULL-LABEL: ustest_f64i64:
1321 ; FULL: @ %bb.0: @ %entry
1322 ; FULL-NEXT: .save {r7, lr}
1323 ; FULL-NEXT: push {r7, lr}
1324 ; FULL-NEXT: bl __fixdfti
1325 ; FULL-NEXT: subs.w r12, r2, #1
1326 ; FULL-NEXT: mov.w lr, #0
1327 ; FULL-NEXT: sbcs r12, r3, #0
1328 ; FULL-NEXT: cset r12, lt
1329 ; FULL-NEXT: cmp.w r12, #0
1331 ; FULL-NEXT: moveq r2, #1
1332 ; FULL-NEXT: csel r0, r0, lr, ne
1333 ; FULL-NEXT: csel r12, r3, lr, ne
1334 ; FULL-NEXT: csel r1, r1, lr, ne
1335 ; FULL-NEXT: rsbs r3, r0, #0
1336 ; FULL-NEXT: sbcs.w r3, lr, r1
1337 ; FULL-NEXT: sbcs.w r2, lr, r2
1338 ; FULL-NEXT: sbcs.w r2, lr, r12
1339 ; FULL-NEXT: cset r2, lt
1340 ; FULL-NEXT: cmp r2, #0
1341 ; FULL-NEXT: csel r0, r0, r2, ne
1342 ; FULL-NEXT: csel r1, r1, r2, ne
1343 ; FULL-NEXT: pop {r7, pc}
1345 %conv = fptosi double %x to i128
1346 %0 = icmp slt i128 %conv, 18446744073709551616
1347 %spec.store.select = select i1 %0, i128 %conv, i128 18446744073709551616
1348 %1 = icmp sgt i128 %spec.store.select, 0
1349 %spec.store.select7 = select i1 %1, i128 %spec.store.select, i128 0
1350 %conv6 = trunc i128 %spec.store.select7 to i64
1354 define i64 @stest_f32i64(float %x) {
1355 ; SOFT-LABEL: stest_f32i64:
1356 ; SOFT: @ %bb.0: @ %entry
1357 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
1358 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
1359 ; SOFT-NEXT: .pad #12
1360 ; SOFT-NEXT: sub sp, #12
1361 ; SOFT-NEXT: bl __fixsfti
1362 ; SOFT-NEXT: mov r6, r0
1363 ; SOFT-NEXT: movs r4, #1
1364 ; SOFT-NEXT: movs r5, #0
1365 ; SOFT-NEXT: ldr r0, .LCPI21_0
1366 ; SOFT-NEXT: adds r7, r6, #1
1367 ; SOFT-NEXT: mov r7, r1
1368 ; SOFT-NEXT: sbcs r7, r0
1369 ; SOFT-NEXT: mov r7, r2
1370 ; SOFT-NEXT: sbcs r7, r5
1371 ; SOFT-NEXT: mov r7, r3
1372 ; SOFT-NEXT: sbcs r7, r5
1373 ; SOFT-NEXT: mov r7, r4
1374 ; SOFT-NEXT: bge .LBB21_13
1375 ; SOFT-NEXT: @ %bb.1: @ %entry
1376 ; SOFT-NEXT: cmp r7, #0
1377 ; SOFT-NEXT: beq .LBB21_14
1378 ; SOFT-NEXT: .LBB21_2: @ %entry
1379 ; SOFT-NEXT: cmp r7, #0
1380 ; SOFT-NEXT: bne .LBB21_4
1381 ; SOFT-NEXT: .LBB21_3: @ %entry
1382 ; SOFT-NEXT: mov r2, r5
1383 ; SOFT-NEXT: .LBB21_4: @ %entry
1384 ; SOFT-NEXT: str r2, [sp, #8] @ 4-byte Spill
1385 ; SOFT-NEXT: cmp r7, #0
1386 ; SOFT-NEXT: bne .LBB21_6
1387 ; SOFT-NEXT: @ %bb.5: @ %entry
1388 ; SOFT-NEXT: mov r1, r0
1389 ; SOFT-NEXT: .LBB21_6: @ %entry
1390 ; SOFT-NEXT: str r3, [sp, #4] @ 4-byte Spill
1391 ; SOFT-NEXT: mvns r0, r5
1392 ; SOFT-NEXT: cmp r7, #0
1393 ; SOFT-NEXT: bne .LBB21_8
1394 ; SOFT-NEXT: @ %bb.7: @ %entry
1395 ; SOFT-NEXT: mov r6, r0
1396 ; SOFT-NEXT: .LBB21_8: @ %entry
1397 ; SOFT-NEXT: lsls r3, r4, #31
1398 ; SOFT-NEXT: rsbs r7, r6, #0
1399 ; SOFT-NEXT: mov r7, r3
1400 ; SOFT-NEXT: sbcs r7, r1
1401 ; SOFT-NEXT: mov r7, r0
1402 ; SOFT-NEXT: ldr r2, [sp, #8] @ 4-byte Reload
1403 ; SOFT-NEXT: sbcs r7, r2
1404 ; SOFT-NEXT: ldr r2, [sp, #4] @ 4-byte Reload
1405 ; SOFT-NEXT: sbcs r0, r2
1406 ; SOFT-NEXT: bge .LBB21_15
1407 ; SOFT-NEXT: @ %bb.9: @ %entry
1408 ; SOFT-NEXT: cmp r4, #0
1409 ; SOFT-NEXT: beq .LBB21_16
1410 ; SOFT-NEXT: .LBB21_10: @ %entry
1411 ; SOFT-NEXT: cmp r4, #0
1412 ; SOFT-NEXT: bne .LBB21_12
1413 ; SOFT-NEXT: .LBB21_11: @ %entry
1414 ; SOFT-NEXT: mov r1, r3
1415 ; SOFT-NEXT: .LBB21_12: @ %entry
1416 ; SOFT-NEXT: mov r0, r6
1417 ; SOFT-NEXT: add sp, #12
1418 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
1419 ; SOFT-NEXT: .LBB21_13: @ %entry
1420 ; SOFT-NEXT: mov r7, r5
1421 ; SOFT-NEXT: cmp r7, #0
1422 ; SOFT-NEXT: bne .LBB21_2
1423 ; SOFT-NEXT: .LBB21_14: @ %entry
1424 ; SOFT-NEXT: mov r3, r5
1425 ; SOFT-NEXT: cmp r7, #0
1426 ; SOFT-NEXT: beq .LBB21_3
1427 ; SOFT-NEXT: b .LBB21_4
1428 ; SOFT-NEXT: .LBB21_15: @ %entry
1429 ; SOFT-NEXT: mov r4, r5
1430 ; SOFT-NEXT: cmp r4, #0
1431 ; SOFT-NEXT: bne .LBB21_10
1432 ; SOFT-NEXT: .LBB21_16: @ %entry
1433 ; SOFT-NEXT: mov r6, r5
1434 ; SOFT-NEXT: cmp r4, #0
1435 ; SOFT-NEXT: beq .LBB21_11
1436 ; SOFT-NEXT: b .LBB21_12
1437 ; SOFT-NEXT: .p2align 2
1438 ; SOFT-NEXT: @ %bb.17:
1439 ; SOFT-NEXT: .LCPI21_0:
1440 ; SOFT-NEXT: .long 2147483647 @ 0x7fffffff
1442 ; VFP2-LABEL: stest_f32i64:
1443 ; VFP2: @ %bb.0: @ %entry
1444 ; VFP2-NEXT: .save {r4, r5, r7, lr}
1445 ; VFP2-NEXT: push {r4, r5, r7, lr}
1446 ; VFP2-NEXT: bl __fixsfti
1447 ; VFP2-NEXT: subs.w r4, r0, #-1
1448 ; VFP2-NEXT: mvn lr, #-2147483648
1449 ; VFP2-NEXT: sbcs.w r4, r1, lr
1450 ; VFP2-NEXT: mov.w r12, #0
1451 ; VFP2-NEXT: sbcs r4, r2, #0
1452 ; VFP2-NEXT: sbcs r4, r3, #0
1453 ; VFP2-NEXT: mov.w r4, #0
1455 ; VFP2-NEXT: movlt r4, #1
1456 ; VFP2-NEXT: cmp r4, #0
1457 ; VFP2-NEXT: itet eq
1458 ; VFP2-NEXT: moveq r3, r4
1459 ; VFP2-NEXT: movne r4, r2
1460 ; VFP2-NEXT: moveq r1, lr
1461 ; VFP2-NEXT: mov.w r2, #-1
1463 ; VFP2-NEXT: moveq r0, r2
1464 ; VFP2-NEXT: rsbs r5, r0, #0
1465 ; VFP2-NEXT: mov.w lr, #-2147483648
1466 ; VFP2-NEXT: sbcs.w r5, lr, r1
1467 ; VFP2-NEXT: sbcs.w r4, r2, r4
1468 ; VFP2-NEXT: sbcs r2, r3
1469 ; VFP2-NEXT: mov.w r2, #0
1471 ; VFP2-NEXT: movlt r2, #1
1472 ; VFP2-NEXT: cmp r2, #0
1474 ; VFP2-NEXT: moveq r0, r12
1475 ; VFP2-NEXT: moveq r1, lr
1476 ; VFP2-NEXT: pop {r4, r5, r7, pc}
1478 ; FULL-LABEL: stest_f32i64:
1479 ; FULL: @ %bb.0: @ %entry
1480 ; FULL-NEXT: .save {r4, r5, r7, lr}
1481 ; FULL-NEXT: push {r4, r5, r7, lr}
1482 ; FULL-NEXT: bl __fixsfti
1483 ; FULL-NEXT: subs.w lr, r0, #-1
1484 ; FULL-NEXT: mvn r12, #-2147483648
1485 ; FULL-NEXT: sbcs.w lr, r1, r12
1486 ; FULL-NEXT: sbcs lr, r2, #0
1487 ; FULL-NEXT: sbcs lr, r3, #0
1488 ; FULL-NEXT: cset lr, lt
1489 ; FULL-NEXT: cmp.w lr, #0
1490 ; FULL-NEXT: csel r5, r3, lr, ne
1491 ; FULL-NEXT: mov.w r3, #-1
1492 ; FULL-NEXT: csel r0, r0, r3, ne
1493 ; FULL-NEXT: csel r1, r1, r12, ne
1494 ; FULL-NEXT: csel r2, r2, lr, ne
1495 ; FULL-NEXT: rsbs r4, r0, #0
1496 ; FULL-NEXT: mov.w r12, #-2147483648
1497 ; FULL-NEXT: sbcs.w r4, r12, r1
1498 ; FULL-NEXT: sbcs.w r2, r3, r2
1499 ; FULL-NEXT: sbcs.w r2, r3, r5
1500 ; FULL-NEXT: cset r2, lt
1501 ; FULL-NEXT: cmp r2, #0
1503 ; FULL-NEXT: moveq r0, #0
1504 ; FULL-NEXT: csel r1, r1, r12, ne
1505 ; FULL-NEXT: pop {r4, r5, r7, pc}
1507 %conv = fptosi float %x to i128
1508 %0 = icmp slt i128 %conv, 9223372036854775807
1509 %spec.store.select = select i1 %0, i128 %conv, i128 9223372036854775807
1510 %1 = icmp sgt i128 %spec.store.select, -9223372036854775808
1511 %spec.store.select7 = select i1 %1, i128 %spec.store.select, i128 -9223372036854775808
1512 %conv6 = trunc i128 %spec.store.select7 to i64
1516 define i64 @utest_f32i64(float %x) {
1517 ; SOFT-LABEL: utest_f32i64:
1518 ; SOFT: @ %bb.0: @ %entry
1519 ; SOFT-NEXT: .save {r4, lr}
1520 ; SOFT-NEXT: push {r4, lr}
1521 ; SOFT-NEXT: bl __fixunssfti
1522 ; SOFT-NEXT: movs r4, #0
1523 ; SOFT-NEXT: subs r2, r2, #1
1524 ; SOFT-NEXT: sbcs r3, r4
1525 ; SOFT-NEXT: blo .LBB22_2
1526 ; SOFT-NEXT: @ %bb.1: @ %entry
1527 ; SOFT-NEXT: mov r2, r4
1528 ; SOFT-NEXT: cmp r2, #0
1529 ; SOFT-NEXT: beq .LBB22_3
1530 ; SOFT-NEXT: b .LBB22_4
1531 ; SOFT-NEXT: .LBB22_2:
1532 ; SOFT-NEXT: movs r2, #1
1533 ; SOFT-NEXT: cmp r2, #0
1534 ; SOFT-NEXT: bne .LBB22_4
1535 ; SOFT-NEXT: .LBB22_3: @ %entry
1536 ; SOFT-NEXT: mov r0, r4
1537 ; SOFT-NEXT: .LBB22_4: @ %entry
1538 ; SOFT-NEXT: cmp r2, #0
1539 ; SOFT-NEXT: beq .LBB22_6
1540 ; SOFT-NEXT: @ %bb.5: @ %entry
1541 ; SOFT-NEXT: pop {r4, pc}
1542 ; SOFT-NEXT: .LBB22_6: @ %entry
1543 ; SOFT-NEXT: mov r1, r4
1544 ; SOFT-NEXT: pop {r4, pc}
1546 ; VFP2-LABEL: utest_f32i64:
1547 ; VFP2: @ %bb.0: @ %entry
1548 ; VFP2-NEXT: .save {r7, lr}
1549 ; VFP2-NEXT: push {r7, lr}
1550 ; VFP2-NEXT: bl __fixunssfti
1551 ; VFP2-NEXT: subs r2, #1
1552 ; VFP2-NEXT: mov.w r12, #0
1553 ; VFP2-NEXT: sbcs r2, r3, #0
1554 ; VFP2-NEXT: mov.w r2, #0
1556 ; VFP2-NEXT: movlo r2, #1
1557 ; VFP2-NEXT: cmp r2, #0
1559 ; VFP2-NEXT: moveq r0, r12
1560 ; VFP2-NEXT: moveq r1, r12
1561 ; VFP2-NEXT: pop {r7, pc}
1563 ; FULL-LABEL: utest_f32i64:
1564 ; FULL: @ %bb.0: @ %entry
1565 ; FULL-NEXT: .save {r7, lr}
1566 ; FULL-NEXT: push {r7, lr}
1567 ; FULL-NEXT: bl __fixunssfti
1568 ; FULL-NEXT: subs r2, #1
1569 ; FULL-NEXT: sbcs r2, r3, #0
1570 ; FULL-NEXT: mov.w r3, #0
1571 ; FULL-NEXT: cset r2, lo
1572 ; FULL-NEXT: cmp r2, #0
1573 ; FULL-NEXT: csel r0, r0, r3, ne
1574 ; FULL-NEXT: csel r1, r1, r3, ne
1575 ; FULL-NEXT: pop {r7, pc}
1577 %conv = fptoui float %x to i128
1578 %0 = icmp ult i128 %conv, 18446744073709551616
1579 %spec.store.select = select i1 %0, i128 %conv, i128 18446744073709551616
1580 %conv6 = trunc i128 %spec.store.select to i64
1584 define i64 @ustest_f32i64(float %x) {
1585 ; SOFT-LABEL: ustest_f32i64:
1586 ; SOFT: @ %bb.0: @ %entry
1587 ; SOFT-NEXT: .save {r4, r5, r6, lr}
1588 ; SOFT-NEXT: push {r4, r5, r6, lr}
1589 ; SOFT-NEXT: bl __fixsfti
1590 ; SOFT-NEXT: movs r4, #1
1591 ; SOFT-NEXT: movs r5, #0
1592 ; SOFT-NEXT: subs r6, r2, #1
1593 ; SOFT-NEXT: mov r6, r3
1594 ; SOFT-NEXT: sbcs r6, r5
1595 ; SOFT-NEXT: mov r6, r4
1596 ; SOFT-NEXT: bge .LBB23_10
1597 ; SOFT-NEXT: @ %bb.1: @ %entry
1598 ; SOFT-NEXT: cmp r6, #0
1599 ; SOFT-NEXT: beq .LBB23_11
1600 ; SOFT-NEXT: .LBB23_2: @ %entry
1601 ; SOFT-NEXT: cmp r6, #0
1602 ; SOFT-NEXT: beq .LBB23_12
1603 ; SOFT-NEXT: .LBB23_3: @ %entry
1604 ; SOFT-NEXT: cmp r6, #0
1605 ; SOFT-NEXT: beq .LBB23_13
1606 ; SOFT-NEXT: .LBB23_4: @ %entry
1607 ; SOFT-NEXT: cmp r6, #0
1608 ; SOFT-NEXT: bne .LBB23_6
1609 ; SOFT-NEXT: .LBB23_5: @ %entry
1610 ; SOFT-NEXT: mov r0, r5
1611 ; SOFT-NEXT: .LBB23_6: @ %entry
1612 ; SOFT-NEXT: rsbs r6, r0, #0
1613 ; SOFT-NEXT: mov r6, r5
1614 ; SOFT-NEXT: sbcs r6, r1
1615 ; SOFT-NEXT: mov r6, r5
1616 ; SOFT-NEXT: sbcs r6, r2
1617 ; SOFT-NEXT: mov r2, r5
1618 ; SOFT-NEXT: sbcs r2, r3
1619 ; SOFT-NEXT: bge .LBB23_14
1620 ; SOFT-NEXT: @ %bb.7: @ %entry
1621 ; SOFT-NEXT: cmp r4, #0
1622 ; SOFT-NEXT: beq .LBB23_15
1623 ; SOFT-NEXT: .LBB23_8: @ %entry
1624 ; SOFT-NEXT: cmp r4, #0
1625 ; SOFT-NEXT: beq .LBB23_16
1626 ; SOFT-NEXT: .LBB23_9: @ %entry
1627 ; SOFT-NEXT: pop {r4, r5, r6, pc}
1628 ; SOFT-NEXT: .LBB23_10: @ %entry
1629 ; SOFT-NEXT: mov r6, r5
1630 ; SOFT-NEXT: cmp r6, #0
1631 ; SOFT-NEXT: bne .LBB23_2
1632 ; SOFT-NEXT: .LBB23_11: @ %entry
1633 ; SOFT-NEXT: mov r3, r5
1634 ; SOFT-NEXT: cmp r6, #0
1635 ; SOFT-NEXT: bne .LBB23_3
1636 ; SOFT-NEXT: .LBB23_12: @ %entry
1637 ; SOFT-NEXT: mov r2, r4
1638 ; SOFT-NEXT: cmp r6, #0
1639 ; SOFT-NEXT: bne .LBB23_4
1640 ; SOFT-NEXT: .LBB23_13: @ %entry
1641 ; SOFT-NEXT: mov r1, r5
1642 ; SOFT-NEXT: cmp r6, #0
1643 ; SOFT-NEXT: beq .LBB23_5
1644 ; SOFT-NEXT: b .LBB23_6
1645 ; SOFT-NEXT: .LBB23_14: @ %entry
1646 ; SOFT-NEXT: mov r4, r5
1647 ; SOFT-NEXT: cmp r4, #0
1648 ; SOFT-NEXT: bne .LBB23_8
1649 ; SOFT-NEXT: .LBB23_15: @ %entry
1650 ; SOFT-NEXT: mov r0, r4
1651 ; SOFT-NEXT: cmp r4, #0
1652 ; SOFT-NEXT: bne .LBB23_9
1653 ; SOFT-NEXT: .LBB23_16: @ %entry
1654 ; SOFT-NEXT: mov r1, r4
1655 ; SOFT-NEXT: pop {r4, r5, r6, pc}
1657 ; VFP2-LABEL: ustest_f32i64:
1658 ; VFP2: @ %bb.0: @ %entry
1659 ; VFP2-NEXT: .save {r7, lr}
1660 ; VFP2-NEXT: push {r7, lr}
1661 ; VFP2-NEXT: bl __fixsfti
1662 ; VFP2-NEXT: subs.w lr, r2, #1
1663 ; VFP2-NEXT: mov.w r12, #0
1664 ; VFP2-NEXT: sbcs lr, r3, #0
1665 ; VFP2-NEXT: mov.w lr, #0
1667 ; VFP2-NEXT: movlt.w lr, #1
1668 ; VFP2-NEXT: cmp.w lr, #0
1669 ; VFP2-NEXT: itttt eq
1670 ; VFP2-NEXT: moveq r3, r12
1671 ; VFP2-NEXT: moveq r2, #1
1672 ; VFP2-NEXT: moveq r1, r12
1673 ; VFP2-NEXT: moveq r0, r12
1674 ; VFP2-NEXT: rsbs.w lr, r0, #0
1675 ; VFP2-NEXT: sbcs.w lr, r12, r1
1676 ; VFP2-NEXT: sbcs.w r2, r12, r2
1677 ; VFP2-NEXT: sbcs.w r2, r12, r3
1679 ; VFP2-NEXT: movlt.w r12, #1
1680 ; VFP2-NEXT: cmp.w r12, #0
1682 ; VFP2-NEXT: moveq r0, r12
1683 ; VFP2-NEXT: moveq r1, r12
1684 ; VFP2-NEXT: pop {r7, pc}
1686 ; FULL-LABEL: ustest_f32i64:
1687 ; FULL: @ %bb.0: @ %entry
1688 ; FULL-NEXT: .save {r7, lr}
1689 ; FULL-NEXT: push {r7, lr}
1690 ; FULL-NEXT: bl __fixsfti
1691 ; FULL-NEXT: subs.w r12, r2, #1
1692 ; FULL-NEXT: mov.w lr, #0
1693 ; FULL-NEXT: sbcs r12, r3, #0
1694 ; FULL-NEXT: cset r12, lt
1695 ; FULL-NEXT: cmp.w r12, #0
1697 ; FULL-NEXT: moveq r2, #1
1698 ; FULL-NEXT: csel r0, r0, lr, ne
1699 ; FULL-NEXT: csel r12, r3, lr, ne
1700 ; FULL-NEXT: csel r1, r1, lr, ne
1701 ; FULL-NEXT: rsbs r3, r0, #0
1702 ; FULL-NEXT: sbcs.w r3, lr, r1
1703 ; FULL-NEXT: sbcs.w r2, lr, r2
1704 ; FULL-NEXT: sbcs.w r2, lr, r12
1705 ; FULL-NEXT: cset r2, lt
1706 ; FULL-NEXT: cmp r2, #0
1707 ; FULL-NEXT: csel r0, r0, r2, ne
1708 ; FULL-NEXT: csel r1, r1, r2, ne
1709 ; FULL-NEXT: pop {r7, pc}
1711 %conv = fptosi float %x to i128
1712 %0 = icmp slt i128 %conv, 18446744073709551616
1713 %spec.store.select = select i1 %0, i128 %conv, i128 18446744073709551616
1714 %1 = icmp sgt i128 %spec.store.select, 0
1715 %spec.store.select7 = select i1 %1, i128 %spec.store.select, i128 0
1716 %conv6 = trunc i128 %spec.store.select7 to i64
1720 define i64 @stest_f16i64(half %x) {
1721 ; SOFT-LABEL: stest_f16i64:
1722 ; SOFT: @ %bb.0: @ %entry
1723 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
1724 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
1725 ; SOFT-NEXT: .pad #12
1726 ; SOFT-NEXT: sub sp, #12
1727 ; SOFT-NEXT: uxth r0, r0
1728 ; SOFT-NEXT: bl __aeabi_h2f
1729 ; SOFT-NEXT: bl __fixsfti
1730 ; SOFT-NEXT: mov r6, r0
1731 ; SOFT-NEXT: movs r4, #1
1732 ; SOFT-NEXT: movs r5, #0
1733 ; SOFT-NEXT: ldr r0, .LCPI24_0
1734 ; SOFT-NEXT: adds r7, r6, #1
1735 ; SOFT-NEXT: mov r7, r1
1736 ; SOFT-NEXT: sbcs r7, r0
1737 ; SOFT-NEXT: mov r7, r2
1738 ; SOFT-NEXT: sbcs r7, r5
1739 ; SOFT-NEXT: mov r7, r3
1740 ; SOFT-NEXT: sbcs r7, r5
1741 ; SOFT-NEXT: mov r7, r4
1742 ; SOFT-NEXT: bge .LBB24_13
1743 ; SOFT-NEXT: @ %bb.1: @ %entry
1744 ; SOFT-NEXT: cmp r7, #0
1745 ; SOFT-NEXT: beq .LBB24_14
1746 ; SOFT-NEXT: .LBB24_2: @ %entry
1747 ; SOFT-NEXT: cmp r7, #0
1748 ; SOFT-NEXT: bne .LBB24_4
1749 ; SOFT-NEXT: .LBB24_3: @ %entry
1750 ; SOFT-NEXT: mov r2, r5
1751 ; SOFT-NEXT: .LBB24_4: @ %entry
1752 ; SOFT-NEXT: str r2, [sp, #8] @ 4-byte Spill
1753 ; SOFT-NEXT: cmp r7, #0
1754 ; SOFT-NEXT: bne .LBB24_6
1755 ; SOFT-NEXT: @ %bb.5: @ %entry
1756 ; SOFT-NEXT: mov r1, r0
1757 ; SOFT-NEXT: .LBB24_6: @ %entry
1758 ; SOFT-NEXT: str r3, [sp, #4] @ 4-byte Spill
1759 ; SOFT-NEXT: mvns r0, r5
1760 ; SOFT-NEXT: cmp r7, #0
1761 ; SOFT-NEXT: bne .LBB24_8
1762 ; SOFT-NEXT: @ %bb.7: @ %entry
1763 ; SOFT-NEXT: mov r6, r0
1764 ; SOFT-NEXT: .LBB24_8: @ %entry
1765 ; SOFT-NEXT: lsls r3, r4, #31
1766 ; SOFT-NEXT: rsbs r7, r6, #0
1767 ; SOFT-NEXT: mov r7, r3
1768 ; SOFT-NEXT: sbcs r7, r1
1769 ; SOFT-NEXT: mov r7, r0
1770 ; SOFT-NEXT: ldr r2, [sp, #8] @ 4-byte Reload
1771 ; SOFT-NEXT: sbcs r7, r2
1772 ; SOFT-NEXT: ldr r2, [sp, #4] @ 4-byte Reload
1773 ; SOFT-NEXT: sbcs r0, r2
1774 ; SOFT-NEXT: bge .LBB24_15
1775 ; SOFT-NEXT: @ %bb.9: @ %entry
1776 ; SOFT-NEXT: cmp r4, #0
1777 ; SOFT-NEXT: beq .LBB24_16
1778 ; SOFT-NEXT: .LBB24_10: @ %entry
1779 ; SOFT-NEXT: cmp r4, #0
1780 ; SOFT-NEXT: bne .LBB24_12
1781 ; SOFT-NEXT: .LBB24_11: @ %entry
1782 ; SOFT-NEXT: mov r1, r3
1783 ; SOFT-NEXT: .LBB24_12: @ %entry
1784 ; SOFT-NEXT: mov r0, r6
1785 ; SOFT-NEXT: add sp, #12
1786 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
1787 ; SOFT-NEXT: .LBB24_13: @ %entry
1788 ; SOFT-NEXT: mov r7, r5
1789 ; SOFT-NEXT: cmp r7, #0
1790 ; SOFT-NEXT: bne .LBB24_2
1791 ; SOFT-NEXT: .LBB24_14: @ %entry
1792 ; SOFT-NEXT: mov r3, r5
1793 ; SOFT-NEXT: cmp r7, #0
1794 ; SOFT-NEXT: beq .LBB24_3
1795 ; SOFT-NEXT: b .LBB24_4
1796 ; SOFT-NEXT: .LBB24_15: @ %entry
1797 ; SOFT-NEXT: mov r4, r5
1798 ; SOFT-NEXT: cmp r4, #0
1799 ; SOFT-NEXT: bne .LBB24_10
1800 ; SOFT-NEXT: .LBB24_16: @ %entry
1801 ; SOFT-NEXT: mov r6, r5
1802 ; SOFT-NEXT: cmp r4, #0
1803 ; SOFT-NEXT: beq .LBB24_11
1804 ; SOFT-NEXT: b .LBB24_12
1805 ; SOFT-NEXT: .p2align 2
1806 ; SOFT-NEXT: @ %bb.17:
1807 ; SOFT-NEXT: .LCPI24_0:
1808 ; SOFT-NEXT: .long 2147483647 @ 0x7fffffff
1810 ; VFP2-LABEL: stest_f16i64:
1811 ; VFP2: @ %bb.0: @ %entry
1812 ; VFP2-NEXT: .save {r4, r5, r7, lr}
1813 ; VFP2-NEXT: push {r4, r5, r7, lr}
1814 ; VFP2-NEXT: vmov r0, s0
1815 ; VFP2-NEXT: bl __aeabi_h2f
1816 ; VFP2-NEXT: vmov s0, r0
1817 ; VFP2-NEXT: bl __fixsfti
1818 ; VFP2-NEXT: subs.w r4, r0, #-1
1819 ; VFP2-NEXT: mvn lr, #-2147483648
1820 ; VFP2-NEXT: sbcs.w r4, r1, lr
1821 ; VFP2-NEXT: mov.w r12, #0
1822 ; VFP2-NEXT: sbcs r4, r2, #0
1823 ; VFP2-NEXT: sbcs r4, r3, #0
1824 ; VFP2-NEXT: mov.w r4, #0
1826 ; VFP2-NEXT: movlt r4, #1
1827 ; VFP2-NEXT: cmp r4, #0
1828 ; VFP2-NEXT: itet eq
1829 ; VFP2-NEXT: moveq r3, r4
1830 ; VFP2-NEXT: movne r4, r2
1831 ; VFP2-NEXT: moveq r1, lr
1832 ; VFP2-NEXT: mov.w r2, #-1
1834 ; VFP2-NEXT: moveq r0, r2
1835 ; VFP2-NEXT: rsbs r5, r0, #0
1836 ; VFP2-NEXT: mov.w lr, #-2147483648
1837 ; VFP2-NEXT: sbcs.w r5, lr, r1
1838 ; VFP2-NEXT: sbcs.w r4, r2, r4
1839 ; VFP2-NEXT: sbcs r2, r3
1840 ; VFP2-NEXT: mov.w r2, #0
1842 ; VFP2-NEXT: movlt r2, #1
1843 ; VFP2-NEXT: cmp r2, #0
1845 ; VFP2-NEXT: moveq r0, r12
1846 ; VFP2-NEXT: moveq r1, lr
1847 ; VFP2-NEXT: pop {r4, r5, r7, pc}
1849 ; FULL-LABEL: stest_f16i64:
1850 ; FULL: @ %bb.0: @ %entry
1851 ; FULL-NEXT: .save {r4, r5, r7, lr}
1852 ; FULL-NEXT: push {r4, r5, r7, lr}
1853 ; FULL-NEXT: vmov.f16 r0, s0
1854 ; FULL-NEXT: vmov s0, r0
1855 ; FULL-NEXT: bl __fixhfti
1856 ; FULL-NEXT: subs.w lr, r0, #-1
1857 ; FULL-NEXT: mvn r12, #-2147483648
1858 ; FULL-NEXT: sbcs.w lr, r1, r12
1859 ; FULL-NEXT: sbcs lr, r2, #0
1860 ; FULL-NEXT: sbcs lr, r3, #0
1861 ; FULL-NEXT: cset lr, lt
1862 ; FULL-NEXT: cmp.w lr, #0
1863 ; FULL-NEXT: csel r5, r3, lr, ne
1864 ; FULL-NEXT: mov.w r3, #-1
1865 ; FULL-NEXT: csel r0, r0, r3, ne
1866 ; FULL-NEXT: csel r1, r1, r12, ne
1867 ; FULL-NEXT: csel r2, r2, lr, ne
1868 ; FULL-NEXT: rsbs r4, r0, #0
1869 ; FULL-NEXT: mov.w r12, #-2147483648
1870 ; FULL-NEXT: sbcs.w r4, r12, r1
1871 ; FULL-NEXT: sbcs.w r2, r3, r2
1872 ; FULL-NEXT: sbcs.w r2, r3, r5
1873 ; FULL-NEXT: cset r2, lt
1874 ; FULL-NEXT: cmp r2, #0
1876 ; FULL-NEXT: moveq r0, #0
1877 ; FULL-NEXT: csel r1, r1, r12, ne
1878 ; FULL-NEXT: pop {r4, r5, r7, pc}
1880 %conv = fptosi half %x to i128
1881 %0 = icmp slt i128 %conv, 9223372036854775807
1882 %spec.store.select = select i1 %0, i128 %conv, i128 9223372036854775807
1883 %1 = icmp sgt i128 %spec.store.select, -9223372036854775808
1884 %spec.store.select7 = select i1 %1, i128 %spec.store.select, i128 -9223372036854775808
1885 %conv6 = trunc i128 %spec.store.select7 to i64
1889 define i64 @utesth_f16i64(half %x) {
1890 ; SOFT-LABEL: utesth_f16i64:
1891 ; SOFT: @ %bb.0: @ %entry
1892 ; SOFT-NEXT: .save {r4, lr}
1893 ; SOFT-NEXT: push {r4, lr}
1894 ; SOFT-NEXT: uxth r0, r0
1895 ; SOFT-NEXT: bl __aeabi_h2f
1896 ; SOFT-NEXT: bl __fixunssfti
1897 ; SOFT-NEXT: movs r4, #0
1898 ; SOFT-NEXT: subs r2, r2, #1
1899 ; SOFT-NEXT: sbcs r3, r4
1900 ; SOFT-NEXT: blo .LBB25_2
1901 ; SOFT-NEXT: @ %bb.1: @ %entry
1902 ; SOFT-NEXT: mov r2, r4
1903 ; SOFT-NEXT: cmp r2, #0
1904 ; SOFT-NEXT: beq .LBB25_3
1905 ; SOFT-NEXT: b .LBB25_4
1906 ; SOFT-NEXT: .LBB25_2:
1907 ; SOFT-NEXT: movs r2, #1
1908 ; SOFT-NEXT: cmp r2, #0
1909 ; SOFT-NEXT: bne .LBB25_4
1910 ; SOFT-NEXT: .LBB25_3: @ %entry
1911 ; SOFT-NEXT: mov r0, r4
1912 ; SOFT-NEXT: .LBB25_4: @ %entry
1913 ; SOFT-NEXT: cmp r2, #0
1914 ; SOFT-NEXT: beq .LBB25_6
1915 ; SOFT-NEXT: @ %bb.5: @ %entry
1916 ; SOFT-NEXT: pop {r4, pc}
1917 ; SOFT-NEXT: .LBB25_6: @ %entry
1918 ; SOFT-NEXT: mov r1, r4
1919 ; SOFT-NEXT: pop {r4, pc}
1921 ; VFP2-LABEL: utesth_f16i64:
1922 ; VFP2: @ %bb.0: @ %entry
1923 ; VFP2-NEXT: .save {r7, lr}
1924 ; VFP2-NEXT: push {r7, lr}
1925 ; VFP2-NEXT: vmov r0, s0
1926 ; VFP2-NEXT: bl __aeabi_h2f
1927 ; VFP2-NEXT: vmov s0, r0
1928 ; VFP2-NEXT: bl __fixunssfti
1929 ; VFP2-NEXT: subs r2, #1
1930 ; VFP2-NEXT: mov.w r12, #0
1931 ; VFP2-NEXT: sbcs r2, r3, #0
1932 ; VFP2-NEXT: mov.w r2, #0
1934 ; VFP2-NEXT: movlo r2, #1
1935 ; VFP2-NEXT: cmp r2, #0
1937 ; VFP2-NEXT: moveq r0, r12
1938 ; VFP2-NEXT: moveq r1, r12
1939 ; VFP2-NEXT: pop {r7, pc}
1941 ; FULL-LABEL: utesth_f16i64:
1942 ; FULL: @ %bb.0: @ %entry
1943 ; FULL-NEXT: .save {r7, lr}
1944 ; FULL-NEXT: push {r7, lr}
1945 ; FULL-NEXT: vmov.f16 r0, s0
1946 ; FULL-NEXT: vmov s0, r0
1947 ; FULL-NEXT: bl __fixunshfti
1948 ; FULL-NEXT: subs r2, #1
1949 ; FULL-NEXT: sbcs r2, r3, #0
1950 ; FULL-NEXT: mov.w r3, #0
1951 ; FULL-NEXT: cset r2, lo
1952 ; FULL-NEXT: cmp r2, #0
1953 ; FULL-NEXT: csel r0, r0, r3, ne
1954 ; FULL-NEXT: csel r1, r1, r3, ne
1955 ; FULL-NEXT: pop {r7, pc}
1957 %conv = fptoui half %x to i128
1958 %0 = icmp ult i128 %conv, 18446744073709551616
1959 %spec.store.select = select i1 %0, i128 %conv, i128 18446744073709551616
1960 %conv6 = trunc i128 %spec.store.select to i64
1964 define i64 @ustest_f16i64(half %x) {
1965 ; SOFT-LABEL: ustest_f16i64:
1966 ; SOFT: @ %bb.0: @ %entry
1967 ; SOFT-NEXT: .save {r4, r5, r6, lr}
1968 ; SOFT-NEXT: push {r4, r5, r6, lr}
1969 ; SOFT-NEXT: uxth r0, r0
1970 ; SOFT-NEXT: bl __aeabi_h2f
1971 ; SOFT-NEXT: bl __fixsfti
1972 ; SOFT-NEXT: movs r4, #1
1973 ; SOFT-NEXT: movs r5, #0
1974 ; SOFT-NEXT: subs r6, r2, #1
1975 ; SOFT-NEXT: mov r6, r3
1976 ; SOFT-NEXT: sbcs r6, r5
1977 ; SOFT-NEXT: mov r6, r4
1978 ; SOFT-NEXT: bge .LBB26_10
1979 ; SOFT-NEXT: @ %bb.1: @ %entry
1980 ; SOFT-NEXT: cmp r6, #0
1981 ; SOFT-NEXT: beq .LBB26_11
1982 ; SOFT-NEXT: .LBB26_2: @ %entry
1983 ; SOFT-NEXT: cmp r6, #0
1984 ; SOFT-NEXT: beq .LBB26_12
1985 ; SOFT-NEXT: .LBB26_3: @ %entry
1986 ; SOFT-NEXT: cmp r6, #0
1987 ; SOFT-NEXT: beq .LBB26_13
1988 ; SOFT-NEXT: .LBB26_4: @ %entry
1989 ; SOFT-NEXT: cmp r6, #0
1990 ; SOFT-NEXT: bne .LBB26_6
1991 ; SOFT-NEXT: .LBB26_5: @ %entry
1992 ; SOFT-NEXT: mov r0, r5
1993 ; SOFT-NEXT: .LBB26_6: @ %entry
1994 ; SOFT-NEXT: rsbs r6, r0, #0
1995 ; SOFT-NEXT: mov r6, r5
1996 ; SOFT-NEXT: sbcs r6, r1
1997 ; SOFT-NEXT: mov r6, r5
1998 ; SOFT-NEXT: sbcs r6, r2
1999 ; SOFT-NEXT: mov r2, r5
2000 ; SOFT-NEXT: sbcs r2, r3
2001 ; SOFT-NEXT: bge .LBB26_14
2002 ; SOFT-NEXT: @ %bb.7: @ %entry
2003 ; SOFT-NEXT: cmp r4, #0
2004 ; SOFT-NEXT: beq .LBB26_15
2005 ; SOFT-NEXT: .LBB26_8: @ %entry
2006 ; SOFT-NEXT: cmp r4, #0
2007 ; SOFT-NEXT: beq .LBB26_16
2008 ; SOFT-NEXT: .LBB26_9: @ %entry
2009 ; SOFT-NEXT: pop {r4, r5, r6, pc}
2010 ; SOFT-NEXT: .LBB26_10: @ %entry
2011 ; SOFT-NEXT: mov r6, r5
2012 ; SOFT-NEXT: cmp r6, #0
2013 ; SOFT-NEXT: bne .LBB26_2
2014 ; SOFT-NEXT: .LBB26_11: @ %entry
2015 ; SOFT-NEXT: mov r3, r5
2016 ; SOFT-NEXT: cmp r6, #0
2017 ; SOFT-NEXT: bne .LBB26_3
2018 ; SOFT-NEXT: .LBB26_12: @ %entry
2019 ; SOFT-NEXT: mov r2, r4
2020 ; SOFT-NEXT: cmp r6, #0
2021 ; SOFT-NEXT: bne .LBB26_4
2022 ; SOFT-NEXT: .LBB26_13: @ %entry
2023 ; SOFT-NEXT: mov r1, r5
2024 ; SOFT-NEXT: cmp r6, #0
2025 ; SOFT-NEXT: beq .LBB26_5
2026 ; SOFT-NEXT: b .LBB26_6
2027 ; SOFT-NEXT: .LBB26_14: @ %entry
2028 ; SOFT-NEXT: mov r4, r5
2029 ; SOFT-NEXT: cmp r4, #0
2030 ; SOFT-NEXT: bne .LBB26_8
2031 ; SOFT-NEXT: .LBB26_15: @ %entry
2032 ; SOFT-NEXT: mov r0, r4
2033 ; SOFT-NEXT: cmp r4, #0
2034 ; SOFT-NEXT: bne .LBB26_9
2035 ; SOFT-NEXT: .LBB26_16: @ %entry
2036 ; SOFT-NEXT: mov r1, r4
2037 ; SOFT-NEXT: pop {r4, r5, r6, pc}
2039 ; VFP2-LABEL: ustest_f16i64:
2040 ; VFP2: @ %bb.0: @ %entry
2041 ; VFP2-NEXT: .save {r7, lr}
2042 ; VFP2-NEXT: push {r7, lr}
2043 ; VFP2-NEXT: vmov r0, s0
2044 ; VFP2-NEXT: bl __aeabi_h2f
2045 ; VFP2-NEXT: vmov s0, r0
2046 ; VFP2-NEXT: bl __fixsfti
2047 ; VFP2-NEXT: subs.w lr, r2, #1
2048 ; VFP2-NEXT: mov.w r12, #0
2049 ; VFP2-NEXT: sbcs lr, r3, #0
2050 ; VFP2-NEXT: mov.w lr, #0
2052 ; VFP2-NEXT: movlt.w lr, #1
2053 ; VFP2-NEXT: cmp.w lr, #0
2054 ; VFP2-NEXT: itttt eq
2055 ; VFP2-NEXT: moveq r3, r12
2056 ; VFP2-NEXT: moveq r2, #1
2057 ; VFP2-NEXT: moveq r1, r12
2058 ; VFP2-NEXT: moveq r0, r12
2059 ; VFP2-NEXT: rsbs.w lr, r0, #0
2060 ; VFP2-NEXT: sbcs.w lr, r12, r1
2061 ; VFP2-NEXT: sbcs.w r2, r12, r2
2062 ; VFP2-NEXT: sbcs.w r2, r12, r3
2064 ; VFP2-NEXT: movlt.w r12, #1
2065 ; VFP2-NEXT: cmp.w r12, #0
2067 ; VFP2-NEXT: moveq r0, r12
2068 ; VFP2-NEXT: moveq r1, r12
2069 ; VFP2-NEXT: pop {r7, pc}
2071 ; FULL-LABEL: ustest_f16i64:
2072 ; FULL: @ %bb.0: @ %entry
2073 ; FULL-NEXT: .save {r7, lr}
2074 ; FULL-NEXT: push {r7, lr}
2075 ; FULL-NEXT: vmov.f16 r0, s0
2076 ; FULL-NEXT: vmov s0, r0
2077 ; FULL-NEXT: bl __fixhfti
2078 ; FULL-NEXT: subs.w r12, r2, #1
2079 ; FULL-NEXT: mov.w lr, #0
2080 ; FULL-NEXT: sbcs r12, r3, #0
2081 ; FULL-NEXT: cset r12, lt
2082 ; FULL-NEXT: cmp.w r12, #0
2084 ; FULL-NEXT: moveq r2, #1
2085 ; FULL-NEXT: csel r0, r0, lr, ne
2086 ; FULL-NEXT: csel r12, r3, lr, ne
2087 ; FULL-NEXT: csel r1, r1, lr, ne
2088 ; FULL-NEXT: rsbs r3, r0, #0
2089 ; FULL-NEXT: sbcs.w r3, lr, r1
2090 ; FULL-NEXT: sbcs.w r2, lr, r2
2091 ; FULL-NEXT: sbcs.w r2, lr, r12
2092 ; FULL-NEXT: cset r2, lt
2093 ; FULL-NEXT: cmp r2, #0
2094 ; FULL-NEXT: csel r0, r0, r2, ne
2095 ; FULL-NEXT: csel r1, r1, r2, ne
2096 ; FULL-NEXT: pop {r7, pc}
2098 %conv = fptosi half %x to i128
2099 %0 = icmp slt i128 %conv, 18446744073709551616
2100 %spec.store.select = select i1 %0, i128 %conv, i128 18446744073709551616
2101 %1 = icmp sgt i128 %spec.store.select, 0
2102 %spec.store.select7 = select i1 %1, i128 %spec.store.select, i128 0
2103 %conv6 = trunc i128 %spec.store.select7 to i64
2112 define i32 @stest_f64i32_mm(double %x) {
2113 ; SOFT-LABEL: stest_f64i32_mm:
2114 ; SOFT: @ %bb.0: @ %entry
2115 ; SOFT-NEXT: .save {r4, r5, r7, lr}
2116 ; SOFT-NEXT: push {r4, r5, r7, lr}
2117 ; SOFT-NEXT: bl __aeabi_d2lz
2118 ; SOFT-NEXT: movs r2, #1
2119 ; SOFT-NEXT: movs r3, #0
2120 ; SOFT-NEXT: ldr r4, .LCPI27_0
2121 ; SOFT-NEXT: subs r5, r0, r4
2122 ; SOFT-NEXT: mov r5, r1
2123 ; SOFT-NEXT: sbcs r5, r3
2124 ; SOFT-NEXT: mov r5, r2
2125 ; SOFT-NEXT: bge .LBB27_7
2126 ; SOFT-NEXT: @ %bb.1: @ %entry
2127 ; SOFT-NEXT: cmp r5, #0
2128 ; SOFT-NEXT: beq .LBB27_8
2129 ; SOFT-NEXT: .LBB27_2: @ %entry
2130 ; SOFT-NEXT: cmp r5, #0
2131 ; SOFT-NEXT: bne .LBB27_4
2132 ; SOFT-NEXT: .LBB27_3: @ %entry
2133 ; SOFT-NEXT: mov r0, r4
2134 ; SOFT-NEXT: .LBB27_4: @ %entry
2135 ; SOFT-NEXT: mvns r3, r3
2136 ; SOFT-NEXT: lsls r2, r2, #31
2137 ; SOFT-NEXT: subs r4, r2, r0
2138 ; SOFT-NEXT: sbcs r3, r1
2139 ; SOFT-NEXT: blt .LBB27_6
2140 ; SOFT-NEXT: @ %bb.5: @ %entry
2141 ; SOFT-NEXT: mov r0, r2
2142 ; SOFT-NEXT: .LBB27_6: @ %entry
2143 ; SOFT-NEXT: pop {r4, r5, r7, pc}
2144 ; SOFT-NEXT: .LBB27_7: @ %entry
2145 ; SOFT-NEXT: mov r5, r3
2146 ; SOFT-NEXT: cmp r5, #0
2147 ; SOFT-NEXT: bne .LBB27_2
2148 ; SOFT-NEXT: .LBB27_8: @ %entry
2149 ; SOFT-NEXT: mov r1, r5
2150 ; SOFT-NEXT: cmp r5, #0
2151 ; SOFT-NEXT: beq .LBB27_3
2152 ; SOFT-NEXT: b .LBB27_4
2153 ; SOFT-NEXT: .p2align 2
2154 ; SOFT-NEXT: @ %bb.9:
2155 ; SOFT-NEXT: .LCPI27_0:
2156 ; SOFT-NEXT: .long 2147483647 @ 0x7fffffff
2158 ; VFP2-LABEL: stest_f64i32_mm:
2159 ; VFP2: @ %bb.0: @ %entry
2160 ; VFP2-NEXT: .save {r7, lr}
2161 ; VFP2-NEXT: push {r7, lr}
2162 ; VFP2-NEXT: vmov r0, r1, d0
2163 ; VFP2-NEXT: bl __aeabi_d2lz
2164 ; VFP2-NEXT: mvn r12, #-2147483648
2165 ; VFP2-NEXT: subs.w r3, r0, r12
2166 ; VFP2-NEXT: mov.w r2, #0
2167 ; VFP2-NEXT: sbcs r3, r1, #0
2169 ; VFP2-NEXT: movlt r2, #1
2170 ; VFP2-NEXT: cmp r2, #0
2172 ; VFP2-NEXT: movne r2, r1
2173 ; VFP2-NEXT: moveq r0, r12
2174 ; VFP2-NEXT: mov.w r1, #-1
2175 ; VFP2-NEXT: rsbs.w r3, r0, #-2147483648
2176 ; VFP2-NEXT: sbcs r1, r2
2178 ; VFP2-NEXT: movge.w r0, #-2147483648
2179 ; VFP2-NEXT: pop {r7, pc}
2181 ; FULL-LABEL: stest_f64i32_mm:
2182 ; FULL: @ %bb.0: @ %entry
2183 ; FULL-NEXT: vcvt.s32.f64 s0, d0
2184 ; FULL-NEXT: vmov r0, s0
2187 %conv = fptosi double %x to i64
2188 %spec.store.select = call i64 @llvm.smin.i64(i64 %conv, i64 2147483647)
2189 %spec.store.select7 = call i64 @llvm.smax.i64(i64 %spec.store.select, i64 -2147483648)
2190 %conv6 = trunc i64 %spec.store.select7 to i32
2194 define i32 @utest_f64i32_mm(double %x) {
2195 ; SOFT-LABEL: utest_f64i32_mm:
2196 ; SOFT: @ %bb.0: @ %entry
2197 ; SOFT-NEXT: .save {r7, lr}
2198 ; SOFT-NEXT: push {r7, lr}
2199 ; SOFT-NEXT: bl __aeabi_d2ulz
2200 ; SOFT-NEXT: cmp r1, #0
2201 ; SOFT-NEXT: beq .LBB28_2
2202 ; SOFT-NEXT: @ %bb.1: @ %entry
2203 ; SOFT-NEXT: movs r0, #0
2204 ; SOFT-NEXT: mvns r0, r0
2205 ; SOFT-NEXT: .LBB28_2: @ %entry
2206 ; SOFT-NEXT: pop {r7, pc}
2208 ; VFP2-LABEL: utest_f64i32_mm:
2209 ; VFP2: @ %bb.0: @ %entry
2210 ; VFP2-NEXT: .save {r7, lr}
2211 ; VFP2-NEXT: push {r7, lr}
2212 ; VFP2-NEXT: vmov r0, r1, d0
2213 ; VFP2-NEXT: bl __aeabi_d2ulz
2214 ; VFP2-NEXT: cmp r1, #0
2216 ; VFP2-NEXT: movne.w r0, #-1
2217 ; VFP2-NEXT: pop {r7, pc}
2219 ; FULL-LABEL: utest_f64i32_mm:
2220 ; FULL: @ %bb.0: @ %entry
2221 ; FULL-NEXT: vcvt.u32.f64 s0, d0
2222 ; FULL-NEXT: vmov r0, s0
2225 %conv = fptoui double %x to i64
2226 %spec.store.select = call i64 @llvm.umin.i64(i64 %conv, i64 4294967295)
2227 %conv6 = trunc i64 %spec.store.select to i32
2231 define i32 @ustest_f64i32_mm(double %x) {
2232 ; SOFT-LABEL: ustest_f64i32_mm:
2233 ; SOFT: @ %bb.0: @ %entry
2234 ; SOFT-NEXT: .save {r7, lr}
2235 ; SOFT-NEXT: push {r7, lr}
2236 ; SOFT-NEXT: bl __aeabi_d2lz
2237 ; SOFT-NEXT: asrs r3, r1, #31
2238 ; SOFT-NEXT: ands r3, r1
2239 ; SOFT-NEXT: movs r2, #0
2240 ; SOFT-NEXT: cmp r1, #1
2241 ; SOFT-NEXT: bge .LBB29_3
2242 ; SOFT-NEXT: @ %bb.1: @ %entry
2243 ; SOFT-NEXT: cmp r3, #0
2244 ; SOFT-NEXT: bpl .LBB29_4
2245 ; SOFT-NEXT: .LBB29_2: @ %entry
2246 ; SOFT-NEXT: mov r0, r2
2247 ; SOFT-NEXT: pop {r7, pc}
2248 ; SOFT-NEXT: .LBB29_3: @ %entry
2249 ; SOFT-NEXT: mvns r0, r2
2250 ; SOFT-NEXT: cmp r3, #0
2251 ; SOFT-NEXT: bmi .LBB29_2
2252 ; SOFT-NEXT: .LBB29_4: @ %entry
2253 ; SOFT-NEXT: mov r2, r0
2254 ; SOFT-NEXT: mov r0, r2
2255 ; SOFT-NEXT: pop {r7, pc}
2257 ; VFP2-LABEL: ustest_f64i32_mm:
2258 ; VFP2: @ %bb.0: @ %entry
2259 ; VFP2-NEXT: .save {r7, lr}
2260 ; VFP2-NEXT: push {r7, lr}
2261 ; VFP2-NEXT: vmov r0, r1, d0
2262 ; VFP2-NEXT: bl __aeabi_d2lz
2263 ; VFP2-NEXT: cmp r1, #1
2265 ; VFP2-NEXT: movge.w r0, #-1
2266 ; VFP2-NEXT: ands.w r1, r1, r1, asr #31
2268 ; VFP2-NEXT: movmi r0, #0
2269 ; VFP2-NEXT: pop {r7, pc}
2271 ; FULL-LABEL: ustest_f64i32_mm:
2272 ; FULL: @ %bb.0: @ %entry
2273 ; FULL-NEXT: vcvt.u32.f64 s0, d0
2274 ; FULL-NEXT: vmov r0, s0
2277 %conv = fptosi double %x to i64
2278 %spec.store.select = call i64 @llvm.smin.i64(i64 %conv, i64 4294967295)
2279 %spec.store.select7 = call i64 @llvm.smax.i64(i64 %spec.store.select, i64 0)
2280 %conv6 = trunc i64 %spec.store.select7 to i32
2284 define i32 @stest_f32i32_mm(float %x) {
2285 ; SOFT-LABEL: stest_f32i32_mm:
2286 ; SOFT: @ %bb.0: @ %entry
2287 ; SOFT-NEXT: .save {r4, r5, r7, lr}
2288 ; SOFT-NEXT: push {r4, r5, r7, lr}
2289 ; SOFT-NEXT: bl __aeabi_f2lz
2290 ; SOFT-NEXT: movs r2, #1
2291 ; SOFT-NEXT: movs r3, #0
2292 ; SOFT-NEXT: ldr r4, .LCPI30_0
2293 ; SOFT-NEXT: subs r5, r0, r4
2294 ; SOFT-NEXT: mov r5, r1
2295 ; SOFT-NEXT: sbcs r5, r3
2296 ; SOFT-NEXT: mov r5, r2
2297 ; SOFT-NEXT: bge .LBB30_7
2298 ; SOFT-NEXT: @ %bb.1: @ %entry
2299 ; SOFT-NEXT: cmp r5, #0
2300 ; SOFT-NEXT: beq .LBB30_8
2301 ; SOFT-NEXT: .LBB30_2: @ %entry
2302 ; SOFT-NEXT: cmp r5, #0
2303 ; SOFT-NEXT: bne .LBB30_4
2304 ; SOFT-NEXT: .LBB30_3: @ %entry
2305 ; SOFT-NEXT: mov r0, r4
2306 ; SOFT-NEXT: .LBB30_4: @ %entry
2307 ; SOFT-NEXT: mvns r3, r3
2308 ; SOFT-NEXT: lsls r2, r2, #31
2309 ; SOFT-NEXT: subs r4, r2, r0
2310 ; SOFT-NEXT: sbcs r3, r1
2311 ; SOFT-NEXT: blt .LBB30_6
2312 ; SOFT-NEXT: @ %bb.5: @ %entry
2313 ; SOFT-NEXT: mov r0, r2
2314 ; SOFT-NEXT: .LBB30_6: @ %entry
2315 ; SOFT-NEXT: pop {r4, r5, r7, pc}
2316 ; SOFT-NEXT: .LBB30_7: @ %entry
2317 ; SOFT-NEXT: mov r5, r3
2318 ; SOFT-NEXT: cmp r5, #0
2319 ; SOFT-NEXT: bne .LBB30_2
2320 ; SOFT-NEXT: .LBB30_8: @ %entry
2321 ; SOFT-NEXT: mov r1, r5
2322 ; SOFT-NEXT: cmp r5, #0
2323 ; SOFT-NEXT: beq .LBB30_3
2324 ; SOFT-NEXT: b .LBB30_4
2325 ; SOFT-NEXT: .p2align 2
2326 ; SOFT-NEXT: @ %bb.9:
2327 ; SOFT-NEXT: .LCPI30_0:
2328 ; SOFT-NEXT: .long 2147483647 @ 0x7fffffff
2330 ; VFP-LABEL: stest_f32i32_mm:
2331 ; VFP: @ %bb.0: @ %entry
2332 ; VFP-NEXT: vcvt.s32.f32 s0, s0
2333 ; VFP-NEXT: vmov r0, s0
2336 %conv = fptosi float %x to i64
2337 %spec.store.select = call i64 @llvm.smin.i64(i64 %conv, i64 2147483647)
2338 %spec.store.select7 = call i64 @llvm.smax.i64(i64 %spec.store.select, i64 -2147483648)
2339 %conv6 = trunc i64 %spec.store.select7 to i32
2343 define i32 @utest_f32i32_mm(float %x) {
2344 ; SOFT-LABEL: utest_f32i32_mm:
2345 ; SOFT: @ %bb.0: @ %entry
2346 ; SOFT-NEXT: .save {r7, lr}
2347 ; SOFT-NEXT: push {r7, lr}
2348 ; SOFT-NEXT: bl __aeabi_f2ulz
2349 ; SOFT-NEXT: cmp r1, #0
2350 ; SOFT-NEXT: beq .LBB31_2
2351 ; SOFT-NEXT: @ %bb.1: @ %entry
2352 ; SOFT-NEXT: movs r0, #0
2353 ; SOFT-NEXT: mvns r0, r0
2354 ; SOFT-NEXT: .LBB31_2: @ %entry
2355 ; SOFT-NEXT: pop {r7, pc}
2357 ; VFP-LABEL: utest_f32i32_mm:
2358 ; VFP: @ %bb.0: @ %entry
2359 ; VFP-NEXT: vcvt.u32.f32 s0, s0
2360 ; VFP-NEXT: vmov r0, s0
2363 %conv = fptoui float %x to i64
2364 %spec.store.select = call i64 @llvm.umin.i64(i64 %conv, i64 4294967295)
2365 %conv6 = trunc i64 %spec.store.select to i32
2369 define i32 @ustest_f32i32_mm(float %x) {
2370 ; SOFT-LABEL: ustest_f32i32_mm:
2371 ; SOFT: @ %bb.0: @ %entry
2372 ; SOFT-NEXT: .save {r7, lr}
2373 ; SOFT-NEXT: push {r7, lr}
2374 ; SOFT-NEXT: bl __aeabi_f2lz
2375 ; SOFT-NEXT: mov r2, r0
2376 ; SOFT-NEXT: movs r0, #0
2377 ; SOFT-NEXT: cmp r1, #1
2378 ; SOFT-NEXT: blt .LBB32_2
2379 ; SOFT-NEXT: @ %bb.1: @ %entry
2380 ; SOFT-NEXT: mvns r2, r0
2381 ; SOFT-NEXT: .LBB32_2: @ %entry
2382 ; SOFT-NEXT: asrs r3, r1, #31
2383 ; SOFT-NEXT: ands r3, r1
2384 ; SOFT-NEXT: bmi .LBB32_4
2385 ; SOFT-NEXT: @ %bb.3: @ %entry
2386 ; SOFT-NEXT: mov r0, r2
2387 ; SOFT-NEXT: .LBB32_4: @ %entry
2388 ; SOFT-NEXT: pop {r7, pc}
2390 ; VFP-LABEL: ustest_f32i32_mm:
2391 ; VFP: @ %bb.0: @ %entry
2392 ; VFP-NEXT: vcvt.u32.f32 s0, s0
2393 ; VFP-NEXT: vmov r0, s0
2396 %conv = fptosi float %x to i64
2397 %spec.store.select = call i64 @llvm.smin.i64(i64 %conv, i64 4294967295)
2398 %spec.store.select7 = call i64 @llvm.smax.i64(i64 %spec.store.select, i64 0)
2399 %conv6 = trunc i64 %spec.store.select7 to i32
2403 define i32 @stest_f16i32_mm(half %x) {
2404 ; SOFT-LABEL: stest_f16i32_mm:
2405 ; SOFT: @ %bb.0: @ %entry
2406 ; SOFT-NEXT: .save {r4, r5, r7, lr}
2407 ; SOFT-NEXT: push {r4, r5, r7, lr}
2408 ; SOFT-NEXT: uxth r0, r0
2409 ; SOFT-NEXT: bl __aeabi_h2f
2410 ; SOFT-NEXT: bl __aeabi_f2lz
2411 ; SOFT-NEXT: movs r2, #1
2412 ; SOFT-NEXT: movs r3, #0
2413 ; SOFT-NEXT: ldr r4, .LCPI33_0
2414 ; SOFT-NEXT: subs r5, r0, r4
2415 ; SOFT-NEXT: mov r5, r1
2416 ; SOFT-NEXT: sbcs r5, r3
2417 ; SOFT-NEXT: mov r5, r2
2418 ; SOFT-NEXT: bge .LBB33_7
2419 ; SOFT-NEXT: @ %bb.1: @ %entry
2420 ; SOFT-NEXT: cmp r5, #0
2421 ; SOFT-NEXT: beq .LBB33_8
2422 ; SOFT-NEXT: .LBB33_2: @ %entry
2423 ; SOFT-NEXT: cmp r5, #0
2424 ; SOFT-NEXT: bne .LBB33_4
2425 ; SOFT-NEXT: .LBB33_3: @ %entry
2426 ; SOFT-NEXT: mov r0, r4
2427 ; SOFT-NEXT: .LBB33_4: @ %entry
2428 ; SOFT-NEXT: mvns r3, r3
2429 ; SOFT-NEXT: lsls r2, r2, #31
2430 ; SOFT-NEXT: subs r4, r2, r0
2431 ; SOFT-NEXT: sbcs r3, r1
2432 ; SOFT-NEXT: blt .LBB33_6
2433 ; SOFT-NEXT: @ %bb.5: @ %entry
2434 ; SOFT-NEXT: mov r0, r2
2435 ; SOFT-NEXT: .LBB33_6: @ %entry
2436 ; SOFT-NEXT: pop {r4, r5, r7, pc}
2437 ; SOFT-NEXT: .LBB33_7: @ %entry
2438 ; SOFT-NEXT: mov r5, r3
2439 ; SOFT-NEXT: cmp r5, #0
2440 ; SOFT-NEXT: bne .LBB33_2
2441 ; SOFT-NEXT: .LBB33_8: @ %entry
2442 ; SOFT-NEXT: mov r1, r5
2443 ; SOFT-NEXT: cmp r5, #0
2444 ; SOFT-NEXT: beq .LBB33_3
2445 ; SOFT-NEXT: b .LBB33_4
2446 ; SOFT-NEXT: .p2align 2
2447 ; SOFT-NEXT: @ %bb.9:
2448 ; SOFT-NEXT: .LCPI33_0:
2449 ; SOFT-NEXT: .long 2147483647 @ 0x7fffffff
2451 ; VFP2-LABEL: stest_f16i32_mm:
2452 ; VFP2: @ %bb.0: @ %entry
2453 ; VFP2-NEXT: .save {r7, lr}
2454 ; VFP2-NEXT: push {r7, lr}
2455 ; VFP2-NEXT: vmov r0, s0
2456 ; VFP2-NEXT: bl __aeabi_h2f
2457 ; VFP2-NEXT: vmov s0, r0
2458 ; VFP2-NEXT: vcvt.s32.f32 s0, s0
2459 ; VFP2-NEXT: vmov r0, s0
2460 ; VFP2-NEXT: pop {r7, pc}
2462 ; FULL-LABEL: stest_f16i32_mm:
2463 ; FULL: @ %bb.0: @ %entry
2464 ; FULL-NEXT: vcvt.s32.f16 s0, s0
2465 ; FULL-NEXT: vmov r0, s0
2468 %conv = fptosi half %x to i64
2469 %spec.store.select = call i64 @llvm.smin.i64(i64 %conv, i64 2147483647)
2470 %spec.store.select7 = call i64 @llvm.smax.i64(i64 %spec.store.select, i64 -2147483648)
2471 %conv6 = trunc i64 %spec.store.select7 to i32
2475 define i32 @utesth_f16i32_mm(half %x) {
2476 ; SOFT-LABEL: utesth_f16i32_mm:
2477 ; SOFT: @ %bb.0: @ %entry
2478 ; SOFT-NEXT: .save {r7, lr}
2479 ; SOFT-NEXT: push {r7, lr}
2480 ; SOFT-NEXT: uxth r0, r0
2481 ; SOFT-NEXT: bl __aeabi_h2f
2482 ; SOFT-NEXT: bl __aeabi_f2ulz
2483 ; SOFT-NEXT: cmp r1, #0
2484 ; SOFT-NEXT: beq .LBB34_2
2485 ; SOFT-NEXT: @ %bb.1: @ %entry
2486 ; SOFT-NEXT: movs r0, #0
2487 ; SOFT-NEXT: mvns r0, r0
2488 ; SOFT-NEXT: .LBB34_2: @ %entry
2489 ; SOFT-NEXT: pop {r7, pc}
2491 ; VFP2-LABEL: utesth_f16i32_mm:
2492 ; VFP2: @ %bb.0: @ %entry
2493 ; VFP2-NEXT: .save {r7, lr}
2494 ; VFP2-NEXT: push {r7, lr}
2495 ; VFP2-NEXT: vmov r0, s0
2496 ; VFP2-NEXT: bl __aeabi_h2f
2497 ; VFP2-NEXT: vmov s0, r0
2498 ; VFP2-NEXT: vcvt.u32.f32 s0, s0
2499 ; VFP2-NEXT: vmov r0, s0
2500 ; VFP2-NEXT: pop {r7, pc}
2502 ; FULL-LABEL: utesth_f16i32_mm:
2503 ; FULL: @ %bb.0: @ %entry
2504 ; FULL-NEXT: vcvt.u32.f16 s0, s0
2505 ; FULL-NEXT: vmov r0, s0
2508 %conv = fptoui half %x to i64
2509 %spec.store.select = call i64 @llvm.umin.i64(i64 %conv, i64 4294967295)
2510 %conv6 = trunc i64 %spec.store.select to i32
2514 define i32 @ustest_f16i32_mm(half %x) {
2515 ; SOFT-LABEL: ustest_f16i32_mm:
2516 ; SOFT: @ %bb.0: @ %entry
2517 ; SOFT-NEXT: .save {r7, lr}
2518 ; SOFT-NEXT: push {r7, lr}
2519 ; SOFT-NEXT: uxth r0, r0
2520 ; SOFT-NEXT: bl __aeabi_h2f
2521 ; SOFT-NEXT: bl __aeabi_f2lz
2522 ; SOFT-NEXT: mov r2, r0
2523 ; SOFT-NEXT: movs r0, #0
2524 ; SOFT-NEXT: cmp r1, #1
2525 ; SOFT-NEXT: blt .LBB35_2
2526 ; SOFT-NEXT: @ %bb.1: @ %entry
2527 ; SOFT-NEXT: mvns r2, r0
2528 ; SOFT-NEXT: .LBB35_2: @ %entry
2529 ; SOFT-NEXT: asrs r3, r1, #31
2530 ; SOFT-NEXT: ands r3, r1
2531 ; SOFT-NEXT: bmi .LBB35_4
2532 ; SOFT-NEXT: @ %bb.3: @ %entry
2533 ; SOFT-NEXT: mov r0, r2
2534 ; SOFT-NEXT: .LBB35_4: @ %entry
2535 ; SOFT-NEXT: pop {r7, pc}
2537 ; VFP2-LABEL: ustest_f16i32_mm:
2538 ; VFP2: @ %bb.0: @ %entry
2539 ; VFP2-NEXT: .save {r7, lr}
2540 ; VFP2-NEXT: push {r7, lr}
2541 ; VFP2-NEXT: vmov r0, s0
2542 ; VFP2-NEXT: bl __aeabi_h2f
2543 ; VFP2-NEXT: vmov s0, r0
2544 ; VFP2-NEXT: vcvt.u32.f32 s0, s0
2545 ; VFP2-NEXT: vmov r0, s0
2546 ; VFP2-NEXT: pop {r7, pc}
2548 ; FULL-LABEL: ustest_f16i32_mm:
2549 ; FULL: @ %bb.0: @ %entry
2550 ; FULL-NEXT: vcvt.u32.f16 s0, s0
2551 ; FULL-NEXT: vmov r0, s0
2554 %conv = fptosi half %x to i64
2555 %spec.store.select = call i64 @llvm.smin.i64(i64 %conv, i64 4294967295)
2556 %spec.store.select7 = call i64 @llvm.smax.i64(i64 %spec.store.select, i64 0)
2557 %conv6 = trunc i64 %spec.store.select7 to i32
2563 define i16 @stest_f64i16_mm(double %x) {
2564 ; SOFT-LABEL: stest_f64i16_mm:
2565 ; SOFT: @ %bb.0: @ %entry
2566 ; SOFT-NEXT: .save {r7, lr}
2567 ; SOFT-NEXT: push {r7, lr}
2568 ; SOFT-NEXT: bl __aeabi_d2iz
2569 ; SOFT-NEXT: ldr r1, .LCPI36_0
2570 ; SOFT-NEXT: cmp r0, r1
2571 ; SOFT-NEXT: blt .LBB36_2
2572 ; SOFT-NEXT: @ %bb.1: @ %entry
2573 ; SOFT-NEXT: mov r0, r1
2574 ; SOFT-NEXT: .LBB36_2: @ %entry
2575 ; SOFT-NEXT: ldr r1, .LCPI36_1
2576 ; SOFT-NEXT: cmp r0, r1
2577 ; SOFT-NEXT: bgt .LBB36_4
2578 ; SOFT-NEXT: @ %bb.3: @ %entry
2579 ; SOFT-NEXT: mov r0, r1
2580 ; SOFT-NEXT: .LBB36_4: @ %entry
2581 ; SOFT-NEXT: pop {r7, pc}
2582 ; SOFT-NEXT: .p2align 2
2583 ; SOFT-NEXT: @ %bb.5:
2584 ; SOFT-NEXT: .LCPI36_0:
2585 ; SOFT-NEXT: .long 32767 @ 0x7fff
2586 ; SOFT-NEXT: .LCPI36_1:
2587 ; SOFT-NEXT: .long 4294934528 @ 0xffff8000
2589 ; VFP2-LABEL: stest_f64i16_mm:
2590 ; VFP2: @ %bb.0: @ %entry
2591 ; VFP2-NEXT: .save {r7, lr}
2592 ; VFP2-NEXT: push {r7, lr}
2593 ; VFP2-NEXT: vmov r0, r1, d0
2594 ; VFP2-NEXT: bl __aeabi_d2iz
2595 ; VFP2-NEXT: ssat r0, #16, r0
2596 ; VFP2-NEXT: pop {r7, pc}
2598 ; FULL-LABEL: stest_f64i16_mm:
2599 ; FULL: @ %bb.0: @ %entry
2600 ; FULL-NEXT: vcvt.s32.f64 s0, d0
2601 ; FULL-NEXT: vmov r0, s0
2602 ; FULL-NEXT: ssat r0, #16, r0
2605 %conv = fptosi double %x to i32
2606 %spec.store.select = call i32 @llvm.smin.i32(i32 %conv, i32 32767)
2607 %spec.store.select7 = call i32 @llvm.smax.i32(i32 %spec.store.select, i32 -32768)
2608 %conv6 = trunc i32 %spec.store.select7 to i16
2612 define i16 @utest_f64i16_mm(double %x) {
2613 ; SOFT-LABEL: utest_f64i16_mm:
2614 ; SOFT: @ %bb.0: @ %entry
2615 ; SOFT-NEXT: .save {r7, lr}
2616 ; SOFT-NEXT: push {r7, lr}
2617 ; SOFT-NEXT: bl __aeabi_d2uiz
2618 ; SOFT-NEXT: ldr r1, .LCPI37_0
2619 ; SOFT-NEXT: cmp r0, r1
2620 ; SOFT-NEXT: blo .LBB37_2
2621 ; SOFT-NEXT: @ %bb.1: @ %entry
2622 ; SOFT-NEXT: mov r0, r1
2623 ; SOFT-NEXT: .LBB37_2: @ %entry
2624 ; SOFT-NEXT: pop {r7, pc}
2625 ; SOFT-NEXT: .p2align 2
2626 ; SOFT-NEXT: @ %bb.3:
2627 ; SOFT-NEXT: .LCPI37_0:
2628 ; SOFT-NEXT: .long 65535 @ 0xffff
2630 ; VFP2-LABEL: utest_f64i16_mm:
2631 ; VFP2: @ %bb.0: @ %entry
2632 ; VFP2-NEXT: .save {r7, lr}
2633 ; VFP2-NEXT: push {r7, lr}
2634 ; VFP2-NEXT: vmov r0, r1, d0
2635 ; VFP2-NEXT: bl __aeabi_d2uiz
2636 ; VFP2-NEXT: movw r1, #65535
2637 ; VFP2-NEXT: cmp r0, r1
2639 ; VFP2-NEXT: movhs r0, r1
2640 ; VFP2-NEXT: pop {r7, pc}
2642 ; FULL-LABEL: utest_f64i16_mm:
2643 ; FULL: @ %bb.0: @ %entry
2644 ; FULL-NEXT: vcvt.u32.f64 s0, d0
2645 ; FULL-NEXT: movw r1, #65535
2646 ; FULL-NEXT: vmov r0, s0
2647 ; FULL-NEXT: cmp r0, r1
2648 ; FULL-NEXT: csel r0, r0, r1, lo
2651 %conv = fptoui double %x to i32
2652 %spec.store.select = call i32 @llvm.umin.i32(i32 %conv, i32 65535)
2653 %conv6 = trunc i32 %spec.store.select to i16
2657 define i16 @ustest_f64i16_mm(double %x) {
2658 ; SOFT-LABEL: ustest_f64i16_mm:
2659 ; SOFT: @ %bb.0: @ %entry
2660 ; SOFT-NEXT: .save {r7, lr}
2661 ; SOFT-NEXT: push {r7, lr}
2662 ; SOFT-NEXT: bl __aeabi_d2iz
2663 ; SOFT-NEXT: ldr r1, .LCPI38_0
2664 ; SOFT-NEXT: cmp r0, r1
2665 ; SOFT-NEXT: blt .LBB38_2
2666 ; SOFT-NEXT: @ %bb.1: @ %entry
2667 ; SOFT-NEXT: mov r0, r1
2668 ; SOFT-NEXT: .LBB38_2: @ %entry
2669 ; SOFT-NEXT: asrs r1, r0, #31
2670 ; SOFT-NEXT: bics r0, r1
2671 ; SOFT-NEXT: pop {r7, pc}
2672 ; SOFT-NEXT: .p2align 2
2673 ; SOFT-NEXT: @ %bb.3:
2674 ; SOFT-NEXT: .LCPI38_0:
2675 ; SOFT-NEXT: .long 65535 @ 0xffff
2677 ; VFP2-LABEL: ustest_f64i16_mm:
2678 ; VFP2: @ %bb.0: @ %entry
2679 ; VFP2-NEXT: .save {r7, lr}
2680 ; VFP2-NEXT: push {r7, lr}
2681 ; VFP2-NEXT: vmov r0, r1, d0
2682 ; VFP2-NEXT: bl __aeabi_d2iz
2683 ; VFP2-NEXT: usat r0, #16, r0
2684 ; VFP2-NEXT: pop {r7, pc}
2686 ; FULL-LABEL: ustest_f64i16_mm:
2687 ; FULL: @ %bb.0: @ %entry
2688 ; FULL-NEXT: vcvt.s32.f64 s0, d0
2689 ; FULL-NEXT: vmov r0, s0
2690 ; FULL-NEXT: usat r0, #16, r0
2693 %conv = fptosi double %x to i32
2694 %spec.store.select = call i32 @llvm.smin.i32(i32 %conv, i32 65535)
2695 %spec.store.select7 = call i32 @llvm.smax.i32(i32 %spec.store.select, i32 0)
2696 %conv6 = trunc i32 %spec.store.select7 to i16
2700 define i16 @stest_f32i16_mm(float %x) {
2701 ; SOFT-LABEL: stest_f32i16_mm:
2702 ; SOFT: @ %bb.0: @ %entry
2703 ; SOFT-NEXT: .save {r7, lr}
2704 ; SOFT-NEXT: push {r7, lr}
2705 ; SOFT-NEXT: bl __aeabi_f2iz
2706 ; SOFT-NEXT: ldr r1, .LCPI39_0
2707 ; SOFT-NEXT: cmp r0, r1
2708 ; SOFT-NEXT: blt .LBB39_2
2709 ; SOFT-NEXT: @ %bb.1: @ %entry
2710 ; SOFT-NEXT: mov r0, r1
2711 ; SOFT-NEXT: .LBB39_2: @ %entry
2712 ; SOFT-NEXT: ldr r1, .LCPI39_1
2713 ; SOFT-NEXT: cmp r0, r1
2714 ; SOFT-NEXT: bgt .LBB39_4
2715 ; SOFT-NEXT: @ %bb.3: @ %entry
2716 ; SOFT-NEXT: mov r0, r1
2717 ; SOFT-NEXT: .LBB39_4: @ %entry
2718 ; SOFT-NEXT: pop {r7, pc}
2719 ; SOFT-NEXT: .p2align 2
2720 ; SOFT-NEXT: @ %bb.5:
2721 ; SOFT-NEXT: .LCPI39_0:
2722 ; SOFT-NEXT: .long 32767 @ 0x7fff
2723 ; SOFT-NEXT: .LCPI39_1:
2724 ; SOFT-NEXT: .long 4294934528 @ 0xffff8000
2726 ; VFP-LABEL: stest_f32i16_mm:
2727 ; VFP: @ %bb.0: @ %entry
2728 ; VFP-NEXT: vcvt.s32.f32 s0, s0
2729 ; VFP-NEXT: vmov r0, s0
2730 ; VFP-NEXT: ssat r0, #16, r0
2733 %conv = fptosi float %x to i32
2734 %spec.store.select = call i32 @llvm.smin.i32(i32 %conv, i32 32767)
2735 %spec.store.select7 = call i32 @llvm.smax.i32(i32 %spec.store.select, i32 -32768)
2736 %conv6 = trunc i32 %spec.store.select7 to i16
2740 define i16 @utest_f32i16_mm(float %x) {
2741 ; SOFT-LABEL: utest_f32i16_mm:
2742 ; SOFT: @ %bb.0: @ %entry
2743 ; SOFT-NEXT: .save {r7, lr}
2744 ; SOFT-NEXT: push {r7, lr}
2745 ; SOFT-NEXT: bl __aeabi_f2uiz
2746 ; SOFT-NEXT: ldr r1, .LCPI40_0
2747 ; SOFT-NEXT: cmp r0, r1
2748 ; SOFT-NEXT: blo .LBB40_2
2749 ; SOFT-NEXT: @ %bb.1: @ %entry
2750 ; SOFT-NEXT: mov r0, r1
2751 ; SOFT-NEXT: .LBB40_2: @ %entry
2752 ; SOFT-NEXT: pop {r7, pc}
2753 ; SOFT-NEXT: .p2align 2
2754 ; SOFT-NEXT: @ %bb.3:
2755 ; SOFT-NEXT: .LCPI40_0:
2756 ; SOFT-NEXT: .long 65535 @ 0xffff
2758 ; VFP2-LABEL: utest_f32i16_mm:
2759 ; VFP2: @ %bb.0: @ %entry
2760 ; VFP2-NEXT: vcvt.u32.f32 s0, s0
2761 ; VFP2-NEXT: movw r0, #65535
2762 ; VFP2-NEXT: vmov r1, s0
2763 ; VFP2-NEXT: cmp r1, r0
2765 ; VFP2-NEXT: movlo r0, r1
2768 ; FULL-LABEL: utest_f32i16_mm:
2769 ; FULL: @ %bb.0: @ %entry
2770 ; FULL-NEXT: vcvt.u32.f32 s0, s0
2771 ; FULL-NEXT: movw r1, #65535
2772 ; FULL-NEXT: vmov r0, s0
2773 ; FULL-NEXT: cmp r0, r1
2774 ; FULL-NEXT: csel r0, r0, r1, lo
2777 %conv = fptoui float %x to i32
2778 %spec.store.select = call i32 @llvm.umin.i32(i32 %conv, i32 65535)
2779 %conv6 = trunc i32 %spec.store.select to i16
2783 define i16 @ustest_f32i16_mm(float %x) {
2784 ; SOFT-LABEL: ustest_f32i16_mm:
2785 ; SOFT: @ %bb.0: @ %entry
2786 ; SOFT-NEXT: .save {r7, lr}
2787 ; SOFT-NEXT: push {r7, lr}
2788 ; SOFT-NEXT: bl __aeabi_f2iz
2789 ; SOFT-NEXT: ldr r1, .LCPI41_0
2790 ; SOFT-NEXT: cmp r0, r1
2791 ; SOFT-NEXT: blt .LBB41_2
2792 ; SOFT-NEXT: @ %bb.1: @ %entry
2793 ; SOFT-NEXT: mov r0, r1
2794 ; SOFT-NEXT: .LBB41_2: @ %entry
2795 ; SOFT-NEXT: asrs r1, r0, #31
2796 ; SOFT-NEXT: bics r0, r1
2797 ; SOFT-NEXT: pop {r7, pc}
2798 ; SOFT-NEXT: .p2align 2
2799 ; SOFT-NEXT: @ %bb.3:
2800 ; SOFT-NEXT: .LCPI41_0:
2801 ; SOFT-NEXT: .long 65535 @ 0xffff
2803 ; VFP-LABEL: ustest_f32i16_mm:
2804 ; VFP: @ %bb.0: @ %entry
2805 ; VFP-NEXT: vcvt.s32.f32 s0, s0
2806 ; VFP-NEXT: vmov r0, s0
2807 ; VFP-NEXT: usat r0, #16, r0
2810 %conv = fptosi float %x to i32
2811 %spec.store.select = call i32 @llvm.smin.i32(i32 %conv, i32 65535)
2812 %spec.store.select7 = call i32 @llvm.smax.i32(i32 %spec.store.select, i32 0)
2813 %conv6 = trunc i32 %spec.store.select7 to i16
2817 define i16 @stest_f16i16_mm(half %x) {
2818 ; SOFT-LABEL: stest_f16i16_mm:
2819 ; SOFT: @ %bb.0: @ %entry
2820 ; SOFT-NEXT: .save {r7, lr}
2821 ; SOFT-NEXT: push {r7, lr}
2822 ; SOFT-NEXT: uxth r0, r0
2823 ; SOFT-NEXT: bl __aeabi_h2f
2824 ; SOFT-NEXT: bl __aeabi_f2iz
2825 ; SOFT-NEXT: ldr r1, .LCPI42_0
2826 ; SOFT-NEXT: cmp r0, r1
2827 ; SOFT-NEXT: blt .LBB42_2
2828 ; SOFT-NEXT: @ %bb.1: @ %entry
2829 ; SOFT-NEXT: mov r0, r1
2830 ; SOFT-NEXT: .LBB42_2: @ %entry
2831 ; SOFT-NEXT: ldr r1, .LCPI42_1
2832 ; SOFT-NEXT: cmp r0, r1
2833 ; SOFT-NEXT: bgt .LBB42_4
2834 ; SOFT-NEXT: @ %bb.3: @ %entry
2835 ; SOFT-NEXT: mov r0, r1
2836 ; SOFT-NEXT: .LBB42_4: @ %entry
2837 ; SOFT-NEXT: pop {r7, pc}
2838 ; SOFT-NEXT: .p2align 2
2839 ; SOFT-NEXT: @ %bb.5:
2840 ; SOFT-NEXT: .LCPI42_0:
2841 ; SOFT-NEXT: .long 32767 @ 0x7fff
2842 ; SOFT-NEXT: .LCPI42_1:
2843 ; SOFT-NEXT: .long 4294934528 @ 0xffff8000
2845 ; VFP2-LABEL: stest_f16i16_mm:
2846 ; VFP2: @ %bb.0: @ %entry
2847 ; VFP2-NEXT: .save {r7, lr}
2848 ; VFP2-NEXT: push {r7, lr}
2849 ; VFP2-NEXT: vmov r0, s0
2850 ; VFP2-NEXT: bl __aeabi_h2f
2851 ; VFP2-NEXT: vmov s0, r0
2852 ; VFP2-NEXT: vcvt.s32.f32 s0, s0
2853 ; VFP2-NEXT: vmov r0, s0
2854 ; VFP2-NEXT: ssat r0, #16, r0
2855 ; VFP2-NEXT: pop {r7, pc}
2857 ; FULL-LABEL: stest_f16i16_mm:
2858 ; FULL: @ %bb.0: @ %entry
2859 ; FULL-NEXT: vcvt.s32.f16 s0, s0
2860 ; FULL-NEXT: vmov r0, s0
2861 ; FULL-NEXT: ssat r0, #16, r0
2864 %conv = fptosi half %x to i32
2865 %spec.store.select = call i32 @llvm.smin.i32(i32 %conv, i32 32767)
2866 %spec.store.select7 = call i32 @llvm.smax.i32(i32 %spec.store.select, i32 -32768)
2867 %conv6 = trunc i32 %spec.store.select7 to i16
2871 define i16 @utesth_f16i16_mm(half %x) {
2872 ; SOFT-LABEL: utesth_f16i16_mm:
2873 ; SOFT: @ %bb.0: @ %entry
2874 ; SOFT-NEXT: .save {r7, lr}
2875 ; SOFT-NEXT: push {r7, lr}
2876 ; SOFT-NEXT: uxth r0, r0
2877 ; SOFT-NEXT: bl __aeabi_h2f
2878 ; SOFT-NEXT: bl __aeabi_f2uiz
2879 ; SOFT-NEXT: ldr r1, .LCPI43_0
2880 ; SOFT-NEXT: cmp r0, r1
2881 ; SOFT-NEXT: blo .LBB43_2
2882 ; SOFT-NEXT: @ %bb.1: @ %entry
2883 ; SOFT-NEXT: mov r0, r1
2884 ; SOFT-NEXT: .LBB43_2: @ %entry
2885 ; SOFT-NEXT: pop {r7, pc}
2886 ; SOFT-NEXT: .p2align 2
2887 ; SOFT-NEXT: @ %bb.3:
2888 ; SOFT-NEXT: .LCPI43_0:
2889 ; SOFT-NEXT: .long 65535 @ 0xffff
2891 ; VFP2-LABEL: utesth_f16i16_mm:
2892 ; VFP2: @ %bb.0: @ %entry
2893 ; VFP2-NEXT: .save {r7, lr}
2894 ; VFP2-NEXT: push {r7, lr}
2895 ; VFP2-NEXT: vmov r0, s0
2896 ; VFP2-NEXT: bl __aeabi_h2f
2897 ; VFP2-NEXT: vmov s0, r0
2898 ; VFP2-NEXT: movw r0, #65535
2899 ; VFP2-NEXT: vcvt.u32.f32 s0, s0
2900 ; VFP2-NEXT: vmov r1, s0
2901 ; VFP2-NEXT: cmp r1, r0
2903 ; VFP2-NEXT: movlo r0, r1
2904 ; VFP2-NEXT: pop {r7, pc}
2906 ; FULL-LABEL: utesth_f16i16_mm:
2907 ; FULL: @ %bb.0: @ %entry
2908 ; FULL-NEXT: vcvt.u32.f16 s0, s0
2909 ; FULL-NEXT: movw r1, #65535
2910 ; FULL-NEXT: vmov r0, s0
2911 ; FULL-NEXT: cmp r0, r1
2912 ; FULL-NEXT: csel r0, r0, r1, lo
2915 %conv = fptoui half %x to i32
2916 %spec.store.select = call i32 @llvm.umin.i32(i32 %conv, i32 65535)
2917 %conv6 = trunc i32 %spec.store.select to i16
2921 define i16 @ustest_f16i16_mm(half %x) {
2922 ; SOFT-LABEL: ustest_f16i16_mm:
2923 ; SOFT: @ %bb.0: @ %entry
2924 ; SOFT-NEXT: .save {r7, lr}
2925 ; SOFT-NEXT: push {r7, lr}
2926 ; SOFT-NEXT: uxth r0, r0
2927 ; SOFT-NEXT: bl __aeabi_h2f
2928 ; SOFT-NEXT: bl __aeabi_f2iz
2929 ; SOFT-NEXT: ldr r1, .LCPI44_0
2930 ; SOFT-NEXT: cmp r0, r1
2931 ; SOFT-NEXT: blt .LBB44_2
2932 ; SOFT-NEXT: @ %bb.1: @ %entry
2933 ; SOFT-NEXT: mov r0, r1
2934 ; SOFT-NEXT: .LBB44_2: @ %entry
2935 ; SOFT-NEXT: asrs r1, r0, #31
2936 ; SOFT-NEXT: bics r0, r1
2937 ; SOFT-NEXT: pop {r7, pc}
2938 ; SOFT-NEXT: .p2align 2
2939 ; SOFT-NEXT: @ %bb.3:
2940 ; SOFT-NEXT: .LCPI44_0:
2941 ; SOFT-NEXT: .long 65535 @ 0xffff
2943 ; VFP2-LABEL: ustest_f16i16_mm:
2944 ; VFP2: @ %bb.0: @ %entry
2945 ; VFP2-NEXT: .save {r7, lr}
2946 ; VFP2-NEXT: push {r7, lr}
2947 ; VFP2-NEXT: vmov r0, s0
2948 ; VFP2-NEXT: bl __aeabi_h2f
2949 ; VFP2-NEXT: vmov s0, r0
2950 ; VFP2-NEXT: vcvt.s32.f32 s0, s0
2951 ; VFP2-NEXT: vmov r0, s0
2952 ; VFP2-NEXT: usat r0, #16, r0
2953 ; VFP2-NEXT: pop {r7, pc}
2955 ; FULL-LABEL: ustest_f16i16_mm:
2956 ; FULL: @ %bb.0: @ %entry
2957 ; FULL-NEXT: vcvt.s32.f16 s0, s0
2958 ; FULL-NEXT: vmov r0, s0
2959 ; FULL-NEXT: usat r0, #16, r0
2962 %conv = fptosi half %x to i32
2963 %spec.store.select = call i32 @llvm.smin.i32(i32 %conv, i32 65535)
2964 %spec.store.select7 = call i32 @llvm.smax.i32(i32 %spec.store.select, i32 0)
2965 %conv6 = trunc i32 %spec.store.select7 to i16
2971 define i64 @stest_f64i64_mm(double %x) {
2972 ; SOFT-LABEL: stest_f64i64_mm:
2973 ; SOFT: @ %bb.0: @ %entry
2974 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
2975 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
2976 ; SOFT-NEXT: .pad #4
2977 ; SOFT-NEXT: sub sp, #4
2978 ; SOFT-NEXT: bl __fixdfti
2979 ; SOFT-NEXT: movs r4, #1
2980 ; SOFT-NEXT: movs r5, #0
2981 ; SOFT-NEXT: ldr r6, .LCPI45_0
2982 ; SOFT-NEXT: str r0, [sp] @ 4-byte Spill
2983 ; SOFT-NEXT: adds r0, r0, #1
2984 ; SOFT-NEXT: mov r0, r1
2985 ; SOFT-NEXT: sbcs r0, r6
2986 ; SOFT-NEXT: mov r0, r2
2987 ; SOFT-NEXT: sbcs r0, r5
2988 ; SOFT-NEXT: mov r0, r3
2989 ; SOFT-NEXT: sbcs r0, r5
2990 ; SOFT-NEXT: mov r7, r4
2991 ; SOFT-NEXT: bge .LBB45_12
2992 ; SOFT-NEXT: @ %bb.1: @ %entry
2993 ; SOFT-NEXT: cmp r7, #0
2994 ; SOFT-NEXT: beq .LBB45_13
2995 ; SOFT-NEXT: .LBB45_2: @ %entry
2996 ; SOFT-NEXT: cmp r7, #0
2997 ; SOFT-NEXT: beq .LBB45_14
2998 ; SOFT-NEXT: .LBB45_3: @ %entry
2999 ; SOFT-NEXT: cmp r7, #0
3000 ; SOFT-NEXT: bne .LBB45_5
3001 ; SOFT-NEXT: .LBB45_4: @ %entry
3002 ; SOFT-NEXT: mov r1, r6
3003 ; SOFT-NEXT: .LBB45_5: @ %entry
3004 ; SOFT-NEXT: mvns r0, r5
3005 ; SOFT-NEXT: cmp r7, #0
3006 ; SOFT-NEXT: bne .LBB45_7
3007 ; SOFT-NEXT: @ %bb.6: @ %entry
3008 ; SOFT-NEXT: str r0, [sp] @ 4-byte Spill
3009 ; SOFT-NEXT: .LBB45_7: @ %entry
3010 ; SOFT-NEXT: lsls r6, r4, #31
3011 ; SOFT-NEXT: ldr r7, [sp] @ 4-byte Reload
3012 ; SOFT-NEXT: rsbs r7, r7, #0
3013 ; SOFT-NEXT: mov r7, r6
3014 ; SOFT-NEXT: sbcs r7, r1
3015 ; SOFT-NEXT: mov r7, r0
3016 ; SOFT-NEXT: sbcs r7, r2
3017 ; SOFT-NEXT: sbcs r0, r3
3018 ; SOFT-NEXT: bge .LBB45_15
3019 ; SOFT-NEXT: @ %bb.8: @ %entry
3020 ; SOFT-NEXT: cmp r4, #0
3021 ; SOFT-NEXT: beq .LBB45_16
3022 ; SOFT-NEXT: .LBB45_9: @ %entry
3023 ; SOFT-NEXT: cmp r4, #0
3024 ; SOFT-NEXT: bne .LBB45_11
3025 ; SOFT-NEXT: .LBB45_10: @ %entry
3026 ; SOFT-NEXT: str r4, [sp] @ 4-byte Spill
3027 ; SOFT-NEXT: .LBB45_11: @ %entry
3028 ; SOFT-NEXT: ldr r0, [sp] @ 4-byte Reload
3029 ; SOFT-NEXT: add sp, #4
3030 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
3031 ; SOFT-NEXT: .LBB45_12: @ %entry
3032 ; SOFT-NEXT: mov r7, r5
3033 ; SOFT-NEXT: cmp r7, #0
3034 ; SOFT-NEXT: bne .LBB45_2
3035 ; SOFT-NEXT: .LBB45_13: @ %entry
3036 ; SOFT-NEXT: mov r3, r7
3037 ; SOFT-NEXT: cmp r7, #0
3038 ; SOFT-NEXT: bne .LBB45_3
3039 ; SOFT-NEXT: .LBB45_14: @ %entry
3040 ; SOFT-NEXT: mov r2, r7
3041 ; SOFT-NEXT: cmp r7, #0
3042 ; SOFT-NEXT: beq .LBB45_4
3043 ; SOFT-NEXT: b .LBB45_5
3044 ; SOFT-NEXT: .LBB45_15: @ %entry
3045 ; SOFT-NEXT: mov r4, r5
3046 ; SOFT-NEXT: cmp r4, #0
3047 ; SOFT-NEXT: bne .LBB45_9
3048 ; SOFT-NEXT: .LBB45_16: @ %entry
3049 ; SOFT-NEXT: mov r1, r6
3050 ; SOFT-NEXT: cmp r4, #0
3051 ; SOFT-NEXT: beq .LBB45_10
3052 ; SOFT-NEXT: b .LBB45_11
3053 ; SOFT-NEXT: .p2align 2
3054 ; SOFT-NEXT: @ %bb.17:
3055 ; SOFT-NEXT: .LCPI45_0:
3056 ; SOFT-NEXT: .long 2147483647 @ 0x7fffffff
3058 ; VFP2-LABEL: stest_f64i64_mm:
3059 ; VFP2: @ %bb.0: @ %entry
3060 ; VFP2-NEXT: .save {r4, r5, r7, lr}
3061 ; VFP2-NEXT: push {r4, r5, r7, lr}
3062 ; VFP2-NEXT: bl __fixdfti
3063 ; VFP2-NEXT: subs.w r4, r0, #-1
3064 ; VFP2-NEXT: mvn lr, #-2147483648
3065 ; VFP2-NEXT: sbcs.w r4, r1, lr
3066 ; VFP2-NEXT: mov.w r12, #0
3067 ; VFP2-NEXT: sbcs r4, r2, #0
3068 ; VFP2-NEXT: sbcs r4, r3, #0
3069 ; VFP2-NEXT: mov.w r4, #0
3071 ; VFP2-NEXT: movlt r4, #1
3072 ; VFP2-NEXT: cmp r4, #0
3073 ; VFP2-NEXT: itet eq
3074 ; VFP2-NEXT: moveq r3, r4
3075 ; VFP2-NEXT: movne r4, r2
3076 ; VFP2-NEXT: moveq r1, lr
3077 ; VFP2-NEXT: mov.w r2, #-1
3079 ; VFP2-NEXT: moveq r0, r2
3080 ; VFP2-NEXT: rsbs r5, r0, #0
3081 ; VFP2-NEXT: mov.w lr, #-2147483648
3082 ; VFP2-NEXT: sbcs.w r5, lr, r1
3083 ; VFP2-NEXT: sbcs.w r4, r2, r4
3084 ; VFP2-NEXT: sbcs r2, r3
3086 ; VFP2-NEXT: movlt.w r12, #1
3087 ; VFP2-NEXT: cmp.w r12, #0
3089 ; VFP2-NEXT: moveq r1, lr
3090 ; VFP2-NEXT: moveq r0, r12
3091 ; VFP2-NEXT: pop {r4, r5, r7, pc}
3093 ; FULL-LABEL: stest_f64i64_mm:
3094 ; FULL: @ %bb.0: @ %entry
3095 ; FULL-NEXT: .save {r4, r5, r7, lr}
3096 ; FULL-NEXT: push {r4, r5, r7, lr}
3097 ; FULL-NEXT: bl __fixdfti
3098 ; FULL-NEXT: subs.w lr, r0, #-1
3099 ; FULL-NEXT: mvn r12, #-2147483648
3100 ; FULL-NEXT: sbcs.w lr, r1, r12
3101 ; FULL-NEXT: sbcs lr, r2, #0
3102 ; FULL-NEXT: sbcs lr, r3, #0
3103 ; FULL-NEXT: cset lr, lt
3104 ; FULL-NEXT: cmp.w lr, #0
3105 ; FULL-NEXT: csel r5, r3, lr, ne
3106 ; FULL-NEXT: mov.w r3, #-1
3107 ; FULL-NEXT: csel r0, r0, r3, ne
3108 ; FULL-NEXT: csel r1, r1, r12, ne
3109 ; FULL-NEXT: csel r2, r2, lr, ne
3110 ; FULL-NEXT: rsbs r4, r0, #0
3111 ; FULL-NEXT: mov.w r12, #-2147483648
3112 ; FULL-NEXT: sbcs.w r4, r12, r1
3113 ; FULL-NEXT: sbcs.w r2, r3, r2
3114 ; FULL-NEXT: sbcs.w r2, r3, r5
3115 ; FULL-NEXT: cset r2, lt
3116 ; FULL-NEXT: cmp r2, #0
3117 ; FULL-NEXT: csel r1, r1, r12, ne
3118 ; FULL-NEXT: csel r0, r0, r2, ne
3119 ; FULL-NEXT: pop {r4, r5, r7, pc}
3121 %conv = fptosi double %x to i128
3122 %spec.store.select = call i128 @llvm.smin.i128(i128 %conv, i128 9223372036854775807)
3123 %spec.store.select7 = call i128 @llvm.smax.i128(i128 %spec.store.select, i128 -9223372036854775808)
3124 %conv6 = trunc i128 %spec.store.select7 to i64
3128 define i64 @utest_f64i64_mm(double %x) {
3129 ; SOFT-LABEL: utest_f64i64_mm:
3130 ; SOFT: @ %bb.0: @ %entry
3131 ; SOFT-NEXT: .save {r4, lr}
3132 ; SOFT-NEXT: push {r4, lr}
3133 ; SOFT-NEXT: bl __fixunsdfti
3134 ; SOFT-NEXT: movs r4, #0
3135 ; SOFT-NEXT: subs r2, r2, #1
3136 ; SOFT-NEXT: sbcs r3, r4
3137 ; SOFT-NEXT: blo .LBB46_4
3138 ; SOFT-NEXT: @ %bb.1: @ %entry
3139 ; SOFT-NEXT: cmp r4, #0
3140 ; SOFT-NEXT: beq .LBB46_5
3141 ; SOFT-NEXT: .LBB46_2: @ %entry
3142 ; SOFT-NEXT: cmp r4, #0
3143 ; SOFT-NEXT: beq .LBB46_6
3144 ; SOFT-NEXT: .LBB46_3: @ %entry
3145 ; SOFT-NEXT: pop {r4, pc}
3146 ; SOFT-NEXT: .LBB46_4:
3147 ; SOFT-NEXT: movs r4, #1
3148 ; SOFT-NEXT: cmp r4, #0
3149 ; SOFT-NEXT: bne .LBB46_2
3150 ; SOFT-NEXT: .LBB46_5: @ %entry
3151 ; SOFT-NEXT: mov r0, r4
3152 ; SOFT-NEXT: cmp r4, #0
3153 ; SOFT-NEXT: bne .LBB46_3
3154 ; SOFT-NEXT: .LBB46_6: @ %entry
3155 ; SOFT-NEXT: mov r1, r4
3156 ; SOFT-NEXT: pop {r4, pc}
3158 ; VFP2-LABEL: utest_f64i64_mm:
3159 ; VFP2: @ %bb.0: @ %entry
3160 ; VFP2-NEXT: .save {r7, lr}
3161 ; VFP2-NEXT: push {r7, lr}
3162 ; VFP2-NEXT: bl __fixunsdfti
3163 ; VFP2-NEXT: subs r2, #1
3164 ; VFP2-NEXT: mov.w r12, #0
3165 ; VFP2-NEXT: sbcs r2, r3, #0
3167 ; VFP2-NEXT: movlo.w r12, #1
3168 ; VFP2-NEXT: cmp.w r12, #0
3170 ; VFP2-NEXT: moveq r0, r12
3171 ; VFP2-NEXT: moveq r1, r12
3172 ; VFP2-NEXT: pop {r7, pc}
3174 ; FULL-LABEL: utest_f64i64_mm:
3175 ; FULL: @ %bb.0: @ %entry
3176 ; FULL-NEXT: .save {r7, lr}
3177 ; FULL-NEXT: push {r7, lr}
3178 ; FULL-NEXT: bl __fixunsdfti
3179 ; FULL-NEXT: subs r2, #1
3180 ; FULL-NEXT: sbcs r2, r3, #0
3181 ; FULL-NEXT: cset r2, lo
3182 ; FULL-NEXT: cmp r2, #0
3183 ; FULL-NEXT: csel r0, r0, r2, ne
3184 ; FULL-NEXT: csel r1, r1, r2, ne
3185 ; FULL-NEXT: pop {r7, pc}
3187 %conv = fptoui double %x to i128
3188 %spec.store.select = call i128 @llvm.umin.i128(i128 %conv, i128 18446744073709551616)
3189 %conv6 = trunc i128 %spec.store.select to i64
3193 define i64 @ustest_f64i64_mm(double %x) {
3194 ; SOFT-LABEL: ustest_f64i64_mm:
3195 ; SOFT: @ %bb.0: @ %entry
3196 ; SOFT-NEXT: .save {r4, r5, r7, lr}
3197 ; SOFT-NEXT: push {r4, r5, r7, lr}
3198 ; SOFT-NEXT: bl __fixdfti
3199 ; SOFT-NEXT: mov r4, r1
3200 ; SOFT-NEXT: movs r1, #0
3201 ; SOFT-NEXT: subs r2, r2, #1
3202 ; SOFT-NEXT: mov r2, r3
3203 ; SOFT-NEXT: sbcs r2, r1
3204 ; SOFT-NEXT: blt .LBB47_2
3205 ; SOFT-NEXT: @ %bb.1: @ %entry
3206 ; SOFT-NEXT: mov r5, r1
3207 ; SOFT-NEXT: cmp r5, #0
3208 ; SOFT-NEXT: beq .LBB47_3
3209 ; SOFT-NEXT: b .LBB47_4
3210 ; SOFT-NEXT: .LBB47_2:
3211 ; SOFT-NEXT: movs r5, #1
3212 ; SOFT-NEXT: cmp r5, #0
3213 ; SOFT-NEXT: bne .LBB47_4
3214 ; SOFT-NEXT: .LBB47_3: @ %entry
3215 ; SOFT-NEXT: mov r3, r5
3216 ; SOFT-NEXT: .LBB47_4: @ %entry
3217 ; SOFT-NEXT: cmp r5, #0
3218 ; SOFT-NEXT: bne .LBB47_6
3219 ; SOFT-NEXT: @ %bb.5: @ %entry
3220 ; SOFT-NEXT: mov r0, r5
3221 ; SOFT-NEXT: .LBB47_6: @ %entry
3222 ; SOFT-NEXT: cmp r3, #0
3223 ; SOFT-NEXT: mov r2, r1
3224 ; SOFT-NEXT: bpl .LBB47_10
3225 ; SOFT-NEXT: @ %bb.7: @ %entry
3226 ; SOFT-NEXT: cmp r5, #0
3227 ; SOFT-NEXT: beq .LBB47_11
3228 ; SOFT-NEXT: .LBB47_8: @ %entry
3229 ; SOFT-NEXT: cmp r3, #0
3230 ; SOFT-NEXT: bpl .LBB47_12
3231 ; SOFT-NEXT: .LBB47_9: @ %entry
3232 ; SOFT-NEXT: mov r0, r2
3233 ; SOFT-NEXT: pop {r4, r5, r7, pc}
3234 ; SOFT-NEXT: .LBB47_10: @ %entry
3235 ; SOFT-NEXT: mov r2, r0
3236 ; SOFT-NEXT: cmp r5, #0
3237 ; SOFT-NEXT: bne .LBB47_8
3238 ; SOFT-NEXT: .LBB47_11: @ %entry
3239 ; SOFT-NEXT: mov r4, r5
3240 ; SOFT-NEXT: cmp r3, #0
3241 ; SOFT-NEXT: bmi .LBB47_9
3242 ; SOFT-NEXT: .LBB47_12: @ %entry
3243 ; SOFT-NEXT: mov r1, r4
3244 ; SOFT-NEXT: mov r0, r2
3245 ; SOFT-NEXT: pop {r4, r5, r7, pc}
3247 ; VFP2-LABEL: ustest_f64i64_mm:
3248 ; VFP2: @ %bb.0: @ %entry
3249 ; VFP2-NEXT: .save {r7, lr}
3250 ; VFP2-NEXT: push {r7, lr}
3251 ; VFP2-NEXT: bl __fixdfti
3252 ; VFP2-NEXT: subs r2, #1
3253 ; VFP2-NEXT: mov.w r12, #0
3254 ; VFP2-NEXT: sbcs r2, r3, #0
3256 ; VFP2-NEXT: movlt.w r12, #1
3257 ; VFP2-NEXT: cmp.w r12, #0
3259 ; VFP2-NEXT: moveq r0, r12
3260 ; VFP2-NEXT: moveq r3, r12
3261 ; VFP2-NEXT: cmp r3, #0
3263 ; VFP2-NEXT: movmi r0, #0
3264 ; VFP2-NEXT: cmp.w r12, #0
3266 ; VFP2-NEXT: moveq r1, r12
3267 ; VFP2-NEXT: cmp r3, #0
3269 ; VFP2-NEXT: movmi r1, #0
3270 ; VFP2-NEXT: pop {r7, pc}
3272 ; FULL-LABEL: ustest_f64i64_mm:
3273 ; FULL: @ %bb.0: @ %entry
3274 ; FULL-NEXT: .save {r7, lr}
3275 ; FULL-NEXT: push {r7, lr}
3276 ; FULL-NEXT: bl __fixdfti
3277 ; FULL-NEXT: subs r2, #1
3278 ; FULL-NEXT: sbcs r2, r3, #0
3279 ; FULL-NEXT: cset r2, lt
3280 ; FULL-NEXT: cmp r2, #0
3281 ; FULL-NEXT: csel r3, r3, r2, ne
3282 ; FULL-NEXT: csel r0, r0, r2, ne
3283 ; FULL-NEXT: cmp r3, #0
3285 ; FULL-NEXT: movmi r0, #0
3286 ; FULL-NEXT: cmp r2, #0
3287 ; FULL-NEXT: csel r1, r1, r2, ne
3288 ; FULL-NEXT: cmp r3, #0
3290 ; FULL-NEXT: movmi r1, #0
3291 ; FULL-NEXT: pop {r7, pc}
3293 %conv = fptosi double %x to i128
3294 %spec.store.select = call i128 @llvm.smin.i128(i128 %conv, i128 18446744073709551616)
3295 %spec.store.select7 = call i128 @llvm.smax.i128(i128 %spec.store.select, i128 0)
3296 %conv6 = trunc i128 %spec.store.select7 to i64
3300 define i64 @stest_f32i64_mm(float %x) {
3301 ; SOFT-LABEL: stest_f32i64_mm:
3302 ; SOFT: @ %bb.0: @ %entry
3303 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
3304 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
3305 ; SOFT-NEXT: .pad #4
3306 ; SOFT-NEXT: sub sp, #4
3307 ; SOFT-NEXT: bl __fixsfti
3308 ; SOFT-NEXT: movs r4, #1
3309 ; SOFT-NEXT: movs r5, #0
3310 ; SOFT-NEXT: ldr r6, .LCPI48_0
3311 ; SOFT-NEXT: str r0, [sp] @ 4-byte Spill
3312 ; SOFT-NEXT: adds r0, r0, #1
3313 ; SOFT-NEXT: mov r0, r1
3314 ; SOFT-NEXT: sbcs r0, r6
3315 ; SOFT-NEXT: mov r0, r2
3316 ; SOFT-NEXT: sbcs r0, r5
3317 ; SOFT-NEXT: mov r0, r3
3318 ; SOFT-NEXT: sbcs r0, r5
3319 ; SOFT-NEXT: mov r7, r4
3320 ; SOFT-NEXT: bge .LBB48_12
3321 ; SOFT-NEXT: @ %bb.1: @ %entry
3322 ; SOFT-NEXT: cmp r7, #0
3323 ; SOFT-NEXT: beq .LBB48_13
3324 ; SOFT-NEXT: .LBB48_2: @ %entry
3325 ; SOFT-NEXT: cmp r7, #0
3326 ; SOFT-NEXT: beq .LBB48_14
3327 ; SOFT-NEXT: .LBB48_3: @ %entry
3328 ; SOFT-NEXT: cmp r7, #0
3329 ; SOFT-NEXT: bne .LBB48_5
3330 ; SOFT-NEXT: .LBB48_4: @ %entry
3331 ; SOFT-NEXT: mov r1, r6
3332 ; SOFT-NEXT: .LBB48_5: @ %entry
3333 ; SOFT-NEXT: mvns r0, r5
3334 ; SOFT-NEXT: cmp r7, #0
3335 ; SOFT-NEXT: bne .LBB48_7
3336 ; SOFT-NEXT: @ %bb.6: @ %entry
3337 ; SOFT-NEXT: str r0, [sp] @ 4-byte Spill
3338 ; SOFT-NEXT: .LBB48_7: @ %entry
3339 ; SOFT-NEXT: lsls r6, r4, #31
3340 ; SOFT-NEXT: ldr r7, [sp] @ 4-byte Reload
3341 ; SOFT-NEXT: rsbs r7, r7, #0
3342 ; SOFT-NEXT: mov r7, r6
3343 ; SOFT-NEXT: sbcs r7, r1
3344 ; SOFT-NEXT: mov r7, r0
3345 ; SOFT-NEXT: sbcs r7, r2
3346 ; SOFT-NEXT: sbcs r0, r3
3347 ; SOFT-NEXT: bge .LBB48_15
3348 ; SOFT-NEXT: @ %bb.8: @ %entry
3349 ; SOFT-NEXT: cmp r4, #0
3350 ; SOFT-NEXT: beq .LBB48_16
3351 ; SOFT-NEXT: .LBB48_9: @ %entry
3352 ; SOFT-NEXT: cmp r4, #0
3353 ; SOFT-NEXT: bne .LBB48_11
3354 ; SOFT-NEXT: .LBB48_10: @ %entry
3355 ; SOFT-NEXT: str r4, [sp] @ 4-byte Spill
3356 ; SOFT-NEXT: .LBB48_11: @ %entry
3357 ; SOFT-NEXT: ldr r0, [sp] @ 4-byte Reload
3358 ; SOFT-NEXT: add sp, #4
3359 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
3360 ; SOFT-NEXT: .LBB48_12: @ %entry
3361 ; SOFT-NEXT: mov r7, r5
3362 ; SOFT-NEXT: cmp r7, #0
3363 ; SOFT-NEXT: bne .LBB48_2
3364 ; SOFT-NEXT: .LBB48_13: @ %entry
3365 ; SOFT-NEXT: mov r3, r7
3366 ; SOFT-NEXT: cmp r7, #0
3367 ; SOFT-NEXT: bne .LBB48_3
3368 ; SOFT-NEXT: .LBB48_14: @ %entry
3369 ; SOFT-NEXT: mov r2, r7
3370 ; SOFT-NEXT: cmp r7, #0
3371 ; SOFT-NEXT: beq .LBB48_4
3372 ; SOFT-NEXT: b .LBB48_5
3373 ; SOFT-NEXT: .LBB48_15: @ %entry
3374 ; SOFT-NEXT: mov r4, r5
3375 ; SOFT-NEXT: cmp r4, #0
3376 ; SOFT-NEXT: bne .LBB48_9
3377 ; SOFT-NEXT: .LBB48_16: @ %entry
3378 ; SOFT-NEXT: mov r1, r6
3379 ; SOFT-NEXT: cmp r4, #0
3380 ; SOFT-NEXT: beq .LBB48_10
3381 ; SOFT-NEXT: b .LBB48_11
3382 ; SOFT-NEXT: .p2align 2
3383 ; SOFT-NEXT: @ %bb.17:
3384 ; SOFT-NEXT: .LCPI48_0:
3385 ; SOFT-NEXT: .long 2147483647 @ 0x7fffffff
3387 ; VFP2-LABEL: stest_f32i64_mm:
3388 ; VFP2: @ %bb.0: @ %entry
3389 ; VFP2-NEXT: .save {r4, r5, r7, lr}
3390 ; VFP2-NEXT: push {r4, r5, r7, lr}
3391 ; VFP2-NEXT: bl __fixsfti
3392 ; VFP2-NEXT: subs.w r4, r0, #-1
3393 ; VFP2-NEXT: mvn lr, #-2147483648
3394 ; VFP2-NEXT: sbcs.w r4, r1, lr
3395 ; VFP2-NEXT: mov.w r12, #0
3396 ; VFP2-NEXT: sbcs r4, r2, #0
3397 ; VFP2-NEXT: sbcs r4, r3, #0
3398 ; VFP2-NEXT: mov.w r4, #0
3400 ; VFP2-NEXT: movlt r4, #1
3401 ; VFP2-NEXT: cmp r4, #0
3402 ; VFP2-NEXT: itet eq
3403 ; VFP2-NEXT: moveq r3, r4
3404 ; VFP2-NEXT: movne r4, r2
3405 ; VFP2-NEXT: moveq r1, lr
3406 ; VFP2-NEXT: mov.w r2, #-1
3408 ; VFP2-NEXT: moveq r0, r2
3409 ; VFP2-NEXT: rsbs r5, r0, #0
3410 ; VFP2-NEXT: mov.w lr, #-2147483648
3411 ; VFP2-NEXT: sbcs.w r5, lr, r1
3412 ; VFP2-NEXT: sbcs.w r4, r2, r4
3413 ; VFP2-NEXT: sbcs r2, r3
3415 ; VFP2-NEXT: movlt.w r12, #1
3416 ; VFP2-NEXT: cmp.w r12, #0
3418 ; VFP2-NEXT: moveq r1, lr
3419 ; VFP2-NEXT: moveq r0, r12
3420 ; VFP2-NEXT: pop {r4, r5, r7, pc}
3422 ; FULL-LABEL: stest_f32i64_mm:
3423 ; FULL: @ %bb.0: @ %entry
3424 ; FULL-NEXT: .save {r4, r5, r7, lr}
3425 ; FULL-NEXT: push {r4, r5, r7, lr}
3426 ; FULL-NEXT: bl __fixsfti
3427 ; FULL-NEXT: subs.w lr, r0, #-1
3428 ; FULL-NEXT: mvn r12, #-2147483648
3429 ; FULL-NEXT: sbcs.w lr, r1, r12
3430 ; FULL-NEXT: sbcs lr, r2, #0
3431 ; FULL-NEXT: sbcs lr, r3, #0
3432 ; FULL-NEXT: cset lr, lt
3433 ; FULL-NEXT: cmp.w lr, #0
3434 ; FULL-NEXT: csel r5, r3, lr, ne
3435 ; FULL-NEXT: mov.w r3, #-1
3436 ; FULL-NEXT: csel r0, r0, r3, ne
3437 ; FULL-NEXT: csel r1, r1, r12, ne
3438 ; FULL-NEXT: csel r2, r2, lr, ne
3439 ; FULL-NEXT: rsbs r4, r0, #0
3440 ; FULL-NEXT: mov.w r12, #-2147483648
3441 ; FULL-NEXT: sbcs.w r4, r12, r1
3442 ; FULL-NEXT: sbcs.w r2, r3, r2
3443 ; FULL-NEXT: sbcs.w r2, r3, r5
3444 ; FULL-NEXT: cset r2, lt
3445 ; FULL-NEXT: cmp r2, #0
3446 ; FULL-NEXT: csel r1, r1, r12, ne
3447 ; FULL-NEXT: csel r0, r0, r2, ne
3448 ; FULL-NEXT: pop {r4, r5, r7, pc}
3450 %conv = fptosi float %x to i128
3451 %spec.store.select = call i128 @llvm.smin.i128(i128 %conv, i128 9223372036854775807)
3452 %spec.store.select7 = call i128 @llvm.smax.i128(i128 %spec.store.select, i128 -9223372036854775808)
3453 %conv6 = trunc i128 %spec.store.select7 to i64
3457 define i64 @utest_f32i64_mm(float %x) {
3458 ; SOFT-LABEL: utest_f32i64_mm:
3459 ; SOFT: @ %bb.0: @ %entry
3460 ; SOFT-NEXT: .save {r4, lr}
3461 ; SOFT-NEXT: push {r4, lr}
3462 ; SOFT-NEXT: bl __fixunssfti
3463 ; SOFT-NEXT: movs r4, #0
3464 ; SOFT-NEXT: subs r2, r2, #1
3465 ; SOFT-NEXT: sbcs r3, r4
3466 ; SOFT-NEXT: blo .LBB49_4
3467 ; SOFT-NEXT: @ %bb.1: @ %entry
3468 ; SOFT-NEXT: cmp r4, #0
3469 ; SOFT-NEXT: beq .LBB49_5
3470 ; SOFT-NEXT: .LBB49_2: @ %entry
3471 ; SOFT-NEXT: cmp r4, #0
3472 ; SOFT-NEXT: beq .LBB49_6
3473 ; SOFT-NEXT: .LBB49_3: @ %entry
3474 ; SOFT-NEXT: pop {r4, pc}
3475 ; SOFT-NEXT: .LBB49_4:
3476 ; SOFT-NEXT: movs r4, #1
3477 ; SOFT-NEXT: cmp r4, #0
3478 ; SOFT-NEXT: bne .LBB49_2
3479 ; SOFT-NEXT: .LBB49_5: @ %entry
3480 ; SOFT-NEXT: mov r0, r4
3481 ; SOFT-NEXT: cmp r4, #0
3482 ; SOFT-NEXT: bne .LBB49_3
3483 ; SOFT-NEXT: .LBB49_6: @ %entry
3484 ; SOFT-NEXT: mov r1, r4
3485 ; SOFT-NEXT: pop {r4, pc}
3487 ; VFP2-LABEL: utest_f32i64_mm:
3488 ; VFP2: @ %bb.0: @ %entry
3489 ; VFP2-NEXT: .save {r7, lr}
3490 ; VFP2-NEXT: push {r7, lr}
3491 ; VFP2-NEXT: bl __fixunssfti
3492 ; VFP2-NEXT: subs r2, #1
3493 ; VFP2-NEXT: mov.w r12, #0
3494 ; VFP2-NEXT: sbcs r2, r3, #0
3496 ; VFP2-NEXT: movlo.w r12, #1
3497 ; VFP2-NEXT: cmp.w r12, #0
3499 ; VFP2-NEXT: moveq r0, r12
3500 ; VFP2-NEXT: moveq r1, r12
3501 ; VFP2-NEXT: pop {r7, pc}
3503 ; FULL-LABEL: utest_f32i64_mm:
3504 ; FULL: @ %bb.0: @ %entry
3505 ; FULL-NEXT: .save {r7, lr}
3506 ; FULL-NEXT: push {r7, lr}
3507 ; FULL-NEXT: bl __fixunssfti
3508 ; FULL-NEXT: subs r2, #1
3509 ; FULL-NEXT: sbcs r2, r3, #0
3510 ; FULL-NEXT: cset r2, lo
3511 ; FULL-NEXT: cmp r2, #0
3512 ; FULL-NEXT: csel r0, r0, r2, ne
3513 ; FULL-NEXT: csel r1, r1, r2, ne
3514 ; FULL-NEXT: pop {r7, pc}
3516 %conv = fptoui float %x to i128
3517 %spec.store.select = call i128 @llvm.umin.i128(i128 %conv, i128 18446744073709551616)
3518 %conv6 = trunc i128 %spec.store.select to i64
3522 define i64 @ustest_f32i64_mm(float %x) {
3523 ; SOFT-LABEL: ustest_f32i64_mm:
3524 ; SOFT: @ %bb.0: @ %entry
3525 ; SOFT-NEXT: .save {r4, r5, r7, lr}
3526 ; SOFT-NEXT: push {r4, r5, r7, lr}
3527 ; SOFT-NEXT: bl __fixsfti
3528 ; SOFT-NEXT: mov r4, r1
3529 ; SOFT-NEXT: movs r1, #0
3530 ; SOFT-NEXT: subs r2, r2, #1
3531 ; SOFT-NEXT: mov r2, r3
3532 ; SOFT-NEXT: sbcs r2, r1
3533 ; SOFT-NEXT: blt .LBB50_2
3534 ; SOFT-NEXT: @ %bb.1: @ %entry
3535 ; SOFT-NEXT: mov r5, r1
3536 ; SOFT-NEXT: cmp r5, #0
3537 ; SOFT-NEXT: beq .LBB50_3
3538 ; SOFT-NEXT: b .LBB50_4
3539 ; SOFT-NEXT: .LBB50_2:
3540 ; SOFT-NEXT: movs r5, #1
3541 ; SOFT-NEXT: cmp r5, #0
3542 ; SOFT-NEXT: bne .LBB50_4
3543 ; SOFT-NEXT: .LBB50_3: @ %entry
3544 ; SOFT-NEXT: mov r3, r5
3545 ; SOFT-NEXT: .LBB50_4: @ %entry
3546 ; SOFT-NEXT: cmp r5, #0
3547 ; SOFT-NEXT: bne .LBB50_6
3548 ; SOFT-NEXT: @ %bb.5: @ %entry
3549 ; SOFT-NEXT: mov r0, r5
3550 ; SOFT-NEXT: .LBB50_6: @ %entry
3551 ; SOFT-NEXT: cmp r3, #0
3552 ; SOFT-NEXT: mov r2, r1
3553 ; SOFT-NEXT: bpl .LBB50_10
3554 ; SOFT-NEXT: @ %bb.7: @ %entry
3555 ; SOFT-NEXT: cmp r5, #0
3556 ; SOFT-NEXT: beq .LBB50_11
3557 ; SOFT-NEXT: .LBB50_8: @ %entry
3558 ; SOFT-NEXT: cmp r3, #0
3559 ; SOFT-NEXT: bpl .LBB50_12
3560 ; SOFT-NEXT: .LBB50_9: @ %entry
3561 ; SOFT-NEXT: mov r0, r2
3562 ; SOFT-NEXT: pop {r4, r5, r7, pc}
3563 ; SOFT-NEXT: .LBB50_10: @ %entry
3564 ; SOFT-NEXT: mov r2, r0
3565 ; SOFT-NEXT: cmp r5, #0
3566 ; SOFT-NEXT: bne .LBB50_8
3567 ; SOFT-NEXT: .LBB50_11: @ %entry
3568 ; SOFT-NEXT: mov r4, r5
3569 ; SOFT-NEXT: cmp r3, #0
3570 ; SOFT-NEXT: bmi .LBB50_9
3571 ; SOFT-NEXT: .LBB50_12: @ %entry
3572 ; SOFT-NEXT: mov r1, r4
3573 ; SOFT-NEXT: mov r0, r2
3574 ; SOFT-NEXT: pop {r4, r5, r7, pc}
3576 ; VFP2-LABEL: ustest_f32i64_mm:
3577 ; VFP2: @ %bb.0: @ %entry
3578 ; VFP2-NEXT: .save {r7, lr}
3579 ; VFP2-NEXT: push {r7, lr}
3580 ; VFP2-NEXT: bl __fixsfti
3581 ; VFP2-NEXT: subs r2, #1
3582 ; VFP2-NEXT: mov.w r12, #0
3583 ; VFP2-NEXT: sbcs r2, r3, #0
3585 ; VFP2-NEXT: movlt.w r12, #1
3586 ; VFP2-NEXT: cmp.w r12, #0
3588 ; VFP2-NEXT: moveq r0, r12
3589 ; VFP2-NEXT: moveq r3, r12
3590 ; VFP2-NEXT: cmp r3, #0
3592 ; VFP2-NEXT: movmi r0, #0
3593 ; VFP2-NEXT: cmp.w r12, #0
3595 ; VFP2-NEXT: moveq r1, r12
3596 ; VFP2-NEXT: cmp r3, #0
3598 ; VFP2-NEXT: movmi r1, #0
3599 ; VFP2-NEXT: pop {r7, pc}
3601 ; FULL-LABEL: ustest_f32i64_mm:
3602 ; FULL: @ %bb.0: @ %entry
3603 ; FULL-NEXT: .save {r7, lr}
3604 ; FULL-NEXT: push {r7, lr}
3605 ; FULL-NEXT: bl __fixsfti
3606 ; FULL-NEXT: subs r2, #1
3607 ; FULL-NEXT: sbcs r2, r3, #0
3608 ; FULL-NEXT: cset r2, lt
3609 ; FULL-NEXT: cmp r2, #0
3610 ; FULL-NEXT: csel r3, r3, r2, ne
3611 ; FULL-NEXT: csel r0, r0, r2, ne
3612 ; FULL-NEXT: cmp r3, #0
3614 ; FULL-NEXT: movmi r0, #0
3615 ; FULL-NEXT: cmp r2, #0
3616 ; FULL-NEXT: csel r1, r1, r2, ne
3617 ; FULL-NEXT: cmp r3, #0
3619 ; FULL-NEXT: movmi r1, #0
3620 ; FULL-NEXT: pop {r7, pc}
3622 %conv = fptosi float %x to i128
3623 %spec.store.select = call i128 @llvm.smin.i128(i128 %conv, i128 18446744073709551616)
3624 %spec.store.select7 = call i128 @llvm.smax.i128(i128 %spec.store.select, i128 0)
3625 %conv6 = trunc i128 %spec.store.select7 to i64
3629 define i64 @stest_f16i64_mm(half %x) {
3630 ; SOFT-LABEL: stest_f16i64_mm:
3631 ; SOFT: @ %bb.0: @ %entry
3632 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
3633 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
3634 ; SOFT-NEXT: .pad #4
3635 ; SOFT-NEXT: sub sp, #4
3636 ; SOFT-NEXT: uxth r0, r0
3637 ; SOFT-NEXT: bl __aeabi_h2f
3638 ; SOFT-NEXT: bl __fixsfti
3639 ; SOFT-NEXT: movs r4, #1
3640 ; SOFT-NEXT: movs r5, #0
3641 ; SOFT-NEXT: ldr r6, .LCPI51_0
3642 ; SOFT-NEXT: str r0, [sp] @ 4-byte Spill
3643 ; SOFT-NEXT: adds r0, r0, #1
3644 ; SOFT-NEXT: mov r0, r1
3645 ; SOFT-NEXT: sbcs r0, r6
3646 ; SOFT-NEXT: mov r0, r2
3647 ; SOFT-NEXT: sbcs r0, r5
3648 ; SOFT-NEXT: mov r0, r3
3649 ; SOFT-NEXT: sbcs r0, r5
3650 ; SOFT-NEXT: mov r7, r4
3651 ; SOFT-NEXT: bge .LBB51_12
3652 ; SOFT-NEXT: @ %bb.1: @ %entry
3653 ; SOFT-NEXT: cmp r7, #0
3654 ; SOFT-NEXT: beq .LBB51_13
3655 ; SOFT-NEXT: .LBB51_2: @ %entry
3656 ; SOFT-NEXT: cmp r7, #0
3657 ; SOFT-NEXT: beq .LBB51_14
3658 ; SOFT-NEXT: .LBB51_3: @ %entry
3659 ; SOFT-NEXT: cmp r7, #0
3660 ; SOFT-NEXT: bne .LBB51_5
3661 ; SOFT-NEXT: .LBB51_4: @ %entry
3662 ; SOFT-NEXT: mov r1, r6
3663 ; SOFT-NEXT: .LBB51_5: @ %entry
3664 ; SOFT-NEXT: mvns r0, r5
3665 ; SOFT-NEXT: cmp r7, #0
3666 ; SOFT-NEXT: bne .LBB51_7
3667 ; SOFT-NEXT: @ %bb.6: @ %entry
3668 ; SOFT-NEXT: str r0, [sp] @ 4-byte Spill
3669 ; SOFT-NEXT: .LBB51_7: @ %entry
3670 ; SOFT-NEXT: lsls r6, r4, #31
3671 ; SOFT-NEXT: ldr r7, [sp] @ 4-byte Reload
3672 ; SOFT-NEXT: rsbs r7, r7, #0
3673 ; SOFT-NEXT: mov r7, r6
3674 ; SOFT-NEXT: sbcs r7, r1
3675 ; SOFT-NEXT: mov r7, r0
3676 ; SOFT-NEXT: sbcs r7, r2
3677 ; SOFT-NEXT: sbcs r0, r3
3678 ; SOFT-NEXT: bge .LBB51_15
3679 ; SOFT-NEXT: @ %bb.8: @ %entry
3680 ; SOFT-NEXT: cmp r4, #0
3681 ; SOFT-NEXT: beq .LBB51_16
3682 ; SOFT-NEXT: .LBB51_9: @ %entry
3683 ; SOFT-NEXT: cmp r4, #0
3684 ; SOFT-NEXT: bne .LBB51_11
3685 ; SOFT-NEXT: .LBB51_10: @ %entry
3686 ; SOFT-NEXT: str r4, [sp] @ 4-byte Spill
3687 ; SOFT-NEXT: .LBB51_11: @ %entry
3688 ; SOFT-NEXT: ldr r0, [sp] @ 4-byte Reload
3689 ; SOFT-NEXT: add sp, #4
3690 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
3691 ; SOFT-NEXT: .LBB51_12: @ %entry
3692 ; SOFT-NEXT: mov r7, r5
3693 ; SOFT-NEXT: cmp r7, #0
3694 ; SOFT-NEXT: bne .LBB51_2
3695 ; SOFT-NEXT: .LBB51_13: @ %entry
3696 ; SOFT-NEXT: mov r3, r7
3697 ; SOFT-NEXT: cmp r7, #0
3698 ; SOFT-NEXT: bne .LBB51_3
3699 ; SOFT-NEXT: .LBB51_14: @ %entry
3700 ; SOFT-NEXT: mov r2, r7
3701 ; SOFT-NEXT: cmp r7, #0
3702 ; SOFT-NEXT: beq .LBB51_4
3703 ; SOFT-NEXT: b .LBB51_5
3704 ; SOFT-NEXT: .LBB51_15: @ %entry
3705 ; SOFT-NEXT: mov r4, r5
3706 ; SOFT-NEXT: cmp r4, #0
3707 ; SOFT-NEXT: bne .LBB51_9
3708 ; SOFT-NEXT: .LBB51_16: @ %entry
3709 ; SOFT-NEXT: mov r1, r6
3710 ; SOFT-NEXT: cmp r4, #0
3711 ; SOFT-NEXT: beq .LBB51_10
3712 ; SOFT-NEXT: b .LBB51_11
3713 ; SOFT-NEXT: .p2align 2
3714 ; SOFT-NEXT: @ %bb.17:
3715 ; SOFT-NEXT: .LCPI51_0:
3716 ; SOFT-NEXT: .long 2147483647 @ 0x7fffffff
3718 ; VFP2-LABEL: stest_f16i64_mm:
3719 ; VFP2: @ %bb.0: @ %entry
3720 ; VFP2-NEXT: .save {r4, r5, r7, lr}
3721 ; VFP2-NEXT: push {r4, r5, r7, lr}
3722 ; VFP2-NEXT: vmov r0, s0
3723 ; VFP2-NEXT: bl __aeabi_h2f
3724 ; VFP2-NEXT: vmov s0, r0
3725 ; VFP2-NEXT: bl __fixsfti
3726 ; VFP2-NEXT: subs.w r4, r0, #-1
3727 ; VFP2-NEXT: mvn lr, #-2147483648
3728 ; VFP2-NEXT: sbcs.w r4, r1, lr
3729 ; VFP2-NEXT: mov.w r12, #0
3730 ; VFP2-NEXT: sbcs r4, r2, #0
3731 ; VFP2-NEXT: sbcs r4, r3, #0
3732 ; VFP2-NEXT: mov.w r4, #0
3734 ; VFP2-NEXT: movlt r4, #1
3735 ; VFP2-NEXT: cmp r4, #0
3736 ; VFP2-NEXT: itet eq
3737 ; VFP2-NEXT: moveq r3, r4
3738 ; VFP2-NEXT: movne r4, r2
3739 ; VFP2-NEXT: moveq r1, lr
3740 ; VFP2-NEXT: mov.w r2, #-1
3742 ; VFP2-NEXT: moveq r0, r2
3743 ; VFP2-NEXT: rsbs r5, r0, #0
3744 ; VFP2-NEXT: mov.w lr, #-2147483648
3745 ; VFP2-NEXT: sbcs.w r5, lr, r1
3746 ; VFP2-NEXT: sbcs.w r4, r2, r4
3747 ; VFP2-NEXT: sbcs r2, r3
3749 ; VFP2-NEXT: movlt.w r12, #1
3750 ; VFP2-NEXT: cmp.w r12, #0
3752 ; VFP2-NEXT: moveq r1, lr
3753 ; VFP2-NEXT: moveq r0, r12
3754 ; VFP2-NEXT: pop {r4, r5, r7, pc}
3756 ; FULL-LABEL: stest_f16i64_mm:
3757 ; FULL: @ %bb.0: @ %entry
3758 ; FULL-NEXT: .save {r4, r5, r7, lr}
3759 ; FULL-NEXT: push {r4, r5, r7, lr}
3760 ; FULL-NEXT: vmov.f16 r0, s0
3761 ; FULL-NEXT: vmov s0, r0
3762 ; FULL-NEXT: bl __fixhfti
3763 ; FULL-NEXT: subs.w lr, r0, #-1
3764 ; FULL-NEXT: mvn r12, #-2147483648
3765 ; FULL-NEXT: sbcs.w lr, r1, r12
3766 ; FULL-NEXT: sbcs lr, r2, #0
3767 ; FULL-NEXT: sbcs lr, r3, #0
3768 ; FULL-NEXT: cset lr, lt
3769 ; FULL-NEXT: cmp.w lr, #0
3770 ; FULL-NEXT: csel r5, r3, lr, ne
3771 ; FULL-NEXT: mov.w r3, #-1
3772 ; FULL-NEXT: csel r0, r0, r3, ne
3773 ; FULL-NEXT: csel r1, r1, r12, ne
3774 ; FULL-NEXT: csel r2, r2, lr, ne
3775 ; FULL-NEXT: rsbs r4, r0, #0
3776 ; FULL-NEXT: mov.w r12, #-2147483648
3777 ; FULL-NEXT: sbcs.w r4, r12, r1
3778 ; FULL-NEXT: sbcs.w r2, r3, r2
3779 ; FULL-NEXT: sbcs.w r2, r3, r5
3780 ; FULL-NEXT: cset r2, lt
3781 ; FULL-NEXT: cmp r2, #0
3782 ; FULL-NEXT: csel r1, r1, r12, ne
3783 ; FULL-NEXT: csel r0, r0, r2, ne
3784 ; FULL-NEXT: pop {r4, r5, r7, pc}
3786 %conv = fptosi half %x to i128
3787 %spec.store.select = call i128 @llvm.smin.i128(i128 %conv, i128 9223372036854775807)
3788 %spec.store.select7 = call i128 @llvm.smax.i128(i128 %spec.store.select, i128 -9223372036854775808)
3789 %conv6 = trunc i128 %spec.store.select7 to i64
3793 define i64 @utesth_f16i64_mm(half %x) {
3794 ; SOFT-LABEL: utesth_f16i64_mm:
3795 ; SOFT: @ %bb.0: @ %entry
3796 ; SOFT-NEXT: .save {r4, lr}
3797 ; SOFT-NEXT: push {r4, lr}
3798 ; SOFT-NEXT: uxth r0, r0
3799 ; SOFT-NEXT: bl __aeabi_h2f
3800 ; SOFT-NEXT: bl __fixunssfti
3801 ; SOFT-NEXT: movs r4, #0
3802 ; SOFT-NEXT: subs r2, r2, #1
3803 ; SOFT-NEXT: sbcs r3, r4
3804 ; SOFT-NEXT: blo .LBB52_4
3805 ; SOFT-NEXT: @ %bb.1: @ %entry
3806 ; SOFT-NEXT: cmp r4, #0
3807 ; SOFT-NEXT: beq .LBB52_5
3808 ; SOFT-NEXT: .LBB52_2: @ %entry
3809 ; SOFT-NEXT: cmp r4, #0
3810 ; SOFT-NEXT: beq .LBB52_6
3811 ; SOFT-NEXT: .LBB52_3: @ %entry
3812 ; SOFT-NEXT: pop {r4, pc}
3813 ; SOFT-NEXT: .LBB52_4:
3814 ; SOFT-NEXT: movs r4, #1
3815 ; SOFT-NEXT: cmp r4, #0
3816 ; SOFT-NEXT: bne .LBB52_2
3817 ; SOFT-NEXT: .LBB52_5: @ %entry
3818 ; SOFT-NEXT: mov r0, r4
3819 ; SOFT-NEXT: cmp r4, #0
3820 ; SOFT-NEXT: bne .LBB52_3
3821 ; SOFT-NEXT: .LBB52_6: @ %entry
3822 ; SOFT-NEXT: mov r1, r4
3823 ; SOFT-NEXT: pop {r4, pc}
3825 ; VFP2-LABEL: utesth_f16i64_mm:
3826 ; VFP2: @ %bb.0: @ %entry
3827 ; VFP2-NEXT: .save {r7, lr}
3828 ; VFP2-NEXT: push {r7, lr}
3829 ; VFP2-NEXT: vmov r0, s0
3830 ; VFP2-NEXT: bl __aeabi_h2f
3831 ; VFP2-NEXT: vmov s0, r0
3832 ; VFP2-NEXT: bl __fixunssfti
3833 ; VFP2-NEXT: subs r2, #1
3834 ; VFP2-NEXT: mov.w r12, #0
3835 ; VFP2-NEXT: sbcs r2, r3, #0
3837 ; VFP2-NEXT: movlo.w r12, #1
3838 ; VFP2-NEXT: cmp.w r12, #0
3840 ; VFP2-NEXT: moveq r0, r12
3841 ; VFP2-NEXT: moveq r1, r12
3842 ; VFP2-NEXT: pop {r7, pc}
3844 ; FULL-LABEL: utesth_f16i64_mm:
3845 ; FULL: @ %bb.0: @ %entry
3846 ; FULL-NEXT: .save {r7, lr}
3847 ; FULL-NEXT: push {r7, lr}
3848 ; FULL-NEXT: vmov.f16 r0, s0
3849 ; FULL-NEXT: vmov s0, r0
3850 ; FULL-NEXT: bl __fixunshfti
3851 ; FULL-NEXT: subs r2, #1
3852 ; FULL-NEXT: sbcs r2, r3, #0
3853 ; FULL-NEXT: cset r2, lo
3854 ; FULL-NEXT: cmp r2, #0
3855 ; FULL-NEXT: csel r0, r0, r2, ne
3856 ; FULL-NEXT: csel r1, r1, r2, ne
3857 ; FULL-NEXT: pop {r7, pc}
3859 %conv = fptoui half %x to i128
3860 %spec.store.select = call i128 @llvm.umin.i128(i128 %conv, i128 18446744073709551616)
3861 %conv6 = trunc i128 %spec.store.select to i64
3865 define i64 @ustest_f16i64_mm(half %x) {
3866 ; SOFT-LABEL: ustest_f16i64_mm:
3867 ; SOFT: @ %bb.0: @ %entry
3868 ; SOFT-NEXT: .save {r4, r5, r7, lr}
3869 ; SOFT-NEXT: push {r4, r5, r7, lr}
3870 ; SOFT-NEXT: uxth r0, r0
3871 ; SOFT-NEXT: bl __aeabi_h2f
3872 ; SOFT-NEXT: bl __fixsfti
3873 ; SOFT-NEXT: mov r4, r1
3874 ; SOFT-NEXT: movs r1, #0
3875 ; SOFT-NEXT: subs r2, r2, #1
3876 ; SOFT-NEXT: mov r2, r3
3877 ; SOFT-NEXT: sbcs r2, r1
3878 ; SOFT-NEXT: blt .LBB53_2
3879 ; SOFT-NEXT: @ %bb.1: @ %entry
3880 ; SOFT-NEXT: mov r5, r1
3881 ; SOFT-NEXT: cmp r5, #0
3882 ; SOFT-NEXT: beq .LBB53_3
3883 ; SOFT-NEXT: b .LBB53_4
3884 ; SOFT-NEXT: .LBB53_2:
3885 ; SOFT-NEXT: movs r5, #1
3886 ; SOFT-NEXT: cmp r5, #0
3887 ; SOFT-NEXT: bne .LBB53_4
3888 ; SOFT-NEXT: .LBB53_3: @ %entry
3889 ; SOFT-NEXT: mov r3, r5
3890 ; SOFT-NEXT: .LBB53_4: @ %entry
3891 ; SOFT-NEXT: cmp r5, #0
3892 ; SOFT-NEXT: bne .LBB53_6
3893 ; SOFT-NEXT: @ %bb.5: @ %entry
3894 ; SOFT-NEXT: mov r0, r5
3895 ; SOFT-NEXT: .LBB53_6: @ %entry
3896 ; SOFT-NEXT: cmp r3, #0
3897 ; SOFT-NEXT: mov r2, r1
3898 ; SOFT-NEXT: bpl .LBB53_10
3899 ; SOFT-NEXT: @ %bb.7: @ %entry
3900 ; SOFT-NEXT: cmp r5, #0
3901 ; SOFT-NEXT: beq .LBB53_11
3902 ; SOFT-NEXT: .LBB53_8: @ %entry
3903 ; SOFT-NEXT: cmp r3, #0
3904 ; SOFT-NEXT: bpl .LBB53_12
3905 ; SOFT-NEXT: .LBB53_9: @ %entry
3906 ; SOFT-NEXT: mov r0, r2
3907 ; SOFT-NEXT: pop {r4, r5, r7, pc}
3908 ; SOFT-NEXT: .LBB53_10: @ %entry
3909 ; SOFT-NEXT: mov r2, r0
3910 ; SOFT-NEXT: cmp r5, #0
3911 ; SOFT-NEXT: bne .LBB53_8
3912 ; SOFT-NEXT: .LBB53_11: @ %entry
3913 ; SOFT-NEXT: mov r4, r5
3914 ; SOFT-NEXT: cmp r3, #0
3915 ; SOFT-NEXT: bmi .LBB53_9
3916 ; SOFT-NEXT: .LBB53_12: @ %entry
3917 ; SOFT-NEXT: mov r1, r4
3918 ; SOFT-NEXT: mov r0, r2
3919 ; SOFT-NEXT: pop {r4, r5, r7, pc}
3921 ; VFP2-LABEL: ustest_f16i64_mm:
3922 ; VFP2: @ %bb.0: @ %entry
3923 ; VFP2-NEXT: .save {r7, lr}
3924 ; VFP2-NEXT: push {r7, lr}
3925 ; VFP2-NEXT: vmov r0, s0
3926 ; VFP2-NEXT: bl __aeabi_h2f
3927 ; VFP2-NEXT: vmov s0, r0
3928 ; VFP2-NEXT: bl __fixsfti
3929 ; VFP2-NEXT: subs r2, #1
3930 ; VFP2-NEXT: mov.w r12, #0
3931 ; VFP2-NEXT: sbcs r2, r3, #0
3933 ; VFP2-NEXT: movlt.w r12, #1
3934 ; VFP2-NEXT: cmp.w r12, #0
3936 ; VFP2-NEXT: moveq r0, r12
3937 ; VFP2-NEXT: moveq r3, r12
3938 ; VFP2-NEXT: cmp r3, #0
3940 ; VFP2-NEXT: movmi r0, #0
3941 ; VFP2-NEXT: cmp.w r12, #0
3943 ; VFP2-NEXT: moveq r1, r12
3944 ; VFP2-NEXT: cmp r3, #0
3946 ; VFP2-NEXT: movmi r1, #0
3947 ; VFP2-NEXT: pop {r7, pc}
3949 ; FULL-LABEL: ustest_f16i64_mm:
3950 ; FULL: @ %bb.0: @ %entry
3951 ; FULL-NEXT: .save {r7, lr}
3952 ; FULL-NEXT: push {r7, lr}
3953 ; FULL-NEXT: vmov.f16 r0, s0
3954 ; FULL-NEXT: vmov s0, r0
3955 ; FULL-NEXT: bl __fixhfti
3956 ; FULL-NEXT: subs r2, #1
3957 ; FULL-NEXT: sbcs r2, r3, #0
3958 ; FULL-NEXT: cset r2, lt
3959 ; FULL-NEXT: cmp r2, #0
3960 ; FULL-NEXT: csel r3, r3, r2, ne
3961 ; FULL-NEXT: csel r0, r0, r2, ne
3962 ; FULL-NEXT: cmp r3, #0
3964 ; FULL-NEXT: movmi r0, #0
3965 ; FULL-NEXT: cmp r2, #0
3966 ; FULL-NEXT: csel r1, r1, r2, ne
3967 ; FULL-NEXT: cmp r3, #0
3969 ; FULL-NEXT: movmi r1, #0
3970 ; FULL-NEXT: pop {r7, pc}
3972 %conv = fptosi half %x to i128
3973 %spec.store.select = call i128 @llvm.smin.i128(i128 %conv, i128 18446744073709551616)
3974 %spec.store.select7 = call i128 @llvm.smax.i128(i128 %spec.store.select, i128 0)
3975 %conv6 = trunc i128 %spec.store.select7 to i64
3980 define void @unroll_maxmin(ptr nocapture %0, ptr nocapture readonly %1, i32 %2) {
3981 ; SOFT-LABEL: unroll_maxmin:
3983 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
3984 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
3985 ; SOFT-NEXT: .pad #20
3986 ; SOFT-NEXT: sub sp, #20
3987 ; SOFT-NEXT: mov r4, r1
3988 ; SOFT-NEXT: mov r5, r0
3989 ; SOFT-NEXT: movs r0, #0
3990 ; SOFT-NEXT: str r0, [sp, #16] @ 4-byte Spill
3991 ; SOFT-NEXT: mvns r0, r0
3992 ; SOFT-NEXT: str r0, [sp, #8] @ 4-byte Spill
3993 ; SOFT-NEXT: movs r0, #1
3994 ; SOFT-NEXT: lsls r1, r0, #31
3995 ; SOFT-NEXT: str r1, [sp, #12] @ 4-byte Spill
3996 ; SOFT-NEXT: str r0, [sp, #4] @ 4-byte Spill
3997 ; SOFT-NEXT: lsls r7, r0, #10
3998 ; SOFT-NEXT: b .LBB54_2
3999 ; SOFT-NEXT: .LBB54_1: @ in Loop: Header=BB54_2 Depth=1
4000 ; SOFT-NEXT: str r0, [r5, #4]
4001 ; SOFT-NEXT: adds r4, #8
4002 ; SOFT-NEXT: adds r5, #8
4003 ; SOFT-NEXT: subs r7, r7, #2
4004 ; SOFT-NEXT: beq .LBB54_18
4005 ; SOFT-NEXT: .LBB54_2: @ =>This Inner Loop Header: Depth=1
4006 ; SOFT-NEXT: ldr r0, [r4]
4007 ; SOFT-NEXT: movs r1, #79
4008 ; SOFT-NEXT: lsls r6, r1, #24
4009 ; SOFT-NEXT: mov r1, r6
4010 ; SOFT-NEXT: bl __aeabi_fmul
4011 ; SOFT-NEXT: bl __aeabi_f2lz
4012 ; SOFT-NEXT: ldr r2, .LCPI54_0
4013 ; SOFT-NEXT: subs r2, r0, r2
4014 ; SOFT-NEXT: mov r2, r1
4015 ; SOFT-NEXT: ldr r3, [sp, #16] @ 4-byte Reload
4016 ; SOFT-NEXT: sbcs r2, r3
4017 ; SOFT-NEXT: ldr r2, [sp, #4] @ 4-byte Reload
4018 ; SOFT-NEXT: bge .LBB54_14
4019 ; SOFT-NEXT: @ %bb.3: @ in Loop: Header=BB54_2 Depth=1
4020 ; SOFT-NEXT: cmp r2, #0
4021 ; SOFT-NEXT: beq .LBB54_15
4022 ; SOFT-NEXT: .LBB54_4: @ in Loop: Header=BB54_2 Depth=1
4023 ; SOFT-NEXT: cmp r2, #0
4024 ; SOFT-NEXT: bne .LBB54_6
4025 ; SOFT-NEXT: .LBB54_5: @ in Loop: Header=BB54_2 Depth=1
4026 ; SOFT-NEXT: ldr r0, .LCPI54_0
4027 ; SOFT-NEXT: .LBB54_6: @ in Loop: Header=BB54_2 Depth=1
4028 ; SOFT-NEXT: ldr r2, [sp, #12] @ 4-byte Reload
4029 ; SOFT-NEXT: subs r2, r2, r0
4030 ; SOFT-NEXT: ldr r2, [sp, #8] @ 4-byte Reload
4031 ; SOFT-NEXT: sbcs r2, r1
4032 ; SOFT-NEXT: blt .LBB54_8
4033 ; SOFT-NEXT: @ %bb.7: @ in Loop: Header=BB54_2 Depth=1
4034 ; SOFT-NEXT: ldr r0, [sp, #12] @ 4-byte Reload
4035 ; SOFT-NEXT: .LBB54_8: @ in Loop: Header=BB54_2 Depth=1
4036 ; SOFT-NEXT: str r0, [r5]
4037 ; SOFT-NEXT: ldr r0, [r4, #4]
4038 ; SOFT-NEXT: mov r1, r6
4039 ; SOFT-NEXT: bl __aeabi_fmul
4040 ; SOFT-NEXT: bl __aeabi_f2lz
4041 ; SOFT-NEXT: ldr r2, .LCPI54_0
4042 ; SOFT-NEXT: subs r2, r0, r2
4043 ; SOFT-NEXT: mov r2, r1
4044 ; SOFT-NEXT: ldr r3, [sp, #16] @ 4-byte Reload
4045 ; SOFT-NEXT: sbcs r2, r3
4046 ; SOFT-NEXT: ldr r2, [sp, #4] @ 4-byte Reload
4047 ; SOFT-NEXT: bge .LBB54_16
4048 ; SOFT-NEXT: @ %bb.9: @ in Loop: Header=BB54_2 Depth=1
4049 ; SOFT-NEXT: cmp r2, #0
4050 ; SOFT-NEXT: beq .LBB54_17
4051 ; SOFT-NEXT: .LBB54_10: @ in Loop: Header=BB54_2 Depth=1
4052 ; SOFT-NEXT: cmp r2, #0
4053 ; SOFT-NEXT: bne .LBB54_12
4054 ; SOFT-NEXT: .LBB54_11: @ in Loop: Header=BB54_2 Depth=1
4055 ; SOFT-NEXT: ldr r0, .LCPI54_0
4056 ; SOFT-NEXT: .LBB54_12: @ in Loop: Header=BB54_2 Depth=1
4057 ; SOFT-NEXT: ldr r2, [sp, #12] @ 4-byte Reload
4058 ; SOFT-NEXT: subs r2, r2, r0
4059 ; SOFT-NEXT: ldr r2, [sp, #8] @ 4-byte Reload
4060 ; SOFT-NEXT: sbcs r2, r1
4061 ; SOFT-NEXT: blt .LBB54_1
4062 ; SOFT-NEXT: @ %bb.13: @ in Loop: Header=BB54_2 Depth=1
4063 ; SOFT-NEXT: ldr r0, [sp, #12] @ 4-byte Reload
4064 ; SOFT-NEXT: b .LBB54_1
4065 ; SOFT-NEXT: .LBB54_14: @ in Loop: Header=BB54_2 Depth=1
4066 ; SOFT-NEXT: ldr r2, [sp, #16] @ 4-byte Reload
4067 ; SOFT-NEXT: cmp r2, #0
4068 ; SOFT-NEXT: bne .LBB54_4
4069 ; SOFT-NEXT: .LBB54_15: @ in Loop: Header=BB54_2 Depth=1
4070 ; SOFT-NEXT: mov r1, r2
4071 ; SOFT-NEXT: cmp r2, #0
4072 ; SOFT-NEXT: beq .LBB54_5
4073 ; SOFT-NEXT: b .LBB54_6
4074 ; SOFT-NEXT: .LBB54_16: @ in Loop: Header=BB54_2 Depth=1
4075 ; SOFT-NEXT: ldr r2, [sp, #16] @ 4-byte Reload
4076 ; SOFT-NEXT: cmp r2, #0
4077 ; SOFT-NEXT: bne .LBB54_10
4078 ; SOFT-NEXT: .LBB54_17: @ in Loop: Header=BB54_2 Depth=1
4079 ; SOFT-NEXT: mov r1, r2
4080 ; SOFT-NEXT: cmp r2, #0
4081 ; SOFT-NEXT: beq .LBB54_11
4082 ; SOFT-NEXT: b .LBB54_12
4083 ; SOFT-NEXT: .LBB54_18:
4084 ; SOFT-NEXT: add sp, #20
4085 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
4086 ; SOFT-NEXT: .p2align 2
4087 ; SOFT-NEXT: @ %bb.19:
4088 ; SOFT-NEXT: .LCPI54_0:
4089 ; SOFT-NEXT: .long 2147483647 @ 0x7fffffff
4091 ; VFP2-LABEL: unroll_maxmin:
4093 ; VFP2-NEXT: subs r1, #8
4094 ; VFP2-NEXT: subs r0, #8
4095 ; VFP2-NEXT: vldr s0, .LCPI54_0
4096 ; VFP2-NEXT: mov.w r2, #1024
4097 ; VFP2-NEXT: .LBB54_1: @ =>This Inner Loop Header: Depth=1
4098 ; VFP2-NEXT: vldr s2, [r1, #8]
4099 ; VFP2-NEXT: subs r2, #2
4100 ; VFP2-NEXT: vmul.f32 s2, s2, s0
4101 ; VFP2-NEXT: vcvt.s32.f32 s2, s2
4102 ; VFP2-NEXT: vmov r3, s2
4103 ; VFP2-NEXT: str r3, [r0, #8]!
4104 ; VFP2-NEXT: vldr s2, [r1, #12]
4105 ; VFP2-NEXT: add.w r1, r1, #8
4106 ; VFP2-NEXT: vmul.f32 s2, s2, s0
4107 ; VFP2-NEXT: vcvt.s32.f32 s2, s2
4108 ; VFP2-NEXT: vstr s2, [r0, #4]
4109 ; VFP2-NEXT: bne .LBB54_1
4110 ; VFP2-NEXT: @ %bb.2:
4112 ; VFP2-NEXT: .p2align 2
4113 ; VFP2-NEXT: @ %bb.3:
4114 ; VFP2-NEXT: .LCPI54_0:
4115 ; VFP2-NEXT: .long 0x4f000000 @ float 2.14748365E+9
4117 ; FULL-LABEL: unroll_maxmin:
4119 ; FULL-NEXT: .save {r7, lr}
4120 ; FULL-NEXT: push {r7, lr}
4121 ; FULL-NEXT: mov.w lr, #512
4122 ; FULL-NEXT: subs r1, #8
4123 ; FULL-NEXT: subs r0, #8
4124 ; FULL-NEXT: vldr s0, .LCPI54_0
4125 ; FULL-NEXT: .LBB54_1: @ =>This Inner Loop Header: Depth=1
4126 ; FULL-NEXT: vldr s2, [r1, #8]
4127 ; FULL-NEXT: vmul.f32 s2, s2, s0
4128 ; FULL-NEXT: vcvt.s32.f32 s2, s2
4129 ; FULL-NEXT: vmov r2, s2
4130 ; FULL-NEXT: str r2, [r0, #8]!
4131 ; FULL-NEXT: vldr s2, [r1, #12]
4132 ; FULL-NEXT: adds r1, #8
4133 ; FULL-NEXT: vmul.f32 s2, s2, s0
4134 ; FULL-NEXT: vcvt.s32.f32 s2, s2
4135 ; FULL-NEXT: vstr s2, [r0, #4]
4136 ; FULL-NEXT: le lr, .LBB54_1
4137 ; FULL-NEXT: @ %bb.2:
4138 ; FULL-NEXT: pop {r7, pc}
4139 ; FULL-NEXT: .p2align 2
4140 ; FULL-NEXT: @ %bb.3:
4141 ; FULL-NEXT: .LCPI54_0:
4142 ; FULL-NEXT: .long 0x4f000000 @ float 2.14748365E+9
4149 %6 = phi i32 [ 0, %3 ], [ %28, %5 ]
4150 %7 = getelementptr inbounds float, ptr %1, i32 %6
4151 %8 = load float, ptr %7, align 4
4152 %9 = fmul float %8, 0x41E0000000000000
4153 %10 = fptosi float %9 to i64
4154 %11 = icmp slt i64 %10, 2147483647
4155 %12 = select i1 %11, i64 %10, i64 2147483647
4156 %13 = icmp sgt i64 %12, -2147483648
4157 %14 = select i1 %13, i64 %12, i64 -2147483648
4158 %15 = trunc i64 %14 to i32
4159 %16 = getelementptr inbounds i32, ptr %0, i32 %6
4160 store i32 %15, ptr %16, align 4
4161 %17 = or disjoint i32 %6, 1
4162 %18 = getelementptr inbounds float, ptr %1, i32 %17
4163 %19 = load float, ptr %18, align 4
4164 %20 = fmul float %19, 0x41E0000000000000
4165 %21 = fptosi float %20 to i64
4166 %22 = icmp slt i64 %21, 2147483647
4167 %23 = select i1 %22, i64 %21, i64 2147483647
4168 %24 = icmp sgt i64 %23, -2147483648
4169 %25 = select i1 %24, i64 %23, i64 -2147483648
4170 %26 = trunc i64 %25 to i32
4171 %27 = getelementptr inbounds i32, ptr %0, i32 %17
4172 store i32 %26, ptr %27, align 4
4173 %28 = add nuw nsw i32 %6, 2
4174 %29 = icmp eq i32 %28, 1024
4175 br i1 %29, label %4, label %5
4178 define void @unroll_minmax(ptr nocapture %0, ptr nocapture readonly %1, i32 %2) {
4179 ; SOFT-LABEL: unroll_minmax:
4181 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
4182 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
4183 ; SOFT-NEXT: .pad #20
4184 ; SOFT-NEXT: sub sp, #20
4185 ; SOFT-NEXT: mov r4, r1
4186 ; SOFT-NEXT: mov r5, r0
4187 ; SOFT-NEXT: movs r0, #0
4188 ; SOFT-NEXT: str r0, [sp, #16] @ 4-byte Spill
4189 ; SOFT-NEXT: mvns r0, r0
4190 ; SOFT-NEXT: str r0, [sp, #12] @ 4-byte Spill
4191 ; SOFT-NEXT: movs r0, #1
4192 ; SOFT-NEXT: lsls r1, r0, #31
4193 ; SOFT-NEXT: str r1, [sp, #8] @ 4-byte Spill
4194 ; SOFT-NEXT: str r0, [sp, #4] @ 4-byte Spill
4195 ; SOFT-NEXT: lsls r7, r0, #10
4196 ; SOFT-NEXT: b .LBB55_2
4197 ; SOFT-NEXT: .LBB55_1: @ in Loop: Header=BB55_2 Depth=1
4198 ; SOFT-NEXT: str r0, [r5, #4]
4199 ; SOFT-NEXT: adds r4, #8
4200 ; SOFT-NEXT: adds r5, #8
4201 ; SOFT-NEXT: subs r7, r7, #2
4202 ; SOFT-NEXT: beq .LBB55_18
4203 ; SOFT-NEXT: .LBB55_2: @ =>This Inner Loop Header: Depth=1
4204 ; SOFT-NEXT: ldr r0, [r4]
4205 ; SOFT-NEXT: movs r1, #79
4206 ; SOFT-NEXT: lsls r6, r1, #24
4207 ; SOFT-NEXT: mov r1, r6
4208 ; SOFT-NEXT: bl __aeabi_fmul
4209 ; SOFT-NEXT: bl __aeabi_f2lz
4210 ; SOFT-NEXT: ldr r2, [sp, #8] @ 4-byte Reload
4211 ; SOFT-NEXT: subs r2, r2, r0
4212 ; SOFT-NEXT: ldr r2, [sp, #12] @ 4-byte Reload
4213 ; SOFT-NEXT: sbcs r2, r1
4214 ; SOFT-NEXT: ldr r2, [sp, #4] @ 4-byte Reload
4215 ; SOFT-NEXT: bge .LBB55_14
4216 ; SOFT-NEXT: @ %bb.3: @ in Loop: Header=BB55_2 Depth=1
4217 ; SOFT-NEXT: cmp r2, #0
4218 ; SOFT-NEXT: beq .LBB55_15
4219 ; SOFT-NEXT: .LBB55_4: @ in Loop: Header=BB55_2 Depth=1
4220 ; SOFT-NEXT: cmp r2, #0
4221 ; SOFT-NEXT: bne .LBB55_6
4222 ; SOFT-NEXT: .LBB55_5: @ in Loop: Header=BB55_2 Depth=1
4223 ; SOFT-NEXT: ldr r0, [sp, #8] @ 4-byte Reload
4224 ; SOFT-NEXT: .LBB55_6: @ in Loop: Header=BB55_2 Depth=1
4225 ; SOFT-NEXT: ldr r2, .LCPI55_0
4226 ; SOFT-NEXT: subs r2, r0, r2
4227 ; SOFT-NEXT: ldr r2, [sp, #16] @ 4-byte Reload
4228 ; SOFT-NEXT: sbcs r1, r2
4229 ; SOFT-NEXT: blt .LBB55_8
4230 ; SOFT-NEXT: @ %bb.7: @ in Loop: Header=BB55_2 Depth=1
4231 ; SOFT-NEXT: ldr r0, .LCPI55_0
4232 ; SOFT-NEXT: .LBB55_8: @ in Loop: Header=BB55_2 Depth=1
4233 ; SOFT-NEXT: str r0, [r5]
4234 ; SOFT-NEXT: ldr r0, [r4, #4]
4235 ; SOFT-NEXT: mov r1, r6
4236 ; SOFT-NEXT: bl __aeabi_fmul
4237 ; SOFT-NEXT: bl __aeabi_f2lz
4238 ; SOFT-NEXT: ldr r2, [sp, #8] @ 4-byte Reload
4239 ; SOFT-NEXT: subs r2, r2, r0
4240 ; SOFT-NEXT: ldr r2, [sp, #12] @ 4-byte Reload
4241 ; SOFT-NEXT: sbcs r2, r1
4242 ; SOFT-NEXT: ldr r2, [sp, #4] @ 4-byte Reload
4243 ; SOFT-NEXT: bge .LBB55_16
4244 ; SOFT-NEXT: @ %bb.9: @ in Loop: Header=BB55_2 Depth=1
4245 ; SOFT-NEXT: cmp r2, #0
4246 ; SOFT-NEXT: beq .LBB55_17
4247 ; SOFT-NEXT: .LBB55_10: @ in Loop: Header=BB55_2 Depth=1
4248 ; SOFT-NEXT: cmp r2, #0
4249 ; SOFT-NEXT: bne .LBB55_12
4250 ; SOFT-NEXT: .LBB55_11: @ in Loop: Header=BB55_2 Depth=1
4251 ; SOFT-NEXT: ldr r0, [sp, #8] @ 4-byte Reload
4252 ; SOFT-NEXT: .LBB55_12: @ in Loop: Header=BB55_2 Depth=1
4253 ; SOFT-NEXT: ldr r2, .LCPI55_0
4254 ; SOFT-NEXT: subs r2, r0, r2
4255 ; SOFT-NEXT: ldr r2, [sp, #16] @ 4-byte Reload
4256 ; SOFT-NEXT: sbcs r1, r2
4257 ; SOFT-NEXT: blt .LBB55_1
4258 ; SOFT-NEXT: @ %bb.13: @ in Loop: Header=BB55_2 Depth=1
4259 ; SOFT-NEXT: ldr r0, .LCPI55_0
4260 ; SOFT-NEXT: b .LBB55_1
4261 ; SOFT-NEXT: .LBB55_14: @ in Loop: Header=BB55_2 Depth=1
4262 ; SOFT-NEXT: ldr r2, [sp, #16] @ 4-byte Reload
4263 ; SOFT-NEXT: cmp r2, #0
4264 ; SOFT-NEXT: bne .LBB55_4
4265 ; SOFT-NEXT: .LBB55_15: @ in Loop: Header=BB55_2 Depth=1
4266 ; SOFT-NEXT: ldr r1, [sp, #12] @ 4-byte Reload
4267 ; SOFT-NEXT: cmp r2, #0
4268 ; SOFT-NEXT: beq .LBB55_5
4269 ; SOFT-NEXT: b .LBB55_6
4270 ; SOFT-NEXT: .LBB55_16: @ in Loop: Header=BB55_2 Depth=1
4271 ; SOFT-NEXT: ldr r2, [sp, #16] @ 4-byte Reload
4272 ; SOFT-NEXT: cmp r2, #0
4273 ; SOFT-NEXT: bne .LBB55_10
4274 ; SOFT-NEXT: .LBB55_17: @ in Loop: Header=BB55_2 Depth=1
4275 ; SOFT-NEXT: ldr r1, [sp, #12] @ 4-byte Reload
4276 ; SOFT-NEXT: cmp r2, #0
4277 ; SOFT-NEXT: beq .LBB55_11
4278 ; SOFT-NEXT: b .LBB55_12
4279 ; SOFT-NEXT: .LBB55_18:
4280 ; SOFT-NEXT: add sp, #20
4281 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
4282 ; SOFT-NEXT: .p2align 2
4283 ; SOFT-NEXT: @ %bb.19:
4284 ; SOFT-NEXT: .LCPI55_0:
4285 ; SOFT-NEXT: .long 2147483647 @ 0x7fffffff
4287 ; VFP2-LABEL: unroll_minmax:
4289 ; VFP2-NEXT: subs r1, #8
4290 ; VFP2-NEXT: subs r0, #8
4291 ; VFP2-NEXT: vldr s0, .LCPI55_0
4292 ; VFP2-NEXT: mov.w r2, #1024
4293 ; VFP2-NEXT: .LBB55_1: @ =>This Inner Loop Header: Depth=1
4294 ; VFP2-NEXT: vldr s2, [r1, #8]
4295 ; VFP2-NEXT: subs r2, #2
4296 ; VFP2-NEXT: vmul.f32 s2, s2, s0
4297 ; VFP2-NEXT: vcvt.s32.f32 s2, s2
4298 ; VFP2-NEXT: vmov r3, s2
4299 ; VFP2-NEXT: str r3, [r0, #8]!
4300 ; VFP2-NEXT: vldr s2, [r1, #12]
4301 ; VFP2-NEXT: add.w r1, r1, #8
4302 ; VFP2-NEXT: vmul.f32 s2, s2, s0
4303 ; VFP2-NEXT: vcvt.s32.f32 s2, s2
4304 ; VFP2-NEXT: vstr s2, [r0, #4]
4305 ; VFP2-NEXT: bne .LBB55_1
4306 ; VFP2-NEXT: @ %bb.2:
4308 ; VFP2-NEXT: .p2align 2
4309 ; VFP2-NEXT: @ %bb.3:
4310 ; VFP2-NEXT: .LCPI55_0:
4311 ; VFP2-NEXT: .long 0x4f000000 @ float 2.14748365E+9
4313 ; FULL-LABEL: unroll_minmax:
4315 ; FULL-NEXT: .save {r7, lr}
4316 ; FULL-NEXT: push {r7, lr}
4317 ; FULL-NEXT: mov.w lr, #512
4318 ; FULL-NEXT: subs r1, #8
4319 ; FULL-NEXT: subs r0, #8
4320 ; FULL-NEXT: vldr s0, .LCPI55_0
4321 ; FULL-NEXT: .LBB55_1: @ =>This Inner Loop Header: Depth=1
4322 ; FULL-NEXT: vldr s2, [r1, #8]
4323 ; FULL-NEXT: vmul.f32 s2, s2, s0
4324 ; FULL-NEXT: vcvt.s32.f32 s2, s2
4325 ; FULL-NEXT: vmov r2, s2
4326 ; FULL-NEXT: str r2, [r0, #8]!
4327 ; FULL-NEXT: vldr s2, [r1, #12]
4328 ; FULL-NEXT: adds r1, #8
4329 ; FULL-NEXT: vmul.f32 s2, s2, s0
4330 ; FULL-NEXT: vcvt.s32.f32 s2, s2
4331 ; FULL-NEXT: vstr s2, [r0, #4]
4332 ; FULL-NEXT: le lr, .LBB55_1
4333 ; FULL-NEXT: @ %bb.2:
4334 ; FULL-NEXT: pop {r7, pc}
4335 ; FULL-NEXT: .p2align 2
4336 ; FULL-NEXT: @ %bb.3:
4337 ; FULL-NEXT: .LCPI55_0:
4338 ; FULL-NEXT: .long 0x4f000000 @ float 2.14748365E+9
4345 %6 = phi i32 [ 0, %3 ], [ %28, %5 ]
4346 %7 = getelementptr inbounds float, ptr %1, i32 %6
4347 %8 = load float, ptr %7, align 4
4348 %9 = fmul float %8, 0x41E0000000000000
4349 %10 = fptosi float %9 to i64
4350 %11 = icmp sgt i64 %10, -2147483648
4351 %12 = select i1 %11, i64 %10, i64 -2147483648
4352 %13 = icmp slt i64 %12, 2147483647
4353 %14 = select i1 %13, i64 %12, i64 2147483647
4354 %15 = trunc i64 %14 to i32
4355 %16 = getelementptr inbounds i32, ptr %0, i32 %6
4356 store i32 %15, ptr %16, align 4
4357 %17 = or disjoint i32 %6, 1
4358 %18 = getelementptr inbounds float, ptr %1, i32 %17
4359 %19 = load float, ptr %18, align 4
4360 %20 = fmul float %19, 0x41E0000000000000
4361 %21 = fptosi float %20 to i64
4362 %22 = icmp sgt i64 %21, -2147483648
4363 %23 = select i1 %22, i64 %21, i64 -2147483648
4364 %24 = icmp slt i64 %23, 2147483647
4365 %25 = select i1 %24, i64 %23, i64 2147483647
4366 %26 = trunc i64 %25 to i32
4367 %27 = getelementptr inbounds i32, ptr %0, i32 %17
4368 store i32 %26, ptr %27, align 4
4369 %28 = add nuw nsw i32 %6, 2
4370 %29 = icmp eq i32 %28, 1024
4371 br i1 %29, label %4, label %5
4374 define i32 @stest_f32i32i64(float %x) {
4375 ; SOFT-LABEL: stest_f32i32i64:
4376 ; SOFT: @ %bb.0: @ %entry
4377 ; SOFT-NEXT: .save {r4, lr}
4378 ; SOFT-NEXT: push {r4, lr}
4379 ; SOFT-NEXT: bl __aeabi_f2lz
4380 ; SOFT-NEXT: movs r3, #0
4381 ; SOFT-NEXT: ldr r2, .LCPI56_0
4382 ; SOFT-NEXT: subs r4, r0, r2
4383 ; SOFT-NEXT: sbcs r1, r3
4384 ; SOFT-NEXT: blt .LBB56_2
4385 ; SOFT-NEXT: @ %bb.1: @ %entry
4386 ; SOFT-NEXT: mov r0, r2
4387 ; SOFT-NEXT: .LBB56_2: @ %entry
4388 ; SOFT-NEXT: ldr r1, .LCPI56_1
4389 ; SOFT-NEXT: cmp r0, r1
4390 ; SOFT-NEXT: bgt .LBB56_4
4391 ; SOFT-NEXT: @ %bb.3: @ %entry
4392 ; SOFT-NEXT: mov r0, r1
4393 ; SOFT-NEXT: .LBB56_4: @ %entry
4394 ; SOFT-NEXT: pop {r4, pc}
4395 ; SOFT-NEXT: .p2align 2
4396 ; SOFT-NEXT: @ %bb.5:
4397 ; SOFT-NEXT: .LCPI56_0:
4398 ; SOFT-NEXT: .long 32767 @ 0x7fff
4399 ; SOFT-NEXT: .LCPI56_1:
4400 ; SOFT-NEXT: .long 4294934528 @ 0xffff8000
4402 ; VFP2-LABEL: stest_f32i32i64:
4403 ; VFP2: @ %bb.0: @ %entry
4404 ; VFP2-NEXT: .save {r7, lr}
4405 ; VFP2-NEXT: push {r7, lr}
4406 ; VFP2-NEXT: vmov r0, s0
4407 ; VFP2-NEXT: bl __aeabi_f2lz
4408 ; VFP2-NEXT: movw r2, #32767
4409 ; VFP2-NEXT: subs r3, r0, r2
4410 ; VFP2-NEXT: sbcs r1, r1, #0
4412 ; VFP2-NEXT: movge r0, r2
4413 ; VFP2-NEXT: movw r1, #32768
4414 ; VFP2-NEXT: cmn.w r0, #32768
4415 ; VFP2-NEXT: movt r1, #65535
4417 ; VFP2-NEXT: movle r0, r1
4418 ; VFP2-NEXT: pop {r7, pc}
4420 ; FULL-LABEL: stest_f32i32i64:
4421 ; FULL: @ %bb.0: @ %entry
4422 ; FULL-NEXT: .save {r7, lr}
4423 ; FULL-NEXT: push {r7, lr}
4424 ; FULL-NEXT: vmov r0, s0
4425 ; FULL-NEXT: bl __aeabi_f2lz
4426 ; FULL-NEXT: movw r2, #32767
4427 ; FULL-NEXT: subs r3, r0, r2
4428 ; FULL-NEXT: sbcs r1, r1, #0
4429 ; FULL-NEXT: csel r0, r0, r2, lt
4430 ; FULL-NEXT: movw r1, #32768
4431 ; FULL-NEXT: movt r1, #65535
4432 ; FULL-NEXT: cmn.w r0, #32768
4433 ; FULL-NEXT: csel r0, r0, r1, gt
4434 ; FULL-NEXT: pop {r7, pc}
4436 %conv = fptosi float %x to i64
4437 %convt = trunc i64 %conv to i32
4438 %0 = icmp slt i64 %conv, 32767
4439 %spec.store.select = select i1 %0, i32 %convt, i32 32767
4440 %1 = icmp sgt i32 %spec.store.select, -32768
4441 %spec.store.select7 = select i1 %1, i32 %spec.store.select, i32 -32768
4442 ret i32 %spec.store.select7
4447 declare i32 @llvm.smin.i32(i32, i32)
4448 declare i32 @llvm.smax.i32(i32, i32)
4449 declare i32 @llvm.umin.i32(i32, i32)
4450 declare i64 @llvm.smin.i64(i64, i64)
4451 declare i64 @llvm.smax.i64(i64, i64)
4452 declare i64 @llvm.umin.i64(i64, i64)
4453 declare i128 @llvm.smin.i128(i128, i128)
4454 declare i128 @llvm.smax.i128(i128, i128)
4455 declare i128 @llvm.umin.i128(i128, i128)