1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=thumbv6-none-eabi -float-abi=soft %s -o - | FileCheck %s --check-prefixes=SOFT
3 ; RUN: llc -mtriple=thumbv7-none-eabi -mattr=+vfp2 %s -o - | FileCheck %s --check-prefixes=VFP,VFP2
4 ; RUN: llc -mtriple=thumbv8.1m.main-eabi -mattr=+fullfp16,+fp64 %s -o - | FileCheck %s --check-prefixes=VFP,FP16
7 ; 32-bit float to signed integer
10 declare i1 @llvm.fptoui.sat.i1.f32 (float)
11 declare i8 @llvm.fptoui.sat.i8.f32 (float)
12 declare i13 @llvm.fptoui.sat.i13.f32 (float)
13 declare i16 @llvm.fptoui.sat.i16.f32 (float)
14 declare i19 @llvm.fptoui.sat.i19.f32 (float)
15 declare i32 @llvm.fptoui.sat.i32.f32 (float)
16 declare i50 @llvm.fptoui.sat.i50.f32 (float)
17 declare i64 @llvm.fptoui.sat.i64.f32 (float)
18 declare i100 @llvm.fptoui.sat.i100.f32(float)
19 declare i128 @llvm.fptoui.sat.i128.f32(float)
21 define i1 @test_signed_i1_f32(float %f) nounwind {
22 ; SOFT-LABEL: test_signed_i1_f32:
24 ; SOFT-NEXT: .save {r4, r5, r6, lr}
25 ; SOFT-NEXT: push {r4, r5, r6, lr}
26 ; SOFT-NEXT: mov r5, r0
27 ; SOFT-NEXT: movs r0, #127
28 ; SOFT-NEXT: lsls r1, r0, #23
29 ; SOFT-NEXT: mov r0, r5
30 ; SOFT-NEXT: bl __aeabi_fcmpgt
31 ; SOFT-NEXT: mov r4, r0
32 ; SOFT-NEXT: movs r1, #0
33 ; SOFT-NEXT: mov r0, r5
34 ; SOFT-NEXT: bl __aeabi_fcmpge
35 ; SOFT-NEXT: mov r6, r0
36 ; SOFT-NEXT: mov r0, r5
37 ; SOFT-NEXT: bl __aeabi_f2uiz
38 ; SOFT-NEXT: cmp r6, #0
39 ; SOFT-NEXT: beq .LBB0_3
41 ; SOFT-NEXT: cmp r4, #0
42 ; SOFT-NEXT: bne .LBB0_4
44 ; SOFT-NEXT: pop {r4, r5, r6, pc}
46 ; SOFT-NEXT: mov r0, r6
47 ; SOFT-NEXT: cmp r4, #0
48 ; SOFT-NEXT: beq .LBB0_2
50 ; SOFT-NEXT: movs r0, #1
51 ; SOFT-NEXT: pop {r4, r5, r6, pc}
53 ; VFP2-LABEL: test_signed_i1_f32:
55 ; VFP2-NEXT: vmov s2, r0
56 ; VFP2-NEXT: vmov.f32 s0, #1.000000e+00
57 ; VFP2-NEXT: vcvt.u32.f32 s4, s2
58 ; VFP2-NEXT: vcmp.f32 s2, #0
59 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
60 ; VFP2-NEXT: vcmp.f32 s2, s0
61 ; VFP2-NEXT: vmov r0, s4
63 ; VFP2-NEXT: movlt r0, #0
64 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
66 ; VFP2-NEXT: movgt r0, #1
69 ; FP16-LABEL: test_signed_i1_f32:
71 ; FP16-NEXT: vldr s0, .LCPI0_0
72 ; FP16-NEXT: vmov s2, r0
73 ; FP16-NEXT: vmov.f32 s4, #1.000000e+00
74 ; FP16-NEXT: vmaxnm.f32 s0, s2, s0
75 ; FP16-NEXT: vminnm.f32 s0, s0, s4
76 ; FP16-NEXT: vcvt.u32.f32 s0, s0
77 ; FP16-NEXT: vmov r0, s0
79 ; FP16-NEXT: .p2align 2
81 ; FP16-NEXT: .LCPI0_0:
82 ; FP16-NEXT: .long 0x00000000 @ float 0
83 %x = call i1 @llvm.fptoui.sat.i1.f32(float %f)
87 define i8 @test_signed_i8_f32(float %f) nounwind {
88 ; SOFT-LABEL: test_signed_i8_f32:
90 ; SOFT-NEXT: .save {r4, r5, r6, lr}
91 ; SOFT-NEXT: push {r4, r5, r6, lr}
92 ; SOFT-NEXT: mov r6, r0
93 ; SOFT-NEXT: ldr r1, .LCPI1_0
94 ; SOFT-NEXT: bl __aeabi_fcmpgt
95 ; SOFT-NEXT: mov r4, r0
96 ; SOFT-NEXT: movs r1, #0
97 ; SOFT-NEXT: mov r0, r6
98 ; SOFT-NEXT: bl __aeabi_fcmpge
99 ; SOFT-NEXT: mov r5, r0
100 ; SOFT-NEXT: mov r0, r6
101 ; SOFT-NEXT: bl __aeabi_f2uiz
102 ; SOFT-NEXT: cmp r5, #0
103 ; SOFT-NEXT: beq .LBB1_3
104 ; SOFT-NEXT: @ %bb.1:
105 ; SOFT-NEXT: cmp r4, #0
106 ; SOFT-NEXT: bne .LBB1_4
107 ; SOFT-NEXT: .LBB1_2:
108 ; SOFT-NEXT: pop {r4, r5, r6, pc}
109 ; SOFT-NEXT: .LBB1_3:
110 ; SOFT-NEXT: mov r0, r5
111 ; SOFT-NEXT: cmp r4, #0
112 ; SOFT-NEXT: beq .LBB1_2
113 ; SOFT-NEXT: .LBB1_4:
114 ; SOFT-NEXT: movs r0, #255
115 ; SOFT-NEXT: pop {r4, r5, r6, pc}
116 ; SOFT-NEXT: .p2align 2
117 ; SOFT-NEXT: @ %bb.5:
118 ; SOFT-NEXT: .LCPI1_0:
119 ; SOFT-NEXT: .long 1132396544 @ 0x437f0000
121 ; VFP2-LABEL: test_signed_i8_f32:
123 ; VFP2-NEXT: vmov s0, r0
124 ; VFP2-NEXT: vldr s4, .LCPI1_0
125 ; VFP2-NEXT: vcvt.u32.f32 s2, s0
126 ; VFP2-NEXT: vcmp.f32 s0, #0
127 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
128 ; VFP2-NEXT: vcmp.f32 s0, s4
129 ; VFP2-NEXT: vmov r0, s2
131 ; VFP2-NEXT: movlt r0, #0
132 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
134 ; VFP2-NEXT: movgt r0, #255
136 ; VFP2-NEXT: .p2align 2
137 ; VFP2-NEXT: @ %bb.1:
138 ; VFP2-NEXT: .LCPI1_0:
139 ; VFP2-NEXT: .long 0x437f0000 @ float 255
141 ; FP16-LABEL: test_signed_i8_f32:
143 ; FP16-NEXT: vldr s0, .LCPI1_0
144 ; FP16-NEXT: vmov s2, r0
145 ; FP16-NEXT: vldr s4, .LCPI1_1
146 ; FP16-NEXT: vmaxnm.f32 s0, s2, s0
147 ; FP16-NEXT: vminnm.f32 s0, s0, s4
148 ; FP16-NEXT: vcvt.u32.f32 s0, s0
149 ; FP16-NEXT: vmov r0, s0
151 ; FP16-NEXT: .p2align 2
152 ; FP16-NEXT: @ %bb.1:
153 ; FP16-NEXT: .LCPI1_0:
154 ; FP16-NEXT: .long 0x00000000 @ float 0
155 ; FP16-NEXT: .LCPI1_1:
156 ; FP16-NEXT: .long 0x437f0000 @ float 255
157 %x = call i8 @llvm.fptoui.sat.i8.f32(float %f)
161 define i13 @test_signed_i13_f32(float %f) nounwind {
162 ; SOFT-LABEL: test_signed_i13_f32:
164 ; SOFT-NEXT: .save {r4, r5, r6, lr}
165 ; SOFT-NEXT: push {r4, r5, r6, lr}
166 ; SOFT-NEXT: mov r6, r0
167 ; SOFT-NEXT: ldr r1, .LCPI2_0
168 ; SOFT-NEXT: bl __aeabi_fcmpgt
169 ; SOFT-NEXT: mov r4, r0
170 ; SOFT-NEXT: movs r1, #0
171 ; SOFT-NEXT: mov r0, r6
172 ; SOFT-NEXT: bl __aeabi_fcmpge
173 ; SOFT-NEXT: mov r5, r0
174 ; SOFT-NEXT: mov r0, r6
175 ; SOFT-NEXT: bl __aeabi_f2uiz
176 ; SOFT-NEXT: cmp r5, #0
177 ; SOFT-NEXT: beq .LBB2_3
178 ; SOFT-NEXT: @ %bb.1:
179 ; SOFT-NEXT: cmp r4, #0
180 ; SOFT-NEXT: bne .LBB2_4
181 ; SOFT-NEXT: .LBB2_2:
182 ; SOFT-NEXT: pop {r4, r5, r6, pc}
183 ; SOFT-NEXT: .LBB2_3:
184 ; SOFT-NEXT: mov r0, r5
185 ; SOFT-NEXT: cmp r4, #0
186 ; SOFT-NEXT: beq .LBB2_2
187 ; SOFT-NEXT: .LBB2_4:
188 ; SOFT-NEXT: ldr r0, .LCPI2_1
189 ; SOFT-NEXT: pop {r4, r5, r6, pc}
190 ; SOFT-NEXT: .p2align 2
191 ; SOFT-NEXT: @ %bb.5:
192 ; SOFT-NEXT: .LCPI2_0:
193 ; SOFT-NEXT: .long 1174403072 @ 0x45fff800
194 ; SOFT-NEXT: .LCPI2_1:
195 ; SOFT-NEXT: .long 8191 @ 0x1fff
197 ; VFP2-LABEL: test_signed_i13_f32:
199 ; VFP2-NEXT: vmov s0, r0
200 ; VFP2-NEXT: vldr s4, .LCPI2_0
201 ; VFP2-NEXT: vcvt.u32.f32 s2, s0
202 ; VFP2-NEXT: vcmp.f32 s0, #0
203 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
204 ; VFP2-NEXT: vcmp.f32 s0, s4
205 ; VFP2-NEXT: vmov r0, s2
207 ; VFP2-NEXT: movlt r0, #0
208 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
210 ; VFP2-NEXT: movwgt r0, #8191
212 ; VFP2-NEXT: .p2align 2
213 ; VFP2-NEXT: @ %bb.1:
214 ; VFP2-NEXT: .LCPI2_0:
215 ; VFP2-NEXT: .long 0x45fff800 @ float 8191
217 ; FP16-LABEL: test_signed_i13_f32:
219 ; FP16-NEXT: vldr s0, .LCPI2_0
220 ; FP16-NEXT: vmov s2, r0
221 ; FP16-NEXT: vldr s4, .LCPI2_1
222 ; FP16-NEXT: vmaxnm.f32 s0, s2, s0
223 ; FP16-NEXT: vminnm.f32 s0, s0, s4
224 ; FP16-NEXT: vcvt.u32.f32 s0, s0
225 ; FP16-NEXT: vmov r0, s0
227 ; FP16-NEXT: .p2align 2
228 ; FP16-NEXT: @ %bb.1:
229 ; FP16-NEXT: .LCPI2_0:
230 ; FP16-NEXT: .long 0x00000000 @ float 0
231 ; FP16-NEXT: .LCPI2_1:
232 ; FP16-NEXT: .long 0x45fff800 @ float 8191
233 %x = call i13 @llvm.fptoui.sat.i13.f32(float %f)
237 define i16 @test_signed_i16_f32(float %f) nounwind {
238 ; SOFT-LABEL: test_signed_i16_f32:
240 ; SOFT-NEXT: .save {r4, r5, r6, lr}
241 ; SOFT-NEXT: push {r4, r5, r6, lr}
242 ; SOFT-NEXT: mov r6, r0
243 ; SOFT-NEXT: ldr r1, .LCPI3_0
244 ; SOFT-NEXT: bl __aeabi_fcmpgt
245 ; SOFT-NEXT: mov r4, r0
246 ; SOFT-NEXT: movs r1, #0
247 ; SOFT-NEXT: mov r0, r6
248 ; SOFT-NEXT: bl __aeabi_fcmpge
249 ; SOFT-NEXT: mov r5, r0
250 ; SOFT-NEXT: mov r0, r6
251 ; SOFT-NEXT: bl __aeabi_f2uiz
252 ; SOFT-NEXT: cmp r5, #0
253 ; SOFT-NEXT: beq .LBB3_3
254 ; SOFT-NEXT: @ %bb.1:
255 ; SOFT-NEXT: cmp r4, #0
256 ; SOFT-NEXT: bne .LBB3_4
257 ; SOFT-NEXT: .LBB3_2:
258 ; SOFT-NEXT: pop {r4, r5, r6, pc}
259 ; SOFT-NEXT: .LBB3_3:
260 ; SOFT-NEXT: mov r0, r5
261 ; SOFT-NEXT: cmp r4, #0
262 ; SOFT-NEXT: beq .LBB3_2
263 ; SOFT-NEXT: .LBB3_4:
264 ; SOFT-NEXT: ldr r0, .LCPI3_1
265 ; SOFT-NEXT: pop {r4, r5, r6, pc}
266 ; SOFT-NEXT: .p2align 2
267 ; SOFT-NEXT: @ %bb.5:
268 ; SOFT-NEXT: .LCPI3_0:
269 ; SOFT-NEXT: .long 1199570688 @ 0x477fff00
270 ; SOFT-NEXT: .LCPI3_1:
271 ; SOFT-NEXT: .long 65535 @ 0xffff
273 ; VFP2-LABEL: test_signed_i16_f32:
275 ; VFP2-NEXT: vmov s0, r0
276 ; VFP2-NEXT: vldr s4, .LCPI3_0
277 ; VFP2-NEXT: vcvt.u32.f32 s2, s0
278 ; VFP2-NEXT: vcmp.f32 s0, #0
279 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
280 ; VFP2-NEXT: vcmp.f32 s0, s4
281 ; VFP2-NEXT: vmov r0, s2
283 ; VFP2-NEXT: movlt r0, #0
284 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
286 ; VFP2-NEXT: movwgt r0, #65535
288 ; VFP2-NEXT: .p2align 2
289 ; VFP2-NEXT: @ %bb.1:
290 ; VFP2-NEXT: .LCPI3_0:
291 ; VFP2-NEXT: .long 0x477fff00 @ float 65535
293 ; FP16-LABEL: test_signed_i16_f32:
295 ; FP16-NEXT: vldr s0, .LCPI3_0
296 ; FP16-NEXT: vmov s2, r0
297 ; FP16-NEXT: vldr s4, .LCPI3_1
298 ; FP16-NEXT: vmaxnm.f32 s0, s2, s0
299 ; FP16-NEXT: vminnm.f32 s0, s0, s4
300 ; FP16-NEXT: vcvt.u32.f32 s0, s0
301 ; FP16-NEXT: vmov r0, s0
303 ; FP16-NEXT: .p2align 2
304 ; FP16-NEXT: @ %bb.1:
305 ; FP16-NEXT: .LCPI3_0:
306 ; FP16-NEXT: .long 0x00000000 @ float 0
307 ; FP16-NEXT: .LCPI3_1:
308 ; FP16-NEXT: .long 0x477fff00 @ float 65535
309 %x = call i16 @llvm.fptoui.sat.i16.f32(float %f)
313 define i19 @test_signed_i19_f32(float %f) nounwind {
314 ; SOFT-LABEL: test_signed_i19_f32:
316 ; SOFT-NEXT: .save {r4, r5, r6, lr}
317 ; SOFT-NEXT: push {r4, r5, r6, lr}
318 ; SOFT-NEXT: mov r6, r0
319 ; SOFT-NEXT: ldr r1, .LCPI4_0
320 ; SOFT-NEXT: bl __aeabi_fcmpgt
321 ; SOFT-NEXT: mov r4, r0
322 ; SOFT-NEXT: movs r1, #0
323 ; SOFT-NEXT: mov r0, r6
324 ; SOFT-NEXT: bl __aeabi_fcmpge
325 ; SOFT-NEXT: mov r5, r0
326 ; SOFT-NEXT: mov r0, r6
327 ; SOFT-NEXT: bl __aeabi_f2uiz
328 ; SOFT-NEXT: cmp r5, #0
329 ; SOFT-NEXT: beq .LBB4_3
330 ; SOFT-NEXT: @ %bb.1:
331 ; SOFT-NEXT: cmp r4, #0
332 ; SOFT-NEXT: bne .LBB4_4
333 ; SOFT-NEXT: .LBB4_2:
334 ; SOFT-NEXT: pop {r4, r5, r6, pc}
335 ; SOFT-NEXT: .LBB4_3:
336 ; SOFT-NEXT: mov r0, r5
337 ; SOFT-NEXT: cmp r4, #0
338 ; SOFT-NEXT: beq .LBB4_2
339 ; SOFT-NEXT: .LBB4_4:
340 ; SOFT-NEXT: ldr r0, .LCPI4_1
341 ; SOFT-NEXT: pop {r4, r5, r6, pc}
342 ; SOFT-NEXT: .p2align 2
343 ; SOFT-NEXT: @ %bb.5:
344 ; SOFT-NEXT: .LCPI4_0:
345 ; SOFT-NEXT: .long 1224736736 @ 0x48ffffe0
346 ; SOFT-NEXT: .LCPI4_1:
347 ; SOFT-NEXT: .long 524287 @ 0x7ffff
349 ; VFP2-LABEL: test_signed_i19_f32:
351 ; VFP2-NEXT: vmov s0, r0
352 ; VFP2-NEXT: vldr s4, .LCPI4_0
353 ; VFP2-NEXT: vcvt.u32.f32 s2, s0
354 ; VFP2-NEXT: vcmp.f32 s0, #0
355 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
356 ; VFP2-NEXT: vcmp.f32 s0, s4
357 ; VFP2-NEXT: vmov r0, s2
359 ; VFP2-NEXT: movlt r0, #0
360 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
362 ; VFP2-NEXT: movwgt r0, #65535
363 ; VFP2-NEXT: movtgt r0, #7
365 ; VFP2-NEXT: .p2align 2
366 ; VFP2-NEXT: @ %bb.1:
367 ; VFP2-NEXT: .LCPI4_0:
368 ; VFP2-NEXT: .long 0x48ffffe0 @ float 524287
370 ; FP16-LABEL: test_signed_i19_f32:
372 ; FP16-NEXT: vldr s0, .LCPI4_0
373 ; FP16-NEXT: vmov s2, r0
374 ; FP16-NEXT: vldr s4, .LCPI4_1
375 ; FP16-NEXT: vmaxnm.f32 s0, s2, s0
376 ; FP16-NEXT: vminnm.f32 s0, s0, s4
377 ; FP16-NEXT: vcvt.u32.f32 s0, s0
378 ; FP16-NEXT: vmov r0, s0
380 ; FP16-NEXT: .p2align 2
381 ; FP16-NEXT: @ %bb.1:
382 ; FP16-NEXT: .LCPI4_0:
383 ; FP16-NEXT: .long 0x00000000 @ float 0
384 ; FP16-NEXT: .LCPI4_1:
385 ; FP16-NEXT: .long 0x48ffffe0 @ float 524287
386 %x = call i19 @llvm.fptoui.sat.i19.f32(float %f)
390 define i32 @test_signed_i32_f32(float %f) nounwind {
391 ; SOFT-LABEL: test_signed_i32_f32:
393 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
394 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
396 ; SOFT-NEXT: sub sp, #4
397 ; SOFT-NEXT: mov r7, r0
398 ; SOFT-NEXT: ldr r1, .LCPI5_0
399 ; SOFT-NEXT: bl __aeabi_fcmpgt
400 ; SOFT-NEXT: mov r5, r0
401 ; SOFT-NEXT: movs r4, #0
402 ; SOFT-NEXT: mov r0, r7
403 ; SOFT-NEXT: mov r1, r4
404 ; SOFT-NEXT: bl __aeabi_fcmpge
405 ; SOFT-NEXT: mov r6, r0
406 ; SOFT-NEXT: mov r0, r7
407 ; SOFT-NEXT: bl __aeabi_f2uiz
408 ; SOFT-NEXT: cmp r6, #0
409 ; SOFT-NEXT: beq .LBB5_3
410 ; SOFT-NEXT: @ %bb.1:
411 ; SOFT-NEXT: cmp r5, #0
412 ; SOFT-NEXT: bne .LBB5_4
413 ; SOFT-NEXT: .LBB5_2:
414 ; SOFT-NEXT: add sp, #4
415 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
416 ; SOFT-NEXT: .LBB5_3:
417 ; SOFT-NEXT: mov r0, r6
418 ; SOFT-NEXT: cmp r5, #0
419 ; SOFT-NEXT: beq .LBB5_2
420 ; SOFT-NEXT: .LBB5_4:
421 ; SOFT-NEXT: mvns r0, r4
422 ; SOFT-NEXT: add sp, #4
423 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
424 ; SOFT-NEXT: .p2align 2
425 ; SOFT-NEXT: @ %bb.5:
426 ; SOFT-NEXT: .LCPI5_0:
427 ; SOFT-NEXT: .long 1333788671 @ 0x4f7fffff
429 ; VFP-LABEL: test_signed_i32_f32:
431 ; VFP-NEXT: vmov s0, r0
432 ; VFP-NEXT: vcvt.u32.f32 s0, s0
433 ; VFP-NEXT: vmov r0, s0
435 %x = call i32 @llvm.fptoui.sat.i32.f32(float %f)
439 define i50 @test_signed_i50_f32(float %f) nounwind {
440 ; SOFT-LABEL: test_signed_i50_f32:
442 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
443 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
445 ; SOFT-NEXT: sub sp, #4
446 ; SOFT-NEXT: mov r7, r0
447 ; SOFT-NEXT: ldr r1, .LCPI6_0
448 ; SOFT-NEXT: bl __aeabi_fcmpgt
449 ; SOFT-NEXT: mov r4, r0
450 ; SOFT-NEXT: movs r6, #0
451 ; SOFT-NEXT: mov r0, r7
452 ; SOFT-NEXT: mov r1, r6
453 ; SOFT-NEXT: bl __aeabi_fcmpge
454 ; SOFT-NEXT: mov r5, r0
455 ; SOFT-NEXT: mov r0, r7
456 ; SOFT-NEXT: bl __aeabi_f2ulz
457 ; SOFT-NEXT: cmp r5, #0
458 ; SOFT-NEXT: beq .LBB6_5
459 ; SOFT-NEXT: @ %bb.1:
460 ; SOFT-NEXT: cmp r4, #0
461 ; SOFT-NEXT: bne .LBB6_6
462 ; SOFT-NEXT: .LBB6_2:
463 ; SOFT-NEXT: cmp r5, #0
464 ; SOFT-NEXT: beq .LBB6_7
465 ; SOFT-NEXT: .LBB6_3:
466 ; SOFT-NEXT: cmp r4, #0
467 ; SOFT-NEXT: bne .LBB6_8
468 ; SOFT-NEXT: .LBB6_4:
469 ; SOFT-NEXT: add sp, #4
470 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
471 ; SOFT-NEXT: .LBB6_5:
472 ; SOFT-NEXT: mov r0, r5
473 ; SOFT-NEXT: cmp r4, #0
474 ; SOFT-NEXT: beq .LBB6_2
475 ; SOFT-NEXT: .LBB6_6:
476 ; SOFT-NEXT: mvns r0, r6
477 ; SOFT-NEXT: cmp r5, #0
478 ; SOFT-NEXT: bne .LBB6_3
479 ; SOFT-NEXT: .LBB6_7:
480 ; SOFT-NEXT: mov r1, r5
481 ; SOFT-NEXT: cmp r4, #0
482 ; SOFT-NEXT: beq .LBB6_4
483 ; SOFT-NEXT: .LBB6_8:
484 ; SOFT-NEXT: ldr r1, .LCPI6_1
485 ; SOFT-NEXT: add sp, #4
486 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
487 ; SOFT-NEXT: .p2align 2
488 ; SOFT-NEXT: @ %bb.9:
489 ; SOFT-NEXT: .LCPI6_0:
490 ; SOFT-NEXT: .long 1484783615 @ 0x587fffff
491 ; SOFT-NEXT: .LCPI6_1:
492 ; SOFT-NEXT: .long 262143 @ 0x3ffff
494 ; VFP-LABEL: test_signed_i50_f32:
496 ; VFP-NEXT: .save {r7, lr}
497 ; VFP-NEXT: push {r7, lr}
498 ; VFP-NEXT: .vsave {d8}
499 ; VFP-NEXT: vpush {d8}
500 ; VFP-NEXT: vmov s16, r0
501 ; VFP-NEXT: bl __aeabi_f2ulz
502 ; VFP-NEXT: vldr s0, .LCPI6_0
503 ; VFP-NEXT: vcmp.f32 s16, #0
504 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
506 ; VFP-NEXT: movlt r0, #0
507 ; VFP-NEXT: movlt r1, #0
508 ; VFP-NEXT: vcmp.f32 s16, s0
509 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
511 ; VFP-NEXT: movwgt r1, #65535
512 ; VFP-NEXT: movtgt r1, #3
513 ; VFP-NEXT: movgt.w r0, #-1
514 ; VFP-NEXT: vpop {d8}
515 ; VFP-NEXT: pop {r7, pc}
516 ; VFP-NEXT: .p2align 2
518 ; VFP-NEXT: .LCPI6_0:
519 ; VFP-NEXT: .long 0x587fffff @ float 1.12589984E+15
520 %x = call i50 @llvm.fptoui.sat.i50.f32(float %f)
524 define i64 @test_signed_i64_f32(float %f) nounwind {
525 ; SOFT-LABEL: test_signed_i64_f32:
527 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
528 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
530 ; SOFT-NEXT: sub sp, #4
531 ; SOFT-NEXT: mov r7, r0
532 ; SOFT-NEXT: ldr r1, .LCPI7_0
533 ; SOFT-NEXT: bl __aeabi_fcmpgt
534 ; SOFT-NEXT: mov r4, r0
535 ; SOFT-NEXT: movs r6, #0
536 ; SOFT-NEXT: mov r0, r7
537 ; SOFT-NEXT: mov r1, r6
538 ; SOFT-NEXT: bl __aeabi_fcmpge
539 ; SOFT-NEXT: mov r5, r0
540 ; SOFT-NEXT: mov r0, r7
541 ; SOFT-NEXT: bl __aeabi_f2ulz
542 ; SOFT-NEXT: mov r3, r0
543 ; SOFT-NEXT: cmp r5, #0
544 ; SOFT-NEXT: bne .LBB7_2
545 ; SOFT-NEXT: @ %bb.1:
546 ; SOFT-NEXT: mov r3, r5
547 ; SOFT-NEXT: .LBB7_2:
548 ; SOFT-NEXT: mvns r2, r6
549 ; SOFT-NEXT: cmp r4, #0
550 ; SOFT-NEXT: mov r0, r2
551 ; SOFT-NEXT: beq .LBB7_7
552 ; SOFT-NEXT: @ %bb.3:
553 ; SOFT-NEXT: cmp r5, #0
554 ; SOFT-NEXT: beq .LBB7_8
555 ; SOFT-NEXT: .LBB7_4:
556 ; SOFT-NEXT: cmp r4, #0
557 ; SOFT-NEXT: bne .LBB7_6
558 ; SOFT-NEXT: .LBB7_5:
559 ; SOFT-NEXT: mov r2, r1
560 ; SOFT-NEXT: .LBB7_6:
561 ; SOFT-NEXT: mov r1, r2
562 ; SOFT-NEXT: add sp, #4
563 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
564 ; SOFT-NEXT: .LBB7_7:
565 ; SOFT-NEXT: mov r0, r3
566 ; SOFT-NEXT: cmp r5, #0
567 ; SOFT-NEXT: bne .LBB7_4
568 ; SOFT-NEXT: .LBB7_8:
569 ; SOFT-NEXT: mov r1, r5
570 ; SOFT-NEXT: cmp r4, #0
571 ; SOFT-NEXT: beq .LBB7_5
572 ; SOFT-NEXT: b .LBB7_6
573 ; SOFT-NEXT: .p2align 2
574 ; SOFT-NEXT: @ %bb.9:
575 ; SOFT-NEXT: .LCPI7_0:
576 ; SOFT-NEXT: .long 1602224127 @ 0x5f7fffff
578 ; VFP-LABEL: test_signed_i64_f32:
580 ; VFP-NEXT: .save {r7, lr}
581 ; VFP-NEXT: push {r7, lr}
582 ; VFP-NEXT: .vsave {d8}
583 ; VFP-NEXT: vpush {d8}
584 ; VFP-NEXT: vmov s16, r0
585 ; VFP-NEXT: bl __aeabi_f2ulz
586 ; VFP-NEXT: vldr s0, .LCPI7_0
587 ; VFP-NEXT: vcmp.f32 s16, #0
588 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
590 ; VFP-NEXT: movlt r0, #0
591 ; VFP-NEXT: vcmp.f32 s16, s0
592 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
593 ; VFP-NEXT: vcmp.f32 s16, #0
595 ; VFP-NEXT: movgt.w r0, #-1
596 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
598 ; VFP-NEXT: movlt r1, #0
599 ; VFP-NEXT: vcmp.f32 s16, s0
600 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
602 ; VFP-NEXT: movgt.w r1, #-1
603 ; VFP-NEXT: vpop {d8}
604 ; VFP-NEXT: pop {r7, pc}
605 ; VFP-NEXT: .p2align 2
607 ; VFP-NEXT: .LCPI7_0:
608 ; VFP-NEXT: .long 0x5f7fffff @ float 1.8446743E+19
609 %x = call i64 @llvm.fptoui.sat.i64.f32(float %f)
613 define i100 @test_signed_i100_f32(float %f) nounwind {
614 ; SOFT-LABEL: test_signed_i100_f32:
616 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
617 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
619 ; SOFT-NEXT: sub sp, #4
620 ; SOFT-NEXT: mov r7, r0
621 ; SOFT-NEXT: ldr r1, .LCPI8_0
622 ; SOFT-NEXT: bl __aeabi_fcmpgt
623 ; SOFT-NEXT: mov r4, r0
624 ; SOFT-NEXT: movs r6, #0
625 ; SOFT-NEXT: mov r0, r7
626 ; SOFT-NEXT: mov r1, r6
627 ; SOFT-NEXT: bl __aeabi_fcmpge
628 ; SOFT-NEXT: mov r5, r0
629 ; SOFT-NEXT: mov r0, r7
630 ; SOFT-NEXT: bl __fixunssfti
631 ; SOFT-NEXT: mov r7, r1
632 ; SOFT-NEXT: str r2, [sp] @ 4-byte Spill
633 ; SOFT-NEXT: cmp r5, #0
634 ; SOFT-NEXT: bne .LBB8_2
635 ; SOFT-NEXT: @ %bb.1:
636 ; SOFT-NEXT: mov r0, r5
637 ; SOFT-NEXT: .LBB8_2:
638 ; SOFT-NEXT: mvns r2, r6
639 ; SOFT-NEXT: cmp r4, #0
640 ; SOFT-NEXT: mov r6, r2
641 ; SOFT-NEXT: bne .LBB8_4
642 ; SOFT-NEXT: @ %bb.3:
643 ; SOFT-NEXT: mov r6, r0
644 ; SOFT-NEXT: .LBB8_4:
645 ; SOFT-NEXT: cmp r5, #0
646 ; SOFT-NEXT: bne .LBB8_6
647 ; SOFT-NEXT: @ %bb.5:
648 ; SOFT-NEXT: mov r7, r5
649 ; SOFT-NEXT: .LBB8_6:
650 ; SOFT-NEXT: cmp r4, #0
651 ; SOFT-NEXT: mov r1, r2
652 ; SOFT-NEXT: beq .LBB8_13
653 ; SOFT-NEXT: @ %bb.7:
654 ; SOFT-NEXT: cmp r5, #0
655 ; SOFT-NEXT: beq .LBB8_14
656 ; SOFT-NEXT: .LBB8_8:
657 ; SOFT-NEXT: cmp r4, #0
658 ; SOFT-NEXT: beq .LBB8_15
659 ; SOFT-NEXT: .LBB8_9:
660 ; SOFT-NEXT: cmp r5, #0
661 ; SOFT-NEXT: beq .LBB8_16
662 ; SOFT-NEXT: .LBB8_10:
663 ; SOFT-NEXT: cmp r4, #0
664 ; SOFT-NEXT: beq .LBB8_12
665 ; SOFT-NEXT: .LBB8_11:
666 ; SOFT-NEXT: movs r3, #15
667 ; SOFT-NEXT: .LBB8_12:
668 ; SOFT-NEXT: mov r0, r6
669 ; SOFT-NEXT: add sp, #4
670 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
671 ; SOFT-NEXT: .LBB8_13:
672 ; SOFT-NEXT: mov r1, r7
673 ; SOFT-NEXT: cmp r5, #0
674 ; SOFT-NEXT: bne .LBB8_8
675 ; SOFT-NEXT: .LBB8_14:
676 ; SOFT-NEXT: str r5, [sp] @ 4-byte Spill
677 ; SOFT-NEXT: cmp r4, #0
678 ; SOFT-NEXT: bne .LBB8_9
679 ; SOFT-NEXT: .LBB8_15:
680 ; SOFT-NEXT: ldr r2, [sp] @ 4-byte Reload
681 ; SOFT-NEXT: cmp r5, #0
682 ; SOFT-NEXT: bne .LBB8_10
683 ; SOFT-NEXT: .LBB8_16:
684 ; SOFT-NEXT: mov r3, r5
685 ; SOFT-NEXT: cmp r4, #0
686 ; SOFT-NEXT: bne .LBB8_11
687 ; SOFT-NEXT: b .LBB8_12
688 ; SOFT-NEXT: .p2align 2
689 ; SOFT-NEXT: @ %bb.17:
690 ; SOFT-NEXT: .LCPI8_0:
691 ; SOFT-NEXT: .long 1904214015 @ 0x717fffff
693 ; VFP-LABEL: test_signed_i100_f32:
695 ; VFP-NEXT: .save {r7, lr}
696 ; VFP-NEXT: push {r7, lr}
697 ; VFP-NEXT: .vsave {d8}
698 ; VFP-NEXT: vpush {d8}
699 ; VFP-NEXT: vmov s16, r0
700 ; VFP-NEXT: bl __fixunssfti
701 ; VFP-NEXT: vldr s0, .LCPI8_0
702 ; VFP-NEXT: vcmp.f32 s16, #0
703 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
705 ; VFP-NEXT: movlt r0, #0
706 ; VFP-NEXT: vcmp.f32 s16, s0
707 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
708 ; VFP-NEXT: vcmp.f32 s16, #0
710 ; VFP-NEXT: movgt.w r0, #-1
711 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
712 ; VFP-NEXT: vcmp.f32 s16, s0
714 ; VFP-NEXT: movlt r1, #0
715 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
716 ; VFP-NEXT: vcmp.f32 s16, #0
718 ; VFP-NEXT: movgt.w r1, #-1
719 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
720 ; VFP-NEXT: vcmp.f32 s16, s0
722 ; VFP-NEXT: movlt r2, #0
723 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
724 ; VFP-NEXT: vcmp.f32 s16, #0
726 ; VFP-NEXT: movgt.w r2, #-1
727 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
729 ; VFP-NEXT: movlt r3, #0
730 ; VFP-NEXT: vcmp.f32 s16, s0
731 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
733 ; VFP-NEXT: movgt r3, #15
734 ; VFP-NEXT: vpop {d8}
735 ; VFP-NEXT: pop {r7, pc}
736 ; VFP-NEXT: .p2align 2
738 ; VFP-NEXT: .LCPI8_0:
739 ; VFP-NEXT: .long 0x717fffff @ float 1.26765052E+30
740 %x = call i100 @llvm.fptoui.sat.i100.f32(float %f)
744 define i128 @test_signed_i128_f32(float %f) nounwind {
745 ; SOFT-LABEL: test_signed_i128_f32:
747 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
748 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
750 ; SOFT-NEXT: sub sp, #4
751 ; SOFT-NEXT: mov r7, r0
752 ; SOFT-NEXT: ldr r1, .LCPI9_0
753 ; SOFT-NEXT: bl __aeabi_fcmpgt
754 ; SOFT-NEXT: mov r4, r0
755 ; SOFT-NEXT: movs r6, #0
756 ; SOFT-NEXT: mov r0, r7
757 ; SOFT-NEXT: mov r1, r6
758 ; SOFT-NEXT: bl __aeabi_fcmpge
759 ; SOFT-NEXT: mov r5, r0
760 ; SOFT-NEXT: mov r0, r7
761 ; SOFT-NEXT: bl __fixunssfti
762 ; SOFT-NEXT: mov r7, r1
763 ; SOFT-NEXT: str r3, [sp] @ 4-byte Spill
764 ; SOFT-NEXT: cmp r5, #0
765 ; SOFT-NEXT: bne .LBB9_2
766 ; SOFT-NEXT: @ %bb.1:
767 ; SOFT-NEXT: mov r0, r5
768 ; SOFT-NEXT: .LBB9_2:
769 ; SOFT-NEXT: mvns r6, r6
770 ; SOFT-NEXT: cmp r4, #0
771 ; SOFT-NEXT: mov r3, r6
772 ; SOFT-NEXT: bne .LBB9_4
773 ; SOFT-NEXT: @ %bb.3:
774 ; SOFT-NEXT: mov r3, r0
775 ; SOFT-NEXT: .LBB9_4:
776 ; SOFT-NEXT: cmp r5, #0
777 ; SOFT-NEXT: bne .LBB9_6
778 ; SOFT-NEXT: @ %bb.5:
779 ; SOFT-NEXT: mov r7, r5
780 ; SOFT-NEXT: .LBB9_6:
781 ; SOFT-NEXT: cmp r4, #0
782 ; SOFT-NEXT: mov r1, r6
783 ; SOFT-NEXT: bne .LBB9_8
784 ; SOFT-NEXT: @ %bb.7:
785 ; SOFT-NEXT: mov r1, r7
786 ; SOFT-NEXT: .LBB9_8:
787 ; SOFT-NEXT: cmp r5, #0
788 ; SOFT-NEXT: bne .LBB9_10
789 ; SOFT-NEXT: @ %bb.9:
790 ; SOFT-NEXT: mov r2, r5
791 ; SOFT-NEXT: .LBB9_10:
792 ; SOFT-NEXT: cmp r4, #0
793 ; SOFT-NEXT: mov r7, r6
794 ; SOFT-NEXT: beq .LBB9_15
795 ; SOFT-NEXT: @ %bb.11:
796 ; SOFT-NEXT: cmp r5, #0
797 ; SOFT-NEXT: beq .LBB9_16
798 ; SOFT-NEXT: .LBB9_12:
799 ; SOFT-NEXT: cmp r4, #0
800 ; SOFT-NEXT: bne .LBB9_14
801 ; SOFT-NEXT: .LBB9_13:
802 ; SOFT-NEXT: ldr r6, [sp] @ 4-byte Reload
803 ; SOFT-NEXT: .LBB9_14:
804 ; SOFT-NEXT: mov r0, r3
805 ; SOFT-NEXT: mov r2, r7
806 ; SOFT-NEXT: mov r3, r6
807 ; SOFT-NEXT: add sp, #4
808 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
809 ; SOFT-NEXT: .LBB9_15:
810 ; SOFT-NEXT: mov r7, r2
811 ; SOFT-NEXT: cmp r5, #0
812 ; SOFT-NEXT: bne .LBB9_12
813 ; SOFT-NEXT: .LBB9_16:
814 ; SOFT-NEXT: str r5, [sp] @ 4-byte Spill
815 ; SOFT-NEXT: cmp r4, #0
816 ; SOFT-NEXT: beq .LBB9_13
817 ; SOFT-NEXT: b .LBB9_14
818 ; SOFT-NEXT: .p2align 2
819 ; SOFT-NEXT: @ %bb.17:
820 ; SOFT-NEXT: .LCPI9_0:
821 ; SOFT-NEXT: .long 2139095039 @ 0x7f7fffff
823 ; VFP-LABEL: test_signed_i128_f32:
825 ; VFP-NEXT: .save {r7, lr}
826 ; VFP-NEXT: push {r7, lr}
827 ; VFP-NEXT: .vsave {d8}
828 ; VFP-NEXT: vpush {d8}
829 ; VFP-NEXT: vmov s16, r0
830 ; VFP-NEXT: bl __fixunssfti
831 ; VFP-NEXT: vldr s0, .LCPI9_0
832 ; VFP-NEXT: vcmp.f32 s16, #0
833 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
835 ; VFP-NEXT: movlt r0, #0
836 ; VFP-NEXT: vcmp.f32 s16, s0
837 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
838 ; VFP-NEXT: vcmp.f32 s16, #0
840 ; VFP-NEXT: movgt.w r0, #-1
841 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
842 ; VFP-NEXT: vcmp.f32 s16, s0
844 ; VFP-NEXT: movlt r1, #0
845 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
846 ; VFP-NEXT: vcmp.f32 s16, #0
848 ; VFP-NEXT: movgt.w r1, #-1
849 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
850 ; VFP-NEXT: vcmp.f32 s16, s0
852 ; VFP-NEXT: movlt r2, #0
853 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
854 ; VFP-NEXT: vcmp.f32 s16, #0
856 ; VFP-NEXT: movgt.w r2, #-1
857 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
859 ; VFP-NEXT: movlt r3, #0
860 ; VFP-NEXT: vcmp.f32 s16, s0
861 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
863 ; VFP-NEXT: movgt.w r3, #-1
864 ; VFP-NEXT: vpop {d8}
865 ; VFP-NEXT: pop {r7, pc}
866 ; VFP-NEXT: .p2align 2
868 ; VFP-NEXT: .LCPI9_0:
869 ; VFP-NEXT: .long 0x7f7fffff @ float 3.40282347E+38
870 %x = call i128 @llvm.fptoui.sat.i128.f32(float %f)
875 ; 64-bit float to signed integer
878 declare i1 @llvm.fptoui.sat.i1.f64 (double)
879 declare i8 @llvm.fptoui.sat.i8.f64 (double)
880 declare i13 @llvm.fptoui.sat.i13.f64 (double)
881 declare i16 @llvm.fptoui.sat.i16.f64 (double)
882 declare i19 @llvm.fptoui.sat.i19.f64 (double)
883 declare i32 @llvm.fptoui.sat.i32.f64 (double)
884 declare i50 @llvm.fptoui.sat.i50.f64 (double)
885 declare i64 @llvm.fptoui.sat.i64.f64 (double)
886 declare i100 @llvm.fptoui.sat.i100.f64(double)
887 declare i128 @llvm.fptoui.sat.i128.f64(double)
889 define i1 @test_signed_i1_f64(double %f) nounwind {
890 ; SOFT-LABEL: test_signed_i1_f64:
892 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
893 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
895 ; SOFT-NEXT: sub sp, #4
896 ; SOFT-NEXT: mov r4, r1
897 ; SOFT-NEXT: mov r6, r0
898 ; SOFT-NEXT: movs r7, #0
899 ; SOFT-NEXT: ldr r3, .LCPI10_0
900 ; SOFT-NEXT: mov r2, r7
901 ; SOFT-NEXT: bl __aeabi_dcmpgt
902 ; SOFT-NEXT: mov r5, r0
903 ; SOFT-NEXT: mov r0, r6
904 ; SOFT-NEXT: mov r1, r4
905 ; SOFT-NEXT: mov r2, r7
906 ; SOFT-NEXT: mov r3, r7
907 ; SOFT-NEXT: bl __aeabi_dcmpge
908 ; SOFT-NEXT: mov r7, r0
909 ; SOFT-NEXT: mov r0, r6
910 ; SOFT-NEXT: mov r1, r4
911 ; SOFT-NEXT: bl __aeabi_d2uiz
912 ; SOFT-NEXT: cmp r7, #0
913 ; SOFT-NEXT: beq .LBB10_3
914 ; SOFT-NEXT: @ %bb.1:
915 ; SOFT-NEXT: cmp r5, #0
916 ; SOFT-NEXT: bne .LBB10_4
917 ; SOFT-NEXT: .LBB10_2:
918 ; SOFT-NEXT: add sp, #4
919 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
920 ; SOFT-NEXT: .LBB10_3:
921 ; SOFT-NEXT: mov r0, r7
922 ; SOFT-NEXT: cmp r5, #0
923 ; SOFT-NEXT: beq .LBB10_2
924 ; SOFT-NEXT: .LBB10_4:
925 ; SOFT-NEXT: movs r0, #1
926 ; SOFT-NEXT: add sp, #4
927 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
928 ; SOFT-NEXT: .p2align 2
929 ; SOFT-NEXT: @ %bb.5:
930 ; SOFT-NEXT: .LCPI10_0:
931 ; SOFT-NEXT: .long 1072693248 @ 0x3ff00000
933 ; VFP2-LABEL: test_signed_i1_f64:
935 ; VFP2-NEXT: vmov d16, r0, r1
936 ; VFP2-NEXT: vcmp.f64 d16, #0
937 ; VFP2-NEXT: vcvt.u32.f64 s0, d16
938 ; VFP2-NEXT: vmov.f64 d17, #1.000000e+00
939 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
940 ; VFP2-NEXT: vmov r0, s0
941 ; VFP2-NEXT: vcmp.f64 d16, d17
943 ; VFP2-NEXT: movlt r0, #0
944 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
946 ; VFP2-NEXT: movgt r0, #1
949 ; FP16-LABEL: test_signed_i1_f64:
951 ; FP16-NEXT: vmov.f64 d0, #1.000000e+00
952 ; FP16-NEXT: vldr d1, .LCPI10_0
953 ; FP16-NEXT: vmov d2, r0, r1
954 ; FP16-NEXT: vmaxnm.f64 d1, d2, d1
955 ; FP16-NEXT: vminnm.f64 d0, d1, d0
956 ; FP16-NEXT: vcvt.u32.f64 s0, d0
957 ; FP16-NEXT: vmov r0, s0
959 ; FP16-NEXT: .p2align 3
960 ; FP16-NEXT: @ %bb.1:
961 ; FP16-NEXT: .LCPI10_0:
962 ; FP16-NEXT: .long 0 @ double 0
964 %x = call i1 @llvm.fptoui.sat.i1.f64(double %f)
968 define i8 @test_signed_i8_f64(double %f) nounwind {
969 ; SOFT-LABEL: test_signed_i8_f64:
971 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
972 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
974 ; SOFT-NEXT: sub sp, #4
975 ; SOFT-NEXT: mov r4, r1
976 ; SOFT-NEXT: mov r6, r0
977 ; SOFT-NEXT: movs r7, #0
978 ; SOFT-NEXT: ldr r3, .LCPI11_0
979 ; SOFT-NEXT: mov r2, r7
980 ; SOFT-NEXT: bl __aeabi_dcmpgt
981 ; SOFT-NEXT: mov r5, r0
982 ; SOFT-NEXT: mov r0, r6
983 ; SOFT-NEXT: mov r1, r4
984 ; SOFT-NEXT: mov r2, r7
985 ; SOFT-NEXT: mov r3, r7
986 ; SOFT-NEXT: bl __aeabi_dcmpge
987 ; SOFT-NEXT: mov r7, r0
988 ; SOFT-NEXT: mov r0, r6
989 ; SOFT-NEXT: mov r1, r4
990 ; SOFT-NEXT: bl __aeabi_d2uiz
991 ; SOFT-NEXT: cmp r7, #0
992 ; SOFT-NEXT: beq .LBB11_3
993 ; SOFT-NEXT: @ %bb.1:
994 ; SOFT-NEXT: cmp r5, #0
995 ; SOFT-NEXT: bne .LBB11_4
996 ; SOFT-NEXT: .LBB11_2:
997 ; SOFT-NEXT: add sp, #4
998 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
999 ; SOFT-NEXT: .LBB11_3:
1000 ; SOFT-NEXT: mov r0, r7
1001 ; SOFT-NEXT: cmp r5, #0
1002 ; SOFT-NEXT: beq .LBB11_2
1003 ; SOFT-NEXT: .LBB11_4:
1004 ; SOFT-NEXT: movs r0, #255
1005 ; SOFT-NEXT: add sp, #4
1006 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
1007 ; SOFT-NEXT: .p2align 2
1008 ; SOFT-NEXT: @ %bb.5:
1009 ; SOFT-NEXT: .LCPI11_0:
1010 ; SOFT-NEXT: .long 1081073664 @ 0x406fe000
1012 ; VFP2-LABEL: test_signed_i8_f64:
1014 ; VFP2-NEXT: vmov d16, r0, r1
1015 ; VFP2-NEXT: vldr d17, .LCPI11_0
1016 ; VFP2-NEXT: vcmp.f64 d16, #0
1017 ; VFP2-NEXT: vcvt.u32.f64 s0, d16
1018 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1019 ; VFP2-NEXT: vmov r0, s0
1020 ; VFP2-NEXT: vcmp.f64 d16, d17
1022 ; VFP2-NEXT: movlt r0, #0
1023 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1025 ; VFP2-NEXT: movgt r0, #255
1027 ; VFP2-NEXT: .p2align 3
1028 ; VFP2-NEXT: @ %bb.1:
1029 ; VFP2-NEXT: .LCPI11_0:
1030 ; VFP2-NEXT: .long 0 @ double 255
1031 ; VFP2-NEXT: .long 1081073664
1033 ; FP16-LABEL: test_signed_i8_f64:
1035 ; FP16-NEXT: vldr d0, .LCPI11_0
1036 ; FP16-NEXT: vmov d1, r0, r1
1037 ; FP16-NEXT: vldr d2, .LCPI11_1
1038 ; FP16-NEXT: vmaxnm.f64 d0, d1, d0
1039 ; FP16-NEXT: vminnm.f64 d0, d0, d2
1040 ; FP16-NEXT: vcvt.u32.f64 s0, d0
1041 ; FP16-NEXT: vmov r0, s0
1043 ; FP16-NEXT: .p2align 3
1044 ; FP16-NEXT: @ %bb.1:
1045 ; FP16-NEXT: .LCPI11_0:
1046 ; FP16-NEXT: .long 0 @ double 0
1047 ; FP16-NEXT: .long 0
1048 ; FP16-NEXT: .LCPI11_1:
1049 ; FP16-NEXT: .long 0 @ double 255
1050 ; FP16-NEXT: .long 1081073664
1051 %x = call i8 @llvm.fptoui.sat.i8.f64(double %f)
1055 define i13 @test_signed_i13_f64(double %f) nounwind {
1056 ; SOFT-LABEL: test_signed_i13_f64:
1058 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
1059 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
1060 ; SOFT-NEXT: .pad #4
1061 ; SOFT-NEXT: sub sp, #4
1062 ; SOFT-NEXT: mov r4, r1
1063 ; SOFT-NEXT: mov r6, r0
1064 ; SOFT-NEXT: movs r7, #0
1065 ; SOFT-NEXT: ldr r3, .LCPI12_0
1066 ; SOFT-NEXT: mov r2, r7
1067 ; SOFT-NEXT: bl __aeabi_dcmpgt
1068 ; SOFT-NEXT: mov r5, r0
1069 ; SOFT-NEXT: mov r0, r6
1070 ; SOFT-NEXT: mov r1, r4
1071 ; SOFT-NEXT: mov r2, r7
1072 ; SOFT-NEXT: mov r3, r7
1073 ; SOFT-NEXT: bl __aeabi_dcmpge
1074 ; SOFT-NEXT: mov r7, r0
1075 ; SOFT-NEXT: mov r0, r6
1076 ; SOFT-NEXT: mov r1, r4
1077 ; SOFT-NEXT: bl __aeabi_d2uiz
1078 ; SOFT-NEXT: cmp r7, #0
1079 ; SOFT-NEXT: beq .LBB12_3
1080 ; SOFT-NEXT: @ %bb.1:
1081 ; SOFT-NEXT: cmp r5, #0
1082 ; SOFT-NEXT: bne .LBB12_4
1083 ; SOFT-NEXT: .LBB12_2:
1084 ; SOFT-NEXT: add sp, #4
1085 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
1086 ; SOFT-NEXT: .LBB12_3:
1087 ; SOFT-NEXT: mov r0, r7
1088 ; SOFT-NEXT: cmp r5, #0
1089 ; SOFT-NEXT: beq .LBB12_2
1090 ; SOFT-NEXT: .LBB12_4:
1091 ; SOFT-NEXT: ldr r0, .LCPI12_1
1092 ; SOFT-NEXT: add sp, #4
1093 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
1094 ; SOFT-NEXT: .p2align 2
1095 ; SOFT-NEXT: @ %bb.5:
1096 ; SOFT-NEXT: .LCPI12_0:
1097 ; SOFT-NEXT: .long 1086324480 @ 0x40bfff00
1098 ; SOFT-NEXT: .LCPI12_1:
1099 ; SOFT-NEXT: .long 8191 @ 0x1fff
1101 ; VFP2-LABEL: test_signed_i13_f64:
1103 ; VFP2-NEXT: vmov d16, r0, r1
1104 ; VFP2-NEXT: vldr d17, .LCPI12_0
1105 ; VFP2-NEXT: vcmp.f64 d16, #0
1106 ; VFP2-NEXT: vcvt.u32.f64 s0, d16
1107 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1108 ; VFP2-NEXT: vmov r0, s0
1109 ; VFP2-NEXT: vcmp.f64 d16, d17
1111 ; VFP2-NEXT: movlt r0, #0
1112 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1114 ; VFP2-NEXT: movwgt r0, #8191
1116 ; VFP2-NEXT: .p2align 3
1117 ; VFP2-NEXT: @ %bb.1:
1118 ; VFP2-NEXT: .LCPI12_0:
1119 ; VFP2-NEXT: .long 0 @ double 8191
1120 ; VFP2-NEXT: .long 1086324480
1122 ; FP16-LABEL: test_signed_i13_f64:
1124 ; FP16-NEXT: vldr d0, .LCPI12_0
1125 ; FP16-NEXT: vmov d1, r0, r1
1126 ; FP16-NEXT: vldr d2, .LCPI12_1
1127 ; FP16-NEXT: vmaxnm.f64 d0, d1, d0
1128 ; FP16-NEXT: vminnm.f64 d0, d0, d2
1129 ; FP16-NEXT: vcvt.u32.f64 s0, d0
1130 ; FP16-NEXT: vmov r0, s0
1132 ; FP16-NEXT: .p2align 3
1133 ; FP16-NEXT: @ %bb.1:
1134 ; FP16-NEXT: .LCPI12_0:
1135 ; FP16-NEXT: .long 0 @ double 0
1136 ; FP16-NEXT: .long 0
1137 ; FP16-NEXT: .LCPI12_1:
1138 ; FP16-NEXT: .long 0 @ double 8191
1139 ; FP16-NEXT: .long 1086324480
1140 %x = call i13 @llvm.fptoui.sat.i13.f64(double %f)
1144 define i16 @test_signed_i16_f64(double %f) nounwind {
1145 ; SOFT-LABEL: test_signed_i16_f64:
1147 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
1148 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
1149 ; SOFT-NEXT: .pad #4
1150 ; SOFT-NEXT: sub sp, #4
1151 ; SOFT-NEXT: mov r4, r1
1152 ; SOFT-NEXT: mov r6, r0
1153 ; SOFT-NEXT: movs r7, #0
1154 ; SOFT-NEXT: ldr r3, .LCPI13_0
1155 ; SOFT-NEXT: mov r2, r7
1156 ; SOFT-NEXT: bl __aeabi_dcmpgt
1157 ; SOFT-NEXT: mov r5, r0
1158 ; SOFT-NEXT: mov r0, r6
1159 ; SOFT-NEXT: mov r1, r4
1160 ; SOFT-NEXT: mov r2, r7
1161 ; SOFT-NEXT: mov r3, r7
1162 ; SOFT-NEXT: bl __aeabi_dcmpge
1163 ; SOFT-NEXT: mov r7, r0
1164 ; SOFT-NEXT: mov r0, r6
1165 ; SOFT-NEXT: mov r1, r4
1166 ; SOFT-NEXT: bl __aeabi_d2uiz
1167 ; SOFT-NEXT: cmp r7, #0
1168 ; SOFT-NEXT: beq .LBB13_3
1169 ; SOFT-NEXT: @ %bb.1:
1170 ; SOFT-NEXT: cmp r5, #0
1171 ; SOFT-NEXT: bne .LBB13_4
1172 ; SOFT-NEXT: .LBB13_2:
1173 ; SOFT-NEXT: add sp, #4
1174 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
1175 ; SOFT-NEXT: .LBB13_3:
1176 ; SOFT-NEXT: mov r0, r7
1177 ; SOFT-NEXT: cmp r5, #0
1178 ; SOFT-NEXT: beq .LBB13_2
1179 ; SOFT-NEXT: .LBB13_4:
1180 ; SOFT-NEXT: ldr r0, .LCPI13_1
1181 ; SOFT-NEXT: add sp, #4
1182 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
1183 ; SOFT-NEXT: .p2align 2
1184 ; SOFT-NEXT: @ %bb.5:
1185 ; SOFT-NEXT: .LCPI13_0:
1186 ; SOFT-NEXT: .long 1089470432 @ 0x40efffe0
1187 ; SOFT-NEXT: .LCPI13_1:
1188 ; SOFT-NEXT: .long 65535 @ 0xffff
1190 ; VFP2-LABEL: test_signed_i16_f64:
1192 ; VFP2-NEXT: vmov d16, r0, r1
1193 ; VFP2-NEXT: vldr d17, .LCPI13_0
1194 ; VFP2-NEXT: vcmp.f64 d16, #0
1195 ; VFP2-NEXT: vcvt.u32.f64 s0, d16
1196 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1197 ; VFP2-NEXT: vmov r0, s0
1198 ; VFP2-NEXT: vcmp.f64 d16, d17
1200 ; VFP2-NEXT: movlt r0, #0
1201 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1203 ; VFP2-NEXT: movwgt r0, #65535
1205 ; VFP2-NEXT: .p2align 3
1206 ; VFP2-NEXT: @ %bb.1:
1207 ; VFP2-NEXT: .LCPI13_0:
1208 ; VFP2-NEXT: .long 0 @ double 65535
1209 ; VFP2-NEXT: .long 1089470432
1211 ; FP16-LABEL: test_signed_i16_f64:
1213 ; FP16-NEXT: vldr d0, .LCPI13_0
1214 ; FP16-NEXT: vmov d1, r0, r1
1215 ; FP16-NEXT: vldr d2, .LCPI13_1
1216 ; FP16-NEXT: vmaxnm.f64 d0, d1, d0
1217 ; FP16-NEXT: vminnm.f64 d0, d0, d2
1218 ; FP16-NEXT: vcvt.u32.f64 s0, d0
1219 ; FP16-NEXT: vmov r0, s0
1221 ; FP16-NEXT: .p2align 3
1222 ; FP16-NEXT: @ %bb.1:
1223 ; FP16-NEXT: .LCPI13_0:
1224 ; FP16-NEXT: .long 0 @ double 0
1225 ; FP16-NEXT: .long 0
1226 ; FP16-NEXT: .LCPI13_1:
1227 ; FP16-NEXT: .long 0 @ double 65535
1228 ; FP16-NEXT: .long 1089470432
1229 %x = call i16 @llvm.fptoui.sat.i16.f64(double %f)
1233 define i19 @test_signed_i19_f64(double %f) nounwind {
1234 ; SOFT-LABEL: test_signed_i19_f64:
1236 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
1237 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
1238 ; SOFT-NEXT: .pad #4
1239 ; SOFT-NEXT: sub sp, #4
1240 ; SOFT-NEXT: mov r4, r1
1241 ; SOFT-NEXT: mov r6, r0
1242 ; SOFT-NEXT: movs r7, #0
1243 ; SOFT-NEXT: ldr r3, .LCPI14_0
1244 ; SOFT-NEXT: mov r2, r7
1245 ; SOFT-NEXT: bl __aeabi_dcmpgt
1246 ; SOFT-NEXT: mov r5, r0
1247 ; SOFT-NEXT: mov r0, r6
1248 ; SOFT-NEXT: mov r1, r4
1249 ; SOFT-NEXT: mov r2, r7
1250 ; SOFT-NEXT: mov r3, r7
1251 ; SOFT-NEXT: bl __aeabi_dcmpge
1252 ; SOFT-NEXT: mov r7, r0
1253 ; SOFT-NEXT: mov r0, r6
1254 ; SOFT-NEXT: mov r1, r4
1255 ; SOFT-NEXT: bl __aeabi_d2uiz
1256 ; SOFT-NEXT: cmp r7, #0
1257 ; SOFT-NEXT: beq .LBB14_3
1258 ; SOFT-NEXT: @ %bb.1:
1259 ; SOFT-NEXT: cmp r5, #0
1260 ; SOFT-NEXT: bne .LBB14_4
1261 ; SOFT-NEXT: .LBB14_2:
1262 ; SOFT-NEXT: add sp, #4
1263 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
1264 ; SOFT-NEXT: .LBB14_3:
1265 ; SOFT-NEXT: mov r0, r7
1266 ; SOFT-NEXT: cmp r5, #0
1267 ; SOFT-NEXT: beq .LBB14_2
1268 ; SOFT-NEXT: .LBB14_4:
1269 ; SOFT-NEXT: ldr r0, .LCPI14_1
1270 ; SOFT-NEXT: add sp, #4
1271 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
1272 ; SOFT-NEXT: .p2align 2
1273 ; SOFT-NEXT: @ %bb.5:
1274 ; SOFT-NEXT: .LCPI14_0:
1275 ; SOFT-NEXT: .long 1092616188 @ 0x411ffffc
1276 ; SOFT-NEXT: .LCPI14_1:
1277 ; SOFT-NEXT: .long 524287 @ 0x7ffff
1279 ; VFP2-LABEL: test_signed_i19_f64:
1281 ; VFP2-NEXT: vmov d16, r0, r1
1282 ; VFP2-NEXT: vldr d17, .LCPI14_0
1283 ; VFP2-NEXT: vcmp.f64 d16, #0
1284 ; VFP2-NEXT: vcvt.u32.f64 s0, d16
1285 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1286 ; VFP2-NEXT: vmov r0, s0
1287 ; VFP2-NEXT: vcmp.f64 d16, d17
1289 ; VFP2-NEXT: movlt r0, #0
1290 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1292 ; VFP2-NEXT: movwgt r0, #65535
1293 ; VFP2-NEXT: movtgt r0, #7
1295 ; VFP2-NEXT: .p2align 3
1296 ; VFP2-NEXT: @ %bb.1:
1297 ; VFP2-NEXT: .LCPI14_0:
1298 ; VFP2-NEXT: .long 0 @ double 524287
1299 ; VFP2-NEXT: .long 1092616188
1301 ; FP16-LABEL: test_signed_i19_f64:
1303 ; FP16-NEXT: vldr d0, .LCPI14_0
1304 ; FP16-NEXT: vmov d1, r0, r1
1305 ; FP16-NEXT: vldr d2, .LCPI14_1
1306 ; FP16-NEXT: vmaxnm.f64 d0, d1, d0
1307 ; FP16-NEXT: vminnm.f64 d0, d0, d2
1308 ; FP16-NEXT: vcvt.u32.f64 s0, d0
1309 ; FP16-NEXT: vmov r0, s0
1311 ; FP16-NEXT: .p2align 3
1312 ; FP16-NEXT: @ %bb.1:
1313 ; FP16-NEXT: .LCPI14_0:
1314 ; FP16-NEXT: .long 0 @ double 0
1315 ; FP16-NEXT: .long 0
1316 ; FP16-NEXT: .LCPI14_1:
1317 ; FP16-NEXT: .long 0 @ double 524287
1318 ; FP16-NEXT: .long 1092616188
1319 %x = call i19 @llvm.fptoui.sat.i19.f64(double %f)
1323 define i32 @test_signed_i32_f64(double %f) nounwind {
1324 ; SOFT-LABEL: test_signed_i32_f64:
1326 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
1327 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
1328 ; SOFT-NEXT: .pad #4
1329 ; SOFT-NEXT: sub sp, #4
1330 ; SOFT-NEXT: mov r5, r1
1331 ; SOFT-NEXT: mov r7, r0
1332 ; SOFT-NEXT: ldr r2, .LCPI15_0
1333 ; SOFT-NEXT: ldr r3, .LCPI15_1
1334 ; SOFT-NEXT: bl __aeabi_dcmpgt
1335 ; SOFT-NEXT: str r0, [sp] @ 4-byte Spill
1336 ; SOFT-NEXT: movs r4, #0
1337 ; SOFT-NEXT: mov r0, r7
1338 ; SOFT-NEXT: mov r1, r5
1339 ; SOFT-NEXT: mov r2, r4
1340 ; SOFT-NEXT: mov r3, r4
1341 ; SOFT-NEXT: bl __aeabi_dcmpge
1342 ; SOFT-NEXT: mov r6, r0
1343 ; SOFT-NEXT: mov r0, r7
1344 ; SOFT-NEXT: mov r1, r5
1345 ; SOFT-NEXT: bl __aeabi_d2uiz
1346 ; SOFT-NEXT: cmp r6, #0
1347 ; SOFT-NEXT: bne .LBB15_2
1348 ; SOFT-NEXT: @ %bb.1:
1349 ; SOFT-NEXT: mov r0, r6
1350 ; SOFT-NEXT: .LBB15_2:
1351 ; SOFT-NEXT: ldr r1, [sp] @ 4-byte Reload
1352 ; SOFT-NEXT: cmp r1, #0
1353 ; SOFT-NEXT: beq .LBB15_4
1354 ; SOFT-NEXT: @ %bb.3:
1355 ; SOFT-NEXT: mvns r0, r4
1356 ; SOFT-NEXT: .LBB15_4:
1357 ; SOFT-NEXT: add sp, #4
1358 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
1359 ; SOFT-NEXT: .p2align 2
1360 ; SOFT-NEXT: @ %bb.5:
1361 ; SOFT-NEXT: .LCPI15_0:
1362 ; SOFT-NEXT: .long 4292870144 @ 0xffe00000
1363 ; SOFT-NEXT: .LCPI15_1:
1364 ; SOFT-NEXT: .long 1106247679 @ 0x41efffff
1366 ; VFP2-LABEL: test_signed_i32_f64:
1368 ; VFP2-NEXT: vmov d16, r0, r1
1369 ; VFP2-NEXT: vcvt.u32.f64 s0, d16
1370 ; VFP2-NEXT: vmov r0, s0
1373 ; FP16-LABEL: test_signed_i32_f64:
1375 ; FP16-NEXT: vmov d0, r0, r1
1376 ; FP16-NEXT: vcvt.u32.f64 s0, d0
1377 ; FP16-NEXT: vmov r0, s0
1379 %x = call i32 @llvm.fptoui.sat.i32.f64(double %f)
1383 define i50 @test_signed_i50_f64(double %f) nounwind {
1384 ; SOFT-LABEL: test_signed_i50_f64:
1386 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
1387 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
1388 ; SOFT-NEXT: .pad #4
1389 ; SOFT-NEXT: sub sp, #4
1390 ; SOFT-NEXT: mov r7, r1
1391 ; SOFT-NEXT: mov r4, r0
1392 ; SOFT-NEXT: movs r0, #7
1393 ; SOFT-NEXT: mvns r2, r0
1394 ; SOFT-NEXT: ldr r3, .LCPI16_0
1395 ; SOFT-NEXT: mov r0, r4
1396 ; SOFT-NEXT: bl __aeabi_dcmpgt
1397 ; SOFT-NEXT: str r0, [sp] @ 4-byte Spill
1398 ; SOFT-NEXT: movs r6, #0
1399 ; SOFT-NEXT: mov r0, r4
1400 ; SOFT-NEXT: mov r1, r7
1401 ; SOFT-NEXT: mov r2, r6
1402 ; SOFT-NEXT: mov r3, r6
1403 ; SOFT-NEXT: bl __aeabi_dcmpge
1404 ; SOFT-NEXT: mov r5, r0
1405 ; SOFT-NEXT: mov r0, r4
1406 ; SOFT-NEXT: mov r1, r7
1407 ; SOFT-NEXT: bl __aeabi_d2ulz
1408 ; SOFT-NEXT: cmp r5, #0
1409 ; SOFT-NEXT: bne .LBB16_2
1410 ; SOFT-NEXT: @ %bb.1:
1411 ; SOFT-NEXT: mov r0, r5
1412 ; SOFT-NEXT: .LBB16_2:
1413 ; SOFT-NEXT: ldr r2, [sp] @ 4-byte Reload
1414 ; SOFT-NEXT: cmp r2, #0
1415 ; SOFT-NEXT: bne .LBB16_6
1416 ; SOFT-NEXT: @ %bb.3:
1417 ; SOFT-NEXT: cmp r5, #0
1418 ; SOFT-NEXT: beq .LBB16_7
1419 ; SOFT-NEXT: .LBB16_4:
1420 ; SOFT-NEXT: cmp r2, #0
1421 ; SOFT-NEXT: bne .LBB16_8
1422 ; SOFT-NEXT: .LBB16_5:
1423 ; SOFT-NEXT: add sp, #4
1424 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
1425 ; SOFT-NEXT: .LBB16_6:
1426 ; SOFT-NEXT: mvns r0, r6
1427 ; SOFT-NEXT: cmp r5, #0
1428 ; SOFT-NEXT: bne .LBB16_4
1429 ; SOFT-NEXT: .LBB16_7:
1430 ; SOFT-NEXT: mov r1, r5
1431 ; SOFT-NEXT: cmp r2, #0
1432 ; SOFT-NEXT: beq .LBB16_5
1433 ; SOFT-NEXT: .LBB16_8:
1434 ; SOFT-NEXT: ldr r1, .LCPI16_1
1435 ; SOFT-NEXT: add sp, #4
1436 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
1437 ; SOFT-NEXT: .p2align 2
1438 ; SOFT-NEXT: @ %bb.9:
1439 ; SOFT-NEXT: .LCPI16_0:
1440 ; SOFT-NEXT: .long 1125122047 @ 0x430fffff
1441 ; SOFT-NEXT: .LCPI16_1:
1442 ; SOFT-NEXT: .long 262143 @ 0x3ffff
1444 ; VFP2-LABEL: test_signed_i50_f64:
1446 ; VFP2-NEXT: .save {r7, lr}
1447 ; VFP2-NEXT: push {r7, lr}
1448 ; VFP2-NEXT: .vsave {d8}
1449 ; VFP2-NEXT: vpush {d8}
1450 ; VFP2-NEXT: vmov d8, r0, r1
1451 ; VFP2-NEXT: bl __aeabi_d2ulz
1452 ; VFP2-NEXT: vcmp.f64 d8, #0
1453 ; VFP2-NEXT: vldr d16, .LCPI16_0
1454 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1456 ; VFP2-NEXT: movlt r0, #0
1457 ; VFP2-NEXT: movlt r1, #0
1458 ; VFP2-NEXT: vcmp.f64 d8, d16
1459 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1460 ; VFP2-NEXT: ittt gt
1461 ; VFP2-NEXT: movwgt r1, #65535
1462 ; VFP2-NEXT: movtgt r1, #3
1463 ; VFP2-NEXT: movgt.w r0, #-1
1464 ; VFP2-NEXT: vpop {d8}
1465 ; VFP2-NEXT: pop {r7, pc}
1466 ; VFP2-NEXT: .p2align 3
1467 ; VFP2-NEXT: @ %bb.1:
1468 ; VFP2-NEXT: .LCPI16_0:
1469 ; VFP2-NEXT: .long 4294967288 @ double 1125899906842623
1470 ; VFP2-NEXT: .long 1125122047
1472 ; FP16-LABEL: test_signed_i50_f64:
1474 ; FP16-NEXT: .save {r7, lr}
1475 ; FP16-NEXT: push {r7, lr}
1476 ; FP16-NEXT: vldr d0, .LCPI16_0
1477 ; FP16-NEXT: vmov d1, r0, r1
1478 ; FP16-NEXT: vldr d2, .LCPI16_1
1479 ; FP16-NEXT: vmaxnm.f64 d0, d1, d0
1480 ; FP16-NEXT: vminnm.f64 d0, d0, d2
1481 ; FP16-NEXT: vmov r0, r1, d0
1482 ; FP16-NEXT: bl __aeabi_d2ulz
1483 ; FP16-NEXT: pop {r7, pc}
1484 ; FP16-NEXT: .p2align 3
1485 ; FP16-NEXT: @ %bb.1:
1486 ; FP16-NEXT: .LCPI16_0:
1487 ; FP16-NEXT: .long 0 @ double 0
1488 ; FP16-NEXT: .long 0
1489 ; FP16-NEXT: .LCPI16_1:
1490 ; FP16-NEXT: .long 4294967288 @ double 1125899906842623
1491 ; FP16-NEXT: .long 1125122047
1492 %x = call i50 @llvm.fptoui.sat.i50.f64(double %f)
1496 define i64 @test_signed_i64_f64(double %f) nounwind {
1497 ; SOFT-LABEL: test_signed_i64_f64:
1499 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
1500 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
1501 ; SOFT-NEXT: .pad #4
1502 ; SOFT-NEXT: sub sp, #4
1503 ; SOFT-NEXT: mov r7, r1
1504 ; SOFT-NEXT: mov r5, r0
1505 ; SOFT-NEXT: movs r6, #0
1506 ; SOFT-NEXT: mvns r4, r6
1507 ; SOFT-NEXT: ldr r3, .LCPI17_0
1508 ; SOFT-NEXT: mov r2, r4
1509 ; SOFT-NEXT: bl __aeabi_dcmpgt
1510 ; SOFT-NEXT: str r0, [sp] @ 4-byte Spill
1511 ; SOFT-NEXT: mov r0, r5
1512 ; SOFT-NEXT: mov r1, r7
1513 ; SOFT-NEXT: mov r2, r6
1514 ; SOFT-NEXT: mov r3, r6
1515 ; SOFT-NEXT: bl __aeabi_dcmpge
1516 ; SOFT-NEXT: mov r6, r0
1517 ; SOFT-NEXT: mov r0, r5
1518 ; SOFT-NEXT: mov r1, r7
1519 ; SOFT-NEXT: bl __aeabi_d2ulz
1520 ; SOFT-NEXT: mov r2, r0
1521 ; SOFT-NEXT: cmp r6, #0
1522 ; SOFT-NEXT: bne .LBB17_2
1523 ; SOFT-NEXT: @ %bb.1:
1524 ; SOFT-NEXT: mov r2, r6
1525 ; SOFT-NEXT: .LBB17_2:
1526 ; SOFT-NEXT: ldr r3, [sp] @ 4-byte Reload
1527 ; SOFT-NEXT: cmp r3, #0
1528 ; SOFT-NEXT: mov r0, r4
1529 ; SOFT-NEXT: beq .LBB17_7
1530 ; SOFT-NEXT: @ %bb.3:
1531 ; SOFT-NEXT: cmp r6, #0
1532 ; SOFT-NEXT: beq .LBB17_8
1533 ; SOFT-NEXT: .LBB17_4:
1534 ; SOFT-NEXT: cmp r3, #0
1535 ; SOFT-NEXT: bne .LBB17_6
1536 ; SOFT-NEXT: .LBB17_5:
1537 ; SOFT-NEXT: mov r4, r1
1538 ; SOFT-NEXT: .LBB17_6:
1539 ; SOFT-NEXT: mov r1, r4
1540 ; SOFT-NEXT: add sp, #4
1541 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
1542 ; SOFT-NEXT: .LBB17_7:
1543 ; SOFT-NEXT: mov r0, r2
1544 ; SOFT-NEXT: cmp r6, #0
1545 ; SOFT-NEXT: bne .LBB17_4
1546 ; SOFT-NEXT: .LBB17_8:
1547 ; SOFT-NEXT: mov r1, r6
1548 ; SOFT-NEXT: cmp r3, #0
1549 ; SOFT-NEXT: beq .LBB17_5
1550 ; SOFT-NEXT: b .LBB17_6
1551 ; SOFT-NEXT: .p2align 2
1552 ; SOFT-NEXT: @ %bb.9:
1553 ; SOFT-NEXT: .LCPI17_0:
1554 ; SOFT-NEXT: .long 1139802111 @ 0x43efffff
1556 ; VFP2-LABEL: test_signed_i64_f64:
1558 ; VFP2-NEXT: .save {r7, lr}
1559 ; VFP2-NEXT: push {r7, lr}
1560 ; VFP2-NEXT: .vsave {d8}
1561 ; VFP2-NEXT: vpush {d8}
1562 ; VFP2-NEXT: vmov d8, r0, r1
1563 ; VFP2-NEXT: bl __aeabi_d2ulz
1564 ; VFP2-NEXT: vcmp.f64 d8, #0
1565 ; VFP2-NEXT: vldr d16, .LCPI17_0
1566 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1568 ; VFP2-NEXT: movlt r0, #0
1569 ; VFP2-NEXT: vcmp.f64 d8, d16
1570 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1572 ; VFP2-NEXT: movgt.w r0, #-1
1573 ; VFP2-NEXT: vcmp.f64 d8, #0
1574 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1576 ; VFP2-NEXT: movlt r1, #0
1577 ; VFP2-NEXT: vcmp.f64 d8, d16
1578 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1580 ; VFP2-NEXT: movgt.w r1, #-1
1581 ; VFP2-NEXT: vpop {d8}
1582 ; VFP2-NEXT: pop {r7, pc}
1583 ; VFP2-NEXT: .p2align 3
1584 ; VFP2-NEXT: @ %bb.1:
1585 ; VFP2-NEXT: .LCPI17_0:
1586 ; VFP2-NEXT: .long 4294967295 @ double 1.844674407370955E+19
1587 ; VFP2-NEXT: .long 1139802111
1589 ; FP16-LABEL: test_signed_i64_f64:
1591 ; FP16-NEXT: .save {r7, lr}
1592 ; FP16-NEXT: push {r7, lr}
1593 ; FP16-NEXT: .vsave {d8}
1594 ; FP16-NEXT: vpush {d8}
1595 ; FP16-NEXT: vmov d8, r0, r1
1596 ; FP16-NEXT: bl __aeabi_d2ulz
1597 ; FP16-NEXT: vcmp.f64 d8, #0
1598 ; FP16-NEXT: vldr d0, .LCPI17_0
1599 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
1601 ; FP16-NEXT: movlt r0, #0
1602 ; FP16-NEXT: vcmp.f64 d8, d0
1603 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
1605 ; FP16-NEXT: movgt.w r0, #-1
1606 ; FP16-NEXT: vcmp.f64 d8, #0
1607 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
1609 ; FP16-NEXT: movlt r1, #0
1610 ; FP16-NEXT: vcmp.f64 d8, d0
1611 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
1613 ; FP16-NEXT: movgt.w r1, #-1
1614 ; FP16-NEXT: vpop {d8}
1615 ; FP16-NEXT: pop {r7, pc}
1616 ; FP16-NEXT: .p2align 3
1617 ; FP16-NEXT: @ %bb.1:
1618 ; FP16-NEXT: .LCPI17_0:
1619 ; FP16-NEXT: .long 4294967295 @ double 1.844674407370955E+19
1620 ; FP16-NEXT: .long 1139802111
1621 %x = call i64 @llvm.fptoui.sat.i64.f64(double %f)
1625 define i100 @test_signed_i100_f64(double %f) nounwind {
1626 ; SOFT-LABEL: test_signed_i100_f64:
1628 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
1629 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
1630 ; SOFT-NEXT: .pad #4
1631 ; SOFT-NEXT: sub sp, #4
1632 ; SOFT-NEXT: mov r7, r1
1633 ; SOFT-NEXT: mov r4, r0
1634 ; SOFT-NEXT: movs r6, #0
1635 ; SOFT-NEXT: mvns r2, r6
1636 ; SOFT-NEXT: ldr r3, .LCPI18_0
1637 ; SOFT-NEXT: str r2, [sp] @ 4-byte Spill
1638 ; SOFT-NEXT: bl __aeabi_dcmpgt
1639 ; SOFT-NEXT: mov r5, r0
1640 ; SOFT-NEXT: mov r0, r4
1641 ; SOFT-NEXT: mov r1, r7
1642 ; SOFT-NEXT: mov r2, r6
1643 ; SOFT-NEXT: mov r3, r6
1644 ; SOFT-NEXT: bl __aeabi_dcmpge
1645 ; SOFT-NEXT: mov r6, r0
1646 ; SOFT-NEXT: mov r0, r4
1647 ; SOFT-NEXT: mov r1, r7
1648 ; SOFT-NEXT: bl __fixunsdfti
1649 ; SOFT-NEXT: mov r4, r0
1650 ; SOFT-NEXT: mov r7, r1
1651 ; SOFT-NEXT: cmp r6, #0
1652 ; SOFT-NEXT: bne .LBB18_2
1653 ; SOFT-NEXT: @ %bb.1:
1654 ; SOFT-NEXT: mov r4, r6
1655 ; SOFT-NEXT: .LBB18_2:
1656 ; SOFT-NEXT: cmp r5, #0
1657 ; SOFT-NEXT: ldr r0, [sp] @ 4-byte Reload
1658 ; SOFT-NEXT: bne .LBB18_4
1659 ; SOFT-NEXT: @ %bb.3:
1660 ; SOFT-NEXT: mov r0, r4
1661 ; SOFT-NEXT: .LBB18_4:
1662 ; SOFT-NEXT: cmp r6, #0
1663 ; SOFT-NEXT: bne .LBB18_6
1664 ; SOFT-NEXT: @ %bb.5:
1665 ; SOFT-NEXT: mov r7, r6
1666 ; SOFT-NEXT: .LBB18_6:
1667 ; SOFT-NEXT: cmp r5, #0
1668 ; SOFT-NEXT: ldr r4, [sp] @ 4-byte Reload
1669 ; SOFT-NEXT: mov r1, r4
1670 ; SOFT-NEXT: beq .LBB18_13
1671 ; SOFT-NEXT: @ %bb.7:
1672 ; SOFT-NEXT: cmp r6, #0
1673 ; SOFT-NEXT: beq .LBB18_14
1674 ; SOFT-NEXT: .LBB18_8:
1675 ; SOFT-NEXT: cmp r5, #0
1676 ; SOFT-NEXT: beq .LBB18_15
1677 ; SOFT-NEXT: .LBB18_9:
1678 ; SOFT-NEXT: cmp r6, #0
1679 ; SOFT-NEXT: beq .LBB18_16
1680 ; SOFT-NEXT: .LBB18_10:
1681 ; SOFT-NEXT: cmp r5, #0
1682 ; SOFT-NEXT: beq .LBB18_12
1683 ; SOFT-NEXT: .LBB18_11:
1684 ; SOFT-NEXT: movs r3, #15
1685 ; SOFT-NEXT: .LBB18_12:
1686 ; SOFT-NEXT: mov r2, r4
1687 ; SOFT-NEXT: add sp, #4
1688 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
1689 ; SOFT-NEXT: .LBB18_13:
1690 ; SOFT-NEXT: mov r1, r7
1691 ; SOFT-NEXT: cmp r6, #0
1692 ; SOFT-NEXT: bne .LBB18_8
1693 ; SOFT-NEXT: .LBB18_14:
1694 ; SOFT-NEXT: mov r2, r6
1695 ; SOFT-NEXT: cmp r5, #0
1696 ; SOFT-NEXT: bne .LBB18_9
1697 ; SOFT-NEXT: .LBB18_15:
1698 ; SOFT-NEXT: mov r4, r2
1699 ; SOFT-NEXT: cmp r6, #0
1700 ; SOFT-NEXT: bne .LBB18_10
1701 ; SOFT-NEXT: .LBB18_16:
1702 ; SOFT-NEXT: mov r3, r6
1703 ; SOFT-NEXT: cmp r5, #0
1704 ; SOFT-NEXT: bne .LBB18_11
1705 ; SOFT-NEXT: b .LBB18_12
1706 ; SOFT-NEXT: .p2align 2
1707 ; SOFT-NEXT: @ %bb.17:
1708 ; SOFT-NEXT: .LCPI18_0:
1709 ; SOFT-NEXT: .long 1177550847 @ 0x462fffff
1711 ; VFP2-LABEL: test_signed_i100_f64:
1713 ; VFP2-NEXT: .save {r7, lr}
1714 ; VFP2-NEXT: push {r7, lr}
1715 ; VFP2-NEXT: .vsave {d8}
1716 ; VFP2-NEXT: vpush {d8}
1717 ; VFP2-NEXT: vmov d8, r0, r1
1718 ; VFP2-NEXT: bl __fixunsdfti
1719 ; VFP2-NEXT: vcmp.f64 d8, #0
1720 ; VFP2-NEXT: vldr d16, .LCPI18_0
1721 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1723 ; VFP2-NEXT: movlt r0, #0
1724 ; VFP2-NEXT: vcmp.f64 d8, d16
1725 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1727 ; VFP2-NEXT: movgt.w r0, #-1
1728 ; VFP2-NEXT: vcmp.f64 d8, #0
1729 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1731 ; VFP2-NEXT: movlt r1, #0
1732 ; VFP2-NEXT: vcmp.f64 d8, d16
1733 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1735 ; VFP2-NEXT: movgt.w r1, #-1
1736 ; VFP2-NEXT: vcmp.f64 d8, #0
1737 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1739 ; VFP2-NEXT: movlt r2, #0
1740 ; VFP2-NEXT: vcmp.f64 d8, d16
1741 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1743 ; VFP2-NEXT: movgt.w r2, #-1
1744 ; VFP2-NEXT: vcmp.f64 d8, #0
1745 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1747 ; VFP2-NEXT: movlt r3, #0
1748 ; VFP2-NEXT: vcmp.f64 d8, d16
1749 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1751 ; VFP2-NEXT: movgt r3, #15
1752 ; VFP2-NEXT: vpop {d8}
1753 ; VFP2-NEXT: pop {r7, pc}
1754 ; VFP2-NEXT: .p2align 3
1755 ; VFP2-NEXT: @ %bb.1:
1756 ; VFP2-NEXT: .LCPI18_0:
1757 ; VFP2-NEXT: .long 4294967295 @ double 1.2676506002282293E+30
1758 ; VFP2-NEXT: .long 1177550847
1760 ; FP16-LABEL: test_signed_i100_f64:
1762 ; FP16-NEXT: .save {r7, lr}
1763 ; FP16-NEXT: push {r7, lr}
1764 ; FP16-NEXT: .vsave {d8}
1765 ; FP16-NEXT: vpush {d8}
1766 ; FP16-NEXT: vmov d8, r0, r1
1767 ; FP16-NEXT: bl __fixunsdfti
1768 ; FP16-NEXT: vcmp.f64 d8, #0
1769 ; FP16-NEXT: vldr d0, .LCPI18_0
1770 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
1772 ; FP16-NEXT: movlt r0, #0
1773 ; FP16-NEXT: vcmp.f64 d8, d0
1774 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
1776 ; FP16-NEXT: movgt.w r0, #-1
1777 ; FP16-NEXT: vcmp.f64 d8, #0
1778 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
1780 ; FP16-NEXT: movlt r1, #0
1781 ; FP16-NEXT: vcmp.f64 d8, d0
1782 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
1784 ; FP16-NEXT: movgt.w r1, #-1
1785 ; FP16-NEXT: vcmp.f64 d8, #0
1786 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
1788 ; FP16-NEXT: movlt r2, #0
1789 ; FP16-NEXT: vcmp.f64 d8, d0
1790 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
1792 ; FP16-NEXT: movgt.w r2, #-1
1793 ; FP16-NEXT: vcmp.f64 d8, #0
1794 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
1796 ; FP16-NEXT: movlt r3, #0
1797 ; FP16-NEXT: vcmp.f64 d8, d0
1798 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
1800 ; FP16-NEXT: movgt r3, #15
1801 ; FP16-NEXT: vpop {d8}
1802 ; FP16-NEXT: pop {r7, pc}
1803 ; FP16-NEXT: .p2align 3
1804 ; FP16-NEXT: @ %bb.1:
1805 ; FP16-NEXT: .LCPI18_0:
1806 ; FP16-NEXT: .long 4294967295 @ double 1.2676506002282293E+30
1807 ; FP16-NEXT: .long 1177550847
1808 %x = call i100 @llvm.fptoui.sat.i100.f64(double %f)
1812 define i128 @test_signed_i128_f64(double %f) nounwind {
1813 ; SOFT-LABEL: test_signed_i128_f64:
1815 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
1816 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
1817 ; SOFT-NEXT: .pad #4
1818 ; SOFT-NEXT: sub sp, #4
1819 ; SOFT-NEXT: mov r7, r1
1820 ; SOFT-NEXT: mov r5, r0
1821 ; SOFT-NEXT: movs r6, #0
1822 ; SOFT-NEXT: mvns r4, r6
1823 ; SOFT-NEXT: ldr r3, .LCPI19_0
1824 ; SOFT-NEXT: mov r2, r4
1825 ; SOFT-NEXT: bl __aeabi_dcmpgt
1826 ; SOFT-NEXT: str r0, [sp] @ 4-byte Spill
1827 ; SOFT-NEXT: mov r0, r5
1828 ; SOFT-NEXT: mov r1, r7
1829 ; SOFT-NEXT: mov r2, r6
1830 ; SOFT-NEXT: mov r3, r6
1831 ; SOFT-NEXT: bl __aeabi_dcmpge
1832 ; SOFT-NEXT: mov r6, r0
1833 ; SOFT-NEXT: mov r0, r5
1834 ; SOFT-NEXT: mov r1, r7
1835 ; SOFT-NEXT: bl __fixunsdfti
1836 ; SOFT-NEXT: mov r5, r0
1837 ; SOFT-NEXT: mov r7, r1
1838 ; SOFT-NEXT: cmp r6, #0
1839 ; SOFT-NEXT: bne .LBB19_2
1840 ; SOFT-NEXT: @ %bb.1:
1841 ; SOFT-NEXT: mov r5, r6
1842 ; SOFT-NEXT: .LBB19_2:
1843 ; SOFT-NEXT: ldr r0, [sp] @ 4-byte Reload
1844 ; SOFT-NEXT: cmp r0, #0
1845 ; SOFT-NEXT: mov r0, r4
1846 ; SOFT-NEXT: bne .LBB19_4
1847 ; SOFT-NEXT: @ %bb.3:
1848 ; SOFT-NEXT: mov r0, r5
1849 ; SOFT-NEXT: .LBB19_4:
1850 ; SOFT-NEXT: cmp r6, #0
1851 ; SOFT-NEXT: bne .LBB19_6
1852 ; SOFT-NEXT: @ %bb.5:
1853 ; SOFT-NEXT: mov r7, r6
1854 ; SOFT-NEXT: .LBB19_6:
1855 ; SOFT-NEXT: ldr r1, [sp] @ 4-byte Reload
1856 ; SOFT-NEXT: cmp r1, #0
1857 ; SOFT-NEXT: mov r1, r4
1858 ; SOFT-NEXT: bne .LBB19_8
1859 ; SOFT-NEXT: @ %bb.7:
1860 ; SOFT-NEXT: mov r1, r7
1861 ; SOFT-NEXT: .LBB19_8:
1862 ; SOFT-NEXT: cmp r6, #0
1863 ; SOFT-NEXT: bne .LBB19_10
1864 ; SOFT-NEXT: @ %bb.9:
1865 ; SOFT-NEXT: mov r2, r6
1866 ; SOFT-NEXT: .LBB19_10:
1867 ; SOFT-NEXT: ldr r5, [sp] @ 4-byte Reload
1868 ; SOFT-NEXT: cmp r5, #0
1869 ; SOFT-NEXT: mov r5, r4
1870 ; SOFT-NEXT: bne .LBB19_12
1871 ; SOFT-NEXT: @ %bb.11:
1872 ; SOFT-NEXT: mov r5, r2
1873 ; SOFT-NEXT: .LBB19_12:
1874 ; SOFT-NEXT: cmp r6, #0
1875 ; SOFT-NEXT: bne .LBB19_14
1876 ; SOFT-NEXT: @ %bb.13:
1877 ; SOFT-NEXT: mov r3, r6
1878 ; SOFT-NEXT: .LBB19_14:
1879 ; SOFT-NEXT: ldr r2, [sp] @ 4-byte Reload
1880 ; SOFT-NEXT: cmp r2, #0
1881 ; SOFT-NEXT: bne .LBB19_16
1882 ; SOFT-NEXT: @ %bb.15:
1883 ; SOFT-NEXT: mov r4, r3
1884 ; SOFT-NEXT: .LBB19_16:
1885 ; SOFT-NEXT: mov r2, r5
1886 ; SOFT-NEXT: mov r3, r4
1887 ; SOFT-NEXT: add sp, #4
1888 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
1889 ; SOFT-NEXT: .p2align 2
1890 ; SOFT-NEXT: @ %bb.17:
1891 ; SOFT-NEXT: .LCPI19_0:
1892 ; SOFT-NEXT: .long 1206910975 @ 0x47efffff
1894 ; VFP2-LABEL: test_signed_i128_f64:
1896 ; VFP2-NEXT: .save {r7, lr}
1897 ; VFP2-NEXT: push {r7, lr}
1898 ; VFP2-NEXT: .vsave {d8}
1899 ; VFP2-NEXT: vpush {d8}
1900 ; VFP2-NEXT: vmov d8, r0, r1
1901 ; VFP2-NEXT: bl __fixunsdfti
1902 ; VFP2-NEXT: vcmp.f64 d8, #0
1903 ; VFP2-NEXT: vldr d16, .LCPI19_0
1904 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1906 ; VFP2-NEXT: movlt r0, #0
1907 ; VFP2-NEXT: vcmp.f64 d8, d16
1908 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1910 ; VFP2-NEXT: movgt.w r0, #-1
1911 ; VFP2-NEXT: vcmp.f64 d8, #0
1912 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1914 ; VFP2-NEXT: movlt r1, #0
1915 ; VFP2-NEXT: vcmp.f64 d8, d16
1916 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1918 ; VFP2-NEXT: movgt.w r1, #-1
1919 ; VFP2-NEXT: vcmp.f64 d8, #0
1920 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1922 ; VFP2-NEXT: movlt r2, #0
1923 ; VFP2-NEXT: vcmp.f64 d8, d16
1924 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1926 ; VFP2-NEXT: movgt.w r2, #-1
1927 ; VFP2-NEXT: vcmp.f64 d8, #0
1928 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1930 ; VFP2-NEXT: movlt r3, #0
1931 ; VFP2-NEXT: vcmp.f64 d8, d16
1932 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1934 ; VFP2-NEXT: movgt.w r3, #-1
1935 ; VFP2-NEXT: vpop {d8}
1936 ; VFP2-NEXT: pop {r7, pc}
1937 ; VFP2-NEXT: .p2align 3
1938 ; VFP2-NEXT: @ %bb.1:
1939 ; VFP2-NEXT: .LCPI19_0:
1940 ; VFP2-NEXT: .long 4294967295 @ double 3.4028236692093843E+38
1941 ; VFP2-NEXT: .long 1206910975
1943 ; FP16-LABEL: test_signed_i128_f64:
1945 ; FP16-NEXT: .save {r7, lr}
1946 ; FP16-NEXT: push {r7, lr}
1947 ; FP16-NEXT: .vsave {d8}
1948 ; FP16-NEXT: vpush {d8}
1949 ; FP16-NEXT: vmov d8, r0, r1
1950 ; FP16-NEXT: bl __fixunsdfti
1951 ; FP16-NEXT: vcmp.f64 d8, #0
1952 ; FP16-NEXT: vldr d0, .LCPI19_0
1953 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
1955 ; FP16-NEXT: movlt r0, #0
1956 ; FP16-NEXT: vcmp.f64 d8, d0
1957 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
1959 ; FP16-NEXT: movgt.w r0, #-1
1960 ; FP16-NEXT: vcmp.f64 d8, #0
1961 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
1963 ; FP16-NEXT: movlt r1, #0
1964 ; FP16-NEXT: vcmp.f64 d8, d0
1965 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
1967 ; FP16-NEXT: movgt.w r1, #-1
1968 ; FP16-NEXT: vcmp.f64 d8, #0
1969 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
1971 ; FP16-NEXT: movlt r2, #0
1972 ; FP16-NEXT: vcmp.f64 d8, d0
1973 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
1975 ; FP16-NEXT: movgt.w r2, #-1
1976 ; FP16-NEXT: vcmp.f64 d8, #0
1977 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
1979 ; FP16-NEXT: movlt r3, #0
1980 ; FP16-NEXT: vcmp.f64 d8, d0
1981 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
1983 ; FP16-NEXT: movgt.w r3, #-1
1984 ; FP16-NEXT: vpop {d8}
1985 ; FP16-NEXT: pop {r7, pc}
1986 ; FP16-NEXT: .p2align 3
1987 ; FP16-NEXT: @ %bb.1:
1988 ; FP16-NEXT: .LCPI19_0:
1989 ; FP16-NEXT: .long 4294967295 @ double 3.4028236692093843E+38
1990 ; FP16-NEXT: .long 1206910975
1991 %x = call i128 @llvm.fptoui.sat.i128.f64(double %f)
1996 ; 16-bit float to signed integer
1999 declare i1 @llvm.fptoui.sat.i1.f16 (half)
2000 declare i8 @llvm.fptoui.sat.i8.f16 (half)
2001 declare i13 @llvm.fptoui.sat.i13.f16 (half)
2002 declare i16 @llvm.fptoui.sat.i16.f16 (half)
2003 declare i19 @llvm.fptoui.sat.i19.f16 (half)
2004 declare i32 @llvm.fptoui.sat.i32.f16 (half)
2005 declare i50 @llvm.fptoui.sat.i50.f16 (half)
2006 declare i64 @llvm.fptoui.sat.i64.f16 (half)
2007 declare i100 @llvm.fptoui.sat.i100.f16(half)
2008 declare i128 @llvm.fptoui.sat.i128.f16(half)
2010 define i1 @test_signed_i1_f16(half %f) nounwind {
2011 ; SOFT-LABEL: test_signed_i1_f16:
2013 ; SOFT-NEXT: .save {r4, r5, r6, lr}
2014 ; SOFT-NEXT: push {r4, r5, r6, lr}
2015 ; SOFT-NEXT: uxth r0, r0
2016 ; SOFT-NEXT: bl __aeabi_h2f
2017 ; SOFT-NEXT: mov r5, r0
2018 ; SOFT-NEXT: movs r0, #127
2019 ; SOFT-NEXT: lsls r1, r0, #23
2020 ; SOFT-NEXT: mov r0, r5
2021 ; SOFT-NEXT: bl __aeabi_fcmpgt
2022 ; SOFT-NEXT: mov r4, r0
2023 ; SOFT-NEXT: movs r1, #0
2024 ; SOFT-NEXT: mov r0, r5
2025 ; SOFT-NEXT: bl __aeabi_fcmpge
2026 ; SOFT-NEXT: mov r6, r0
2027 ; SOFT-NEXT: mov r0, r5
2028 ; SOFT-NEXT: bl __aeabi_f2uiz
2029 ; SOFT-NEXT: cmp r6, #0
2030 ; SOFT-NEXT: beq .LBB20_3
2031 ; SOFT-NEXT: @ %bb.1:
2032 ; SOFT-NEXT: cmp r4, #0
2033 ; SOFT-NEXT: bne .LBB20_4
2034 ; SOFT-NEXT: .LBB20_2:
2035 ; SOFT-NEXT: pop {r4, r5, r6, pc}
2036 ; SOFT-NEXT: .LBB20_3:
2037 ; SOFT-NEXT: mov r0, r6
2038 ; SOFT-NEXT: cmp r4, #0
2039 ; SOFT-NEXT: beq .LBB20_2
2040 ; SOFT-NEXT: .LBB20_4:
2041 ; SOFT-NEXT: movs r0, #1
2042 ; SOFT-NEXT: pop {r4, r5, r6, pc}
2044 ; VFP2-LABEL: test_signed_i1_f16:
2046 ; VFP2-NEXT: .save {r7, lr}
2047 ; VFP2-NEXT: push {r7, lr}
2048 ; VFP2-NEXT: bl __aeabi_h2f
2049 ; VFP2-NEXT: vmov s2, r0
2050 ; VFP2-NEXT: vmov.f32 s0, #1.000000e+00
2051 ; VFP2-NEXT: vcvt.u32.f32 s4, s2
2052 ; VFP2-NEXT: vcmp.f32 s2, #0
2053 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2054 ; VFP2-NEXT: vcmp.f32 s2, s0
2055 ; VFP2-NEXT: vmov r0, s4
2057 ; VFP2-NEXT: movlt r0, #0
2058 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2060 ; VFP2-NEXT: movgt r0, #1
2061 ; VFP2-NEXT: pop {r7, pc}
2063 ; FP16-LABEL: test_signed_i1_f16:
2065 ; FP16-NEXT: vmov.f16 s0, r0
2066 ; FP16-NEXT: vldr s4, .LCPI20_0
2067 ; FP16-NEXT: vcvtb.f32.f16 s0, s0
2068 ; FP16-NEXT: vmov.f32 s2, #1.000000e+00
2069 ; FP16-NEXT: vmaxnm.f32 s0, s0, s4
2070 ; FP16-NEXT: vminnm.f32 s0, s0, s2
2071 ; FP16-NEXT: vcvt.u32.f32 s0, s0
2072 ; FP16-NEXT: vmov r0, s0
2074 ; FP16-NEXT: .p2align 2
2075 ; FP16-NEXT: @ %bb.1:
2076 ; FP16-NEXT: .LCPI20_0:
2077 ; FP16-NEXT: .long 0x00000000 @ float 0
2078 %x = call i1 @llvm.fptoui.sat.i1.f16(half %f)
2082 define i8 @test_signed_i8_f16(half %f) nounwind {
2083 ; SOFT-LABEL: test_signed_i8_f16:
2085 ; SOFT-NEXT: .save {r4, r5, r6, lr}
2086 ; SOFT-NEXT: push {r4, r5, r6, lr}
2087 ; SOFT-NEXT: uxth r0, r0
2088 ; SOFT-NEXT: bl __aeabi_h2f
2089 ; SOFT-NEXT: mov r6, r0
2090 ; SOFT-NEXT: ldr r1, .LCPI21_0
2091 ; SOFT-NEXT: bl __aeabi_fcmpgt
2092 ; SOFT-NEXT: mov r4, r0
2093 ; SOFT-NEXT: movs r1, #0
2094 ; SOFT-NEXT: mov r0, r6
2095 ; SOFT-NEXT: bl __aeabi_fcmpge
2096 ; SOFT-NEXT: mov r5, r0
2097 ; SOFT-NEXT: mov r0, r6
2098 ; SOFT-NEXT: bl __aeabi_f2uiz
2099 ; SOFT-NEXT: cmp r5, #0
2100 ; SOFT-NEXT: beq .LBB21_3
2101 ; SOFT-NEXT: @ %bb.1:
2102 ; SOFT-NEXT: cmp r4, #0
2103 ; SOFT-NEXT: bne .LBB21_4
2104 ; SOFT-NEXT: .LBB21_2:
2105 ; SOFT-NEXT: pop {r4, r5, r6, pc}
2106 ; SOFT-NEXT: .LBB21_3:
2107 ; SOFT-NEXT: mov r0, r5
2108 ; SOFT-NEXT: cmp r4, #0
2109 ; SOFT-NEXT: beq .LBB21_2
2110 ; SOFT-NEXT: .LBB21_4:
2111 ; SOFT-NEXT: movs r0, #255
2112 ; SOFT-NEXT: pop {r4, r5, r6, pc}
2113 ; SOFT-NEXT: .p2align 2
2114 ; SOFT-NEXT: @ %bb.5:
2115 ; SOFT-NEXT: .LCPI21_0:
2116 ; SOFT-NEXT: .long 1132396544 @ 0x437f0000
2118 ; VFP2-LABEL: test_signed_i8_f16:
2120 ; VFP2-NEXT: .save {r7, lr}
2121 ; VFP2-NEXT: push {r7, lr}
2122 ; VFP2-NEXT: bl __aeabi_h2f
2123 ; VFP2-NEXT: vmov s0, r0
2124 ; VFP2-NEXT: vldr s4, .LCPI21_0
2125 ; VFP2-NEXT: vcvt.u32.f32 s2, s0
2126 ; VFP2-NEXT: vcmp.f32 s0, #0
2127 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2128 ; VFP2-NEXT: vcmp.f32 s0, s4
2129 ; VFP2-NEXT: vmov r0, s2
2131 ; VFP2-NEXT: movlt r0, #0
2132 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2134 ; VFP2-NEXT: movgt r0, #255
2135 ; VFP2-NEXT: pop {r7, pc}
2136 ; VFP2-NEXT: .p2align 2
2137 ; VFP2-NEXT: @ %bb.1:
2138 ; VFP2-NEXT: .LCPI21_0:
2139 ; VFP2-NEXT: .long 0x437f0000 @ float 255
2141 ; FP16-LABEL: test_signed_i8_f16:
2143 ; FP16-NEXT: vmov.f16 s0, r0
2144 ; FP16-NEXT: vldr s4, .LCPI21_1
2145 ; FP16-NEXT: vcvtb.f32.f16 s0, s0
2146 ; FP16-NEXT: vldr s2, .LCPI21_0
2147 ; FP16-NEXT: vmaxnm.f32 s0, s0, s4
2148 ; FP16-NEXT: vminnm.f32 s0, s0, s2
2149 ; FP16-NEXT: vcvt.u32.f32 s0, s0
2150 ; FP16-NEXT: vmov r0, s0
2152 ; FP16-NEXT: .p2align 2
2153 ; FP16-NEXT: @ %bb.1:
2154 ; FP16-NEXT: .LCPI21_0:
2155 ; FP16-NEXT: .long 0x437f0000 @ float 255
2156 ; FP16-NEXT: .LCPI21_1:
2157 ; FP16-NEXT: .long 0x00000000 @ float 0
2158 %x = call i8 @llvm.fptoui.sat.i8.f16(half %f)
2162 define i13 @test_signed_i13_f16(half %f) nounwind {
2163 ; SOFT-LABEL: test_signed_i13_f16:
2165 ; SOFT-NEXT: .save {r4, r5, r6, lr}
2166 ; SOFT-NEXT: push {r4, r5, r6, lr}
2167 ; SOFT-NEXT: uxth r0, r0
2168 ; SOFT-NEXT: bl __aeabi_h2f
2169 ; SOFT-NEXT: mov r6, r0
2170 ; SOFT-NEXT: ldr r1, .LCPI22_0
2171 ; SOFT-NEXT: bl __aeabi_fcmpgt
2172 ; SOFT-NEXT: mov r4, r0
2173 ; SOFT-NEXT: movs r1, #0
2174 ; SOFT-NEXT: mov r0, r6
2175 ; SOFT-NEXT: bl __aeabi_fcmpge
2176 ; SOFT-NEXT: mov r5, r0
2177 ; SOFT-NEXT: mov r0, r6
2178 ; SOFT-NEXT: bl __aeabi_f2uiz
2179 ; SOFT-NEXT: cmp r5, #0
2180 ; SOFT-NEXT: beq .LBB22_3
2181 ; SOFT-NEXT: @ %bb.1:
2182 ; SOFT-NEXT: cmp r4, #0
2183 ; SOFT-NEXT: bne .LBB22_4
2184 ; SOFT-NEXT: .LBB22_2:
2185 ; SOFT-NEXT: pop {r4, r5, r6, pc}
2186 ; SOFT-NEXT: .LBB22_3:
2187 ; SOFT-NEXT: mov r0, r5
2188 ; SOFT-NEXT: cmp r4, #0
2189 ; SOFT-NEXT: beq .LBB22_2
2190 ; SOFT-NEXT: .LBB22_4:
2191 ; SOFT-NEXT: ldr r0, .LCPI22_1
2192 ; SOFT-NEXT: pop {r4, r5, r6, pc}
2193 ; SOFT-NEXT: .p2align 2
2194 ; SOFT-NEXT: @ %bb.5:
2195 ; SOFT-NEXT: .LCPI22_0:
2196 ; SOFT-NEXT: .long 1174403072 @ 0x45fff800
2197 ; SOFT-NEXT: .LCPI22_1:
2198 ; SOFT-NEXT: .long 8191 @ 0x1fff
2200 ; VFP2-LABEL: test_signed_i13_f16:
2202 ; VFP2-NEXT: .save {r7, lr}
2203 ; VFP2-NEXT: push {r7, lr}
2204 ; VFP2-NEXT: bl __aeabi_h2f
2205 ; VFP2-NEXT: vmov s0, r0
2206 ; VFP2-NEXT: vldr s4, .LCPI22_0
2207 ; VFP2-NEXT: vcvt.u32.f32 s2, s0
2208 ; VFP2-NEXT: vcmp.f32 s0, #0
2209 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2210 ; VFP2-NEXT: vcmp.f32 s0, s4
2211 ; VFP2-NEXT: vmov r0, s2
2213 ; VFP2-NEXT: movlt r0, #0
2214 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2216 ; VFP2-NEXT: movwgt r0, #8191
2217 ; VFP2-NEXT: pop {r7, pc}
2218 ; VFP2-NEXT: .p2align 2
2219 ; VFP2-NEXT: @ %bb.1:
2220 ; VFP2-NEXT: .LCPI22_0:
2221 ; VFP2-NEXT: .long 0x45fff800 @ float 8191
2223 ; FP16-LABEL: test_signed_i13_f16:
2225 ; FP16-NEXT: vmov.f16 s0, r0
2226 ; FP16-NEXT: vldr s4, .LCPI22_1
2227 ; FP16-NEXT: vcvtb.f32.f16 s0, s0
2228 ; FP16-NEXT: vldr s2, .LCPI22_0
2229 ; FP16-NEXT: vmaxnm.f32 s0, s0, s4
2230 ; FP16-NEXT: vminnm.f32 s0, s0, s2
2231 ; FP16-NEXT: vcvt.u32.f32 s0, s0
2232 ; FP16-NEXT: vmov r0, s0
2234 ; FP16-NEXT: .p2align 2
2235 ; FP16-NEXT: @ %bb.1:
2236 ; FP16-NEXT: .LCPI22_0:
2237 ; FP16-NEXT: .long 0x45fff800 @ float 8191
2238 ; FP16-NEXT: .LCPI22_1:
2239 ; FP16-NEXT: .long 0x00000000 @ float 0
2240 %x = call i13 @llvm.fptoui.sat.i13.f16(half %f)
2244 define i16 @test_signed_i16_f16(half %f) nounwind {
2245 ; SOFT-LABEL: test_signed_i16_f16:
2247 ; SOFT-NEXT: .save {r4, r5, r6, lr}
2248 ; SOFT-NEXT: push {r4, r5, r6, lr}
2249 ; SOFT-NEXT: uxth r0, r0
2250 ; SOFT-NEXT: bl __aeabi_h2f
2251 ; SOFT-NEXT: mov r6, r0
2252 ; SOFT-NEXT: ldr r1, .LCPI23_0
2253 ; SOFT-NEXT: bl __aeabi_fcmpgt
2254 ; SOFT-NEXT: mov r4, r0
2255 ; SOFT-NEXT: movs r1, #0
2256 ; SOFT-NEXT: mov r0, r6
2257 ; SOFT-NEXT: bl __aeabi_fcmpge
2258 ; SOFT-NEXT: mov r5, r0
2259 ; SOFT-NEXT: mov r0, r6
2260 ; SOFT-NEXT: bl __aeabi_f2uiz
2261 ; SOFT-NEXT: cmp r5, #0
2262 ; SOFT-NEXT: beq .LBB23_3
2263 ; SOFT-NEXT: @ %bb.1:
2264 ; SOFT-NEXT: cmp r4, #0
2265 ; SOFT-NEXT: bne .LBB23_4
2266 ; SOFT-NEXT: .LBB23_2:
2267 ; SOFT-NEXT: pop {r4, r5, r6, pc}
2268 ; SOFT-NEXT: .LBB23_3:
2269 ; SOFT-NEXT: mov r0, r5
2270 ; SOFT-NEXT: cmp r4, #0
2271 ; SOFT-NEXT: beq .LBB23_2
2272 ; SOFT-NEXT: .LBB23_4:
2273 ; SOFT-NEXT: ldr r0, .LCPI23_1
2274 ; SOFT-NEXT: pop {r4, r5, r6, pc}
2275 ; SOFT-NEXT: .p2align 2
2276 ; SOFT-NEXT: @ %bb.5:
2277 ; SOFT-NEXT: .LCPI23_0:
2278 ; SOFT-NEXT: .long 1199570688 @ 0x477fff00
2279 ; SOFT-NEXT: .LCPI23_1:
2280 ; SOFT-NEXT: .long 65535 @ 0xffff
2282 ; VFP2-LABEL: test_signed_i16_f16:
2284 ; VFP2-NEXT: .save {r7, lr}
2285 ; VFP2-NEXT: push {r7, lr}
2286 ; VFP2-NEXT: bl __aeabi_h2f
2287 ; VFP2-NEXT: vmov s0, r0
2288 ; VFP2-NEXT: vldr s4, .LCPI23_0
2289 ; VFP2-NEXT: vcvt.u32.f32 s2, s0
2290 ; VFP2-NEXT: vcmp.f32 s0, #0
2291 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2292 ; VFP2-NEXT: vcmp.f32 s0, s4
2293 ; VFP2-NEXT: vmov r0, s2
2295 ; VFP2-NEXT: movlt r0, #0
2296 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2298 ; VFP2-NEXT: movwgt r0, #65535
2299 ; VFP2-NEXT: pop {r7, pc}
2300 ; VFP2-NEXT: .p2align 2
2301 ; VFP2-NEXT: @ %bb.1:
2302 ; VFP2-NEXT: .LCPI23_0:
2303 ; VFP2-NEXT: .long 0x477fff00 @ float 65535
2305 ; FP16-LABEL: test_signed_i16_f16:
2307 ; FP16-NEXT: vmov.f16 s0, r0
2308 ; FP16-NEXT: vldr s4, .LCPI23_1
2309 ; FP16-NEXT: vcvtb.f32.f16 s0, s0
2310 ; FP16-NEXT: vldr s2, .LCPI23_0
2311 ; FP16-NEXT: vmaxnm.f32 s0, s0, s4
2312 ; FP16-NEXT: vminnm.f32 s0, s0, s2
2313 ; FP16-NEXT: vcvt.u32.f32 s0, s0
2314 ; FP16-NEXT: vmov r0, s0
2316 ; FP16-NEXT: .p2align 2
2317 ; FP16-NEXT: @ %bb.1:
2318 ; FP16-NEXT: .LCPI23_0:
2319 ; FP16-NEXT: .long 0x477fff00 @ float 65535
2320 ; FP16-NEXT: .LCPI23_1:
2321 ; FP16-NEXT: .long 0x00000000 @ float 0
2322 %x = call i16 @llvm.fptoui.sat.i16.f16(half %f)
2326 define i19 @test_signed_i19_f16(half %f) nounwind {
2327 ; SOFT-LABEL: test_signed_i19_f16:
2329 ; SOFT-NEXT: .save {r4, r5, r6, lr}
2330 ; SOFT-NEXT: push {r4, r5, r6, lr}
2331 ; SOFT-NEXT: uxth r0, r0
2332 ; SOFT-NEXT: bl __aeabi_h2f
2333 ; SOFT-NEXT: mov r6, r0
2334 ; SOFT-NEXT: ldr r1, .LCPI24_0
2335 ; SOFT-NEXT: bl __aeabi_fcmpgt
2336 ; SOFT-NEXT: mov r4, r0
2337 ; SOFT-NEXT: movs r1, #0
2338 ; SOFT-NEXT: mov r0, r6
2339 ; SOFT-NEXT: bl __aeabi_fcmpge
2340 ; SOFT-NEXT: mov r5, r0
2341 ; SOFT-NEXT: mov r0, r6
2342 ; SOFT-NEXT: bl __aeabi_f2uiz
2343 ; SOFT-NEXT: cmp r5, #0
2344 ; SOFT-NEXT: beq .LBB24_3
2345 ; SOFT-NEXT: @ %bb.1:
2346 ; SOFT-NEXT: cmp r4, #0
2347 ; SOFT-NEXT: bne .LBB24_4
2348 ; SOFT-NEXT: .LBB24_2:
2349 ; SOFT-NEXT: pop {r4, r5, r6, pc}
2350 ; SOFT-NEXT: .LBB24_3:
2351 ; SOFT-NEXT: mov r0, r5
2352 ; SOFT-NEXT: cmp r4, #0
2353 ; SOFT-NEXT: beq .LBB24_2
2354 ; SOFT-NEXT: .LBB24_4:
2355 ; SOFT-NEXT: ldr r0, .LCPI24_1
2356 ; SOFT-NEXT: pop {r4, r5, r6, pc}
2357 ; SOFT-NEXT: .p2align 2
2358 ; SOFT-NEXT: @ %bb.5:
2359 ; SOFT-NEXT: .LCPI24_0:
2360 ; SOFT-NEXT: .long 1224736736 @ 0x48ffffe0
2361 ; SOFT-NEXT: .LCPI24_1:
2362 ; SOFT-NEXT: .long 524287 @ 0x7ffff
2364 ; VFP2-LABEL: test_signed_i19_f16:
2366 ; VFP2-NEXT: .save {r7, lr}
2367 ; VFP2-NEXT: push {r7, lr}
2368 ; VFP2-NEXT: bl __aeabi_h2f
2369 ; VFP2-NEXT: vmov s0, r0
2370 ; VFP2-NEXT: vldr s4, .LCPI24_0
2371 ; VFP2-NEXT: vcvt.u32.f32 s2, s0
2372 ; VFP2-NEXT: vcmp.f32 s0, #0
2373 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2374 ; VFP2-NEXT: vcmp.f32 s0, s4
2375 ; VFP2-NEXT: vmov r0, s2
2377 ; VFP2-NEXT: movlt r0, #0
2378 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2380 ; VFP2-NEXT: movwgt r0, #65535
2381 ; VFP2-NEXT: movtgt r0, #7
2382 ; VFP2-NEXT: pop {r7, pc}
2383 ; VFP2-NEXT: .p2align 2
2384 ; VFP2-NEXT: @ %bb.1:
2385 ; VFP2-NEXT: .LCPI24_0:
2386 ; VFP2-NEXT: .long 0x48ffffe0 @ float 524287
2388 ; FP16-LABEL: test_signed_i19_f16:
2390 ; FP16-NEXT: vmov.f16 s0, r0
2391 ; FP16-NEXT: vldr s4, .LCPI24_1
2392 ; FP16-NEXT: vcvtb.f32.f16 s0, s0
2393 ; FP16-NEXT: vldr s2, .LCPI24_0
2394 ; FP16-NEXT: vmaxnm.f32 s0, s0, s4
2395 ; FP16-NEXT: vminnm.f32 s0, s0, s2
2396 ; FP16-NEXT: vcvt.u32.f32 s0, s0
2397 ; FP16-NEXT: vmov r0, s0
2399 ; FP16-NEXT: .p2align 2
2400 ; FP16-NEXT: @ %bb.1:
2401 ; FP16-NEXT: .LCPI24_0:
2402 ; FP16-NEXT: .long 0x48ffffe0 @ float 524287
2403 ; FP16-NEXT: .LCPI24_1:
2404 ; FP16-NEXT: .long 0x00000000 @ float 0
2405 %x = call i19 @llvm.fptoui.sat.i19.f16(half %f)
2409 define i32 @test_signed_i32_f16(half %f) nounwind {
2410 ; SOFT-LABEL: test_signed_i32_f16:
2412 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
2413 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
2414 ; SOFT-NEXT: .pad #4
2415 ; SOFT-NEXT: sub sp, #4
2416 ; SOFT-NEXT: uxth r0, r0
2417 ; SOFT-NEXT: bl __aeabi_h2f
2418 ; SOFT-NEXT: mov r7, r0
2419 ; SOFT-NEXT: ldr r1, .LCPI25_0
2420 ; SOFT-NEXT: bl __aeabi_fcmpgt
2421 ; SOFT-NEXT: mov r5, r0
2422 ; SOFT-NEXT: movs r4, #0
2423 ; SOFT-NEXT: mov r0, r7
2424 ; SOFT-NEXT: mov r1, r4
2425 ; SOFT-NEXT: bl __aeabi_fcmpge
2426 ; SOFT-NEXT: mov r6, r0
2427 ; SOFT-NEXT: mov r0, r7
2428 ; SOFT-NEXT: bl __aeabi_f2uiz
2429 ; SOFT-NEXT: cmp r6, #0
2430 ; SOFT-NEXT: beq .LBB25_3
2431 ; SOFT-NEXT: @ %bb.1:
2432 ; SOFT-NEXT: cmp r5, #0
2433 ; SOFT-NEXT: bne .LBB25_4
2434 ; SOFT-NEXT: .LBB25_2:
2435 ; SOFT-NEXT: add sp, #4
2436 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
2437 ; SOFT-NEXT: .LBB25_3:
2438 ; SOFT-NEXT: mov r0, r6
2439 ; SOFT-NEXT: cmp r5, #0
2440 ; SOFT-NEXT: beq .LBB25_2
2441 ; SOFT-NEXT: .LBB25_4:
2442 ; SOFT-NEXT: mvns r0, r4
2443 ; SOFT-NEXT: add sp, #4
2444 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
2445 ; SOFT-NEXT: .p2align 2
2446 ; SOFT-NEXT: @ %bb.5:
2447 ; SOFT-NEXT: .LCPI25_0:
2448 ; SOFT-NEXT: .long 1333788671 @ 0x4f7fffff
2450 ; VFP2-LABEL: test_signed_i32_f16:
2452 ; VFP2-NEXT: .save {r7, lr}
2453 ; VFP2-NEXT: push {r7, lr}
2454 ; VFP2-NEXT: bl __aeabi_h2f
2455 ; VFP2-NEXT: vmov s0, r0
2456 ; VFP2-NEXT: vcvt.u32.f32 s0, s0
2457 ; VFP2-NEXT: vmov r0, s0
2458 ; VFP2-NEXT: pop {r7, pc}
2460 ; FP16-LABEL: test_signed_i32_f16:
2462 ; FP16-NEXT: vmov.f16 s0, r0
2463 ; FP16-NEXT: vcvt.u32.f16 s0, s0
2464 ; FP16-NEXT: vmov r0, s0
2466 %x = call i32 @llvm.fptoui.sat.i32.f16(half %f)
2470 define i50 @test_signed_i50_f16(half %f) nounwind {
2471 ; SOFT-LABEL: test_signed_i50_f16:
2473 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
2474 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
2475 ; SOFT-NEXT: .pad #4
2476 ; SOFT-NEXT: sub sp, #4
2477 ; SOFT-NEXT: uxth r0, r0
2478 ; SOFT-NEXT: bl __aeabi_h2f
2479 ; SOFT-NEXT: mov r7, r0
2480 ; SOFT-NEXT: ldr r1, .LCPI26_0
2481 ; SOFT-NEXT: bl __aeabi_fcmpgt
2482 ; SOFT-NEXT: mov r4, r0
2483 ; SOFT-NEXT: movs r6, #0
2484 ; SOFT-NEXT: mov r0, r7
2485 ; SOFT-NEXT: mov r1, r6
2486 ; SOFT-NEXT: bl __aeabi_fcmpge
2487 ; SOFT-NEXT: mov r5, r0
2488 ; SOFT-NEXT: mov r0, r7
2489 ; SOFT-NEXT: bl __aeabi_f2ulz
2490 ; SOFT-NEXT: cmp r5, #0
2491 ; SOFT-NEXT: beq .LBB26_5
2492 ; SOFT-NEXT: @ %bb.1:
2493 ; SOFT-NEXT: cmp r4, #0
2494 ; SOFT-NEXT: bne .LBB26_6
2495 ; SOFT-NEXT: .LBB26_2:
2496 ; SOFT-NEXT: cmp r5, #0
2497 ; SOFT-NEXT: beq .LBB26_7
2498 ; SOFT-NEXT: .LBB26_3:
2499 ; SOFT-NEXT: cmp r4, #0
2500 ; SOFT-NEXT: bne .LBB26_8
2501 ; SOFT-NEXT: .LBB26_4:
2502 ; SOFT-NEXT: add sp, #4
2503 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
2504 ; SOFT-NEXT: .LBB26_5:
2505 ; SOFT-NEXT: mov r0, r5
2506 ; SOFT-NEXT: cmp r4, #0
2507 ; SOFT-NEXT: beq .LBB26_2
2508 ; SOFT-NEXT: .LBB26_6:
2509 ; SOFT-NEXT: mvns r0, r6
2510 ; SOFT-NEXT: cmp r5, #0
2511 ; SOFT-NEXT: bne .LBB26_3
2512 ; SOFT-NEXT: .LBB26_7:
2513 ; SOFT-NEXT: mov r1, r5
2514 ; SOFT-NEXT: cmp r4, #0
2515 ; SOFT-NEXT: beq .LBB26_4
2516 ; SOFT-NEXT: .LBB26_8:
2517 ; SOFT-NEXT: ldr r1, .LCPI26_1
2518 ; SOFT-NEXT: add sp, #4
2519 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
2520 ; SOFT-NEXT: .p2align 2
2521 ; SOFT-NEXT: @ %bb.9:
2522 ; SOFT-NEXT: .LCPI26_0:
2523 ; SOFT-NEXT: .long 1484783615 @ 0x587fffff
2524 ; SOFT-NEXT: .LCPI26_1:
2525 ; SOFT-NEXT: .long 262143 @ 0x3ffff
2527 ; VFP2-LABEL: test_signed_i50_f16:
2529 ; VFP2-NEXT: .save {r7, lr}
2530 ; VFP2-NEXT: push {r7, lr}
2531 ; VFP2-NEXT: .vsave {d8}
2532 ; VFP2-NEXT: vpush {d8}
2533 ; VFP2-NEXT: bl __aeabi_h2f
2534 ; VFP2-NEXT: vmov s16, r0
2535 ; VFP2-NEXT: bl __aeabi_f2ulz
2536 ; VFP2-NEXT: vldr s0, .LCPI26_0
2537 ; VFP2-NEXT: vcmp.f32 s16, #0
2538 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2540 ; VFP2-NEXT: movlt r0, #0
2541 ; VFP2-NEXT: movlt r1, #0
2542 ; VFP2-NEXT: vcmp.f32 s16, s0
2543 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2544 ; VFP2-NEXT: ittt gt
2545 ; VFP2-NEXT: movwgt r1, #65535
2546 ; VFP2-NEXT: movtgt r1, #3
2547 ; VFP2-NEXT: movgt.w r0, #-1
2548 ; VFP2-NEXT: vpop {d8}
2549 ; VFP2-NEXT: pop {r7, pc}
2550 ; VFP2-NEXT: .p2align 2
2551 ; VFP2-NEXT: @ %bb.1:
2552 ; VFP2-NEXT: .LCPI26_0:
2553 ; VFP2-NEXT: .long 0x587fffff @ float 1.12589984E+15
2555 ; FP16-LABEL: test_signed_i50_f16:
2557 ; FP16-NEXT: .save {r7, lr}
2558 ; FP16-NEXT: push {r7, lr}
2559 ; FP16-NEXT: .vsave {d8}
2560 ; FP16-NEXT: vpush {d8}
2561 ; FP16-NEXT: vmov.f16 s0, r0
2562 ; FP16-NEXT: vcvtb.f32.f16 s16, s0
2563 ; FP16-NEXT: vmov r0, s16
2564 ; FP16-NEXT: bl __aeabi_f2ulz
2565 ; FP16-NEXT: vldr s0, .LCPI26_0
2566 ; FP16-NEXT: vcmp.f32 s16, #0
2567 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2569 ; FP16-NEXT: movlt r0, #0
2570 ; FP16-NEXT: movlt r1, #0
2571 ; FP16-NEXT: vcmp.f32 s16, s0
2572 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2573 ; FP16-NEXT: ittt gt
2574 ; FP16-NEXT: movwgt r1, #65535
2575 ; FP16-NEXT: movtgt r1, #3
2576 ; FP16-NEXT: movgt.w r0, #-1
2577 ; FP16-NEXT: vpop {d8}
2578 ; FP16-NEXT: pop {r7, pc}
2579 ; FP16-NEXT: .p2align 2
2580 ; FP16-NEXT: @ %bb.1:
2581 ; FP16-NEXT: .LCPI26_0:
2582 ; FP16-NEXT: .long 0x587fffff @ float 1.12589984E+15
2583 %x = call i50 @llvm.fptoui.sat.i50.f16(half %f)
2587 define i64 @test_signed_i64_f16(half %f) nounwind {
2588 ; SOFT-LABEL: test_signed_i64_f16:
2590 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
2591 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
2592 ; SOFT-NEXT: .pad #4
2593 ; SOFT-NEXT: sub sp, #4
2594 ; SOFT-NEXT: uxth r0, r0
2595 ; SOFT-NEXT: bl __aeabi_h2f
2596 ; SOFT-NEXT: mov r7, r0
2597 ; SOFT-NEXT: ldr r1, .LCPI27_0
2598 ; SOFT-NEXT: bl __aeabi_fcmpgt
2599 ; SOFT-NEXT: mov r4, r0
2600 ; SOFT-NEXT: movs r6, #0
2601 ; SOFT-NEXT: mov r0, r7
2602 ; SOFT-NEXT: mov r1, r6
2603 ; SOFT-NEXT: bl __aeabi_fcmpge
2604 ; SOFT-NEXT: mov r5, r0
2605 ; SOFT-NEXT: mov r0, r7
2606 ; SOFT-NEXT: bl __aeabi_f2ulz
2607 ; SOFT-NEXT: mov r3, r0
2608 ; SOFT-NEXT: cmp r5, #0
2609 ; SOFT-NEXT: bne .LBB27_2
2610 ; SOFT-NEXT: @ %bb.1:
2611 ; SOFT-NEXT: mov r3, r5
2612 ; SOFT-NEXT: .LBB27_2:
2613 ; SOFT-NEXT: mvns r2, r6
2614 ; SOFT-NEXT: cmp r4, #0
2615 ; SOFT-NEXT: mov r0, r2
2616 ; SOFT-NEXT: beq .LBB27_7
2617 ; SOFT-NEXT: @ %bb.3:
2618 ; SOFT-NEXT: cmp r5, #0
2619 ; SOFT-NEXT: beq .LBB27_8
2620 ; SOFT-NEXT: .LBB27_4:
2621 ; SOFT-NEXT: cmp r4, #0
2622 ; SOFT-NEXT: bne .LBB27_6
2623 ; SOFT-NEXT: .LBB27_5:
2624 ; SOFT-NEXT: mov r2, r1
2625 ; SOFT-NEXT: .LBB27_6:
2626 ; SOFT-NEXT: mov r1, r2
2627 ; SOFT-NEXT: add sp, #4
2628 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
2629 ; SOFT-NEXT: .LBB27_7:
2630 ; SOFT-NEXT: mov r0, r3
2631 ; SOFT-NEXT: cmp r5, #0
2632 ; SOFT-NEXT: bne .LBB27_4
2633 ; SOFT-NEXT: .LBB27_8:
2634 ; SOFT-NEXT: mov r1, r5
2635 ; SOFT-NEXT: cmp r4, #0
2636 ; SOFT-NEXT: beq .LBB27_5
2637 ; SOFT-NEXT: b .LBB27_6
2638 ; SOFT-NEXT: .p2align 2
2639 ; SOFT-NEXT: @ %bb.9:
2640 ; SOFT-NEXT: .LCPI27_0:
2641 ; SOFT-NEXT: .long 1602224127 @ 0x5f7fffff
2643 ; VFP2-LABEL: test_signed_i64_f16:
2645 ; VFP2-NEXT: .save {r7, lr}
2646 ; VFP2-NEXT: push {r7, lr}
2647 ; VFP2-NEXT: .vsave {d8}
2648 ; VFP2-NEXT: vpush {d8}
2649 ; VFP2-NEXT: bl __aeabi_h2f
2650 ; VFP2-NEXT: vmov s16, r0
2651 ; VFP2-NEXT: bl __aeabi_f2ulz
2652 ; VFP2-NEXT: vldr s0, .LCPI27_0
2653 ; VFP2-NEXT: vcmp.f32 s16, #0
2654 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2656 ; VFP2-NEXT: movlt r0, #0
2657 ; VFP2-NEXT: vcmp.f32 s16, s0
2658 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2659 ; VFP2-NEXT: vcmp.f32 s16, #0
2661 ; VFP2-NEXT: movgt.w r0, #-1
2662 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2664 ; VFP2-NEXT: movlt r1, #0
2665 ; VFP2-NEXT: vcmp.f32 s16, s0
2666 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2668 ; VFP2-NEXT: movgt.w r1, #-1
2669 ; VFP2-NEXT: vpop {d8}
2670 ; VFP2-NEXT: pop {r7, pc}
2671 ; VFP2-NEXT: .p2align 2
2672 ; VFP2-NEXT: @ %bb.1:
2673 ; VFP2-NEXT: .LCPI27_0:
2674 ; VFP2-NEXT: .long 0x5f7fffff @ float 1.8446743E+19
2676 ; FP16-LABEL: test_signed_i64_f16:
2678 ; FP16-NEXT: .save {r7, lr}
2679 ; FP16-NEXT: push {r7, lr}
2680 ; FP16-NEXT: .vsave {d8}
2681 ; FP16-NEXT: vpush {d8}
2682 ; FP16-NEXT: vmov.f16 s0, r0
2683 ; FP16-NEXT: vcvtb.f32.f16 s16, s0
2684 ; FP16-NEXT: vmov r0, s16
2685 ; FP16-NEXT: bl __aeabi_f2ulz
2686 ; FP16-NEXT: vldr s0, .LCPI27_0
2687 ; FP16-NEXT: vcmp.f32 s16, #0
2688 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2690 ; FP16-NEXT: movlt r0, #0
2691 ; FP16-NEXT: vcmp.f32 s16, s0
2692 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2693 ; FP16-NEXT: vcmp.f32 s16, #0
2695 ; FP16-NEXT: movgt.w r0, #-1
2696 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2698 ; FP16-NEXT: movlt r1, #0
2699 ; FP16-NEXT: vcmp.f32 s16, s0
2700 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2702 ; FP16-NEXT: movgt.w r1, #-1
2703 ; FP16-NEXT: vpop {d8}
2704 ; FP16-NEXT: pop {r7, pc}
2705 ; FP16-NEXT: .p2align 2
2706 ; FP16-NEXT: @ %bb.1:
2707 ; FP16-NEXT: .LCPI27_0:
2708 ; FP16-NEXT: .long 0x5f7fffff @ float 1.8446743E+19
2709 %x = call i64 @llvm.fptoui.sat.i64.f16(half %f)
2713 define i100 @test_signed_i100_f16(half %f) nounwind {
2714 ; SOFT-LABEL: test_signed_i100_f16:
2716 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
2717 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
2718 ; SOFT-NEXT: .pad #4
2719 ; SOFT-NEXT: sub sp, #4
2720 ; SOFT-NEXT: uxth r0, r0
2721 ; SOFT-NEXT: bl __aeabi_h2f
2722 ; SOFT-NEXT: mov r7, r0
2723 ; SOFT-NEXT: ldr r1, .LCPI28_0
2724 ; SOFT-NEXT: bl __aeabi_fcmpgt
2725 ; SOFT-NEXT: mov r4, r0
2726 ; SOFT-NEXT: movs r6, #0
2727 ; SOFT-NEXT: mov r0, r7
2728 ; SOFT-NEXT: mov r1, r6
2729 ; SOFT-NEXT: bl __aeabi_fcmpge
2730 ; SOFT-NEXT: mov r5, r0
2731 ; SOFT-NEXT: mov r0, r7
2732 ; SOFT-NEXT: bl __fixunssfti
2733 ; SOFT-NEXT: mov r7, r1
2734 ; SOFT-NEXT: str r2, [sp] @ 4-byte Spill
2735 ; SOFT-NEXT: cmp r5, #0
2736 ; SOFT-NEXT: bne .LBB28_2
2737 ; SOFT-NEXT: @ %bb.1:
2738 ; SOFT-NEXT: mov r0, r5
2739 ; SOFT-NEXT: .LBB28_2:
2740 ; SOFT-NEXT: mvns r2, r6
2741 ; SOFT-NEXT: cmp r4, #0
2742 ; SOFT-NEXT: mov r6, r2
2743 ; SOFT-NEXT: bne .LBB28_4
2744 ; SOFT-NEXT: @ %bb.3:
2745 ; SOFT-NEXT: mov r6, r0
2746 ; SOFT-NEXT: .LBB28_4:
2747 ; SOFT-NEXT: cmp r5, #0
2748 ; SOFT-NEXT: bne .LBB28_6
2749 ; SOFT-NEXT: @ %bb.5:
2750 ; SOFT-NEXT: mov r7, r5
2751 ; SOFT-NEXT: .LBB28_6:
2752 ; SOFT-NEXT: cmp r4, #0
2753 ; SOFT-NEXT: mov r1, r2
2754 ; SOFT-NEXT: beq .LBB28_13
2755 ; SOFT-NEXT: @ %bb.7:
2756 ; SOFT-NEXT: cmp r5, #0
2757 ; SOFT-NEXT: beq .LBB28_14
2758 ; SOFT-NEXT: .LBB28_8:
2759 ; SOFT-NEXT: cmp r4, #0
2760 ; SOFT-NEXT: beq .LBB28_15
2761 ; SOFT-NEXT: .LBB28_9:
2762 ; SOFT-NEXT: cmp r5, #0
2763 ; SOFT-NEXT: beq .LBB28_16
2764 ; SOFT-NEXT: .LBB28_10:
2765 ; SOFT-NEXT: cmp r4, #0
2766 ; SOFT-NEXT: beq .LBB28_12
2767 ; SOFT-NEXT: .LBB28_11:
2768 ; SOFT-NEXT: movs r3, #15
2769 ; SOFT-NEXT: .LBB28_12:
2770 ; SOFT-NEXT: mov r0, r6
2771 ; SOFT-NEXT: add sp, #4
2772 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
2773 ; SOFT-NEXT: .LBB28_13:
2774 ; SOFT-NEXT: mov r1, r7
2775 ; SOFT-NEXT: cmp r5, #0
2776 ; SOFT-NEXT: bne .LBB28_8
2777 ; SOFT-NEXT: .LBB28_14:
2778 ; SOFT-NEXT: str r5, [sp] @ 4-byte Spill
2779 ; SOFT-NEXT: cmp r4, #0
2780 ; SOFT-NEXT: bne .LBB28_9
2781 ; SOFT-NEXT: .LBB28_15:
2782 ; SOFT-NEXT: ldr r2, [sp] @ 4-byte Reload
2783 ; SOFT-NEXT: cmp r5, #0
2784 ; SOFT-NEXT: bne .LBB28_10
2785 ; SOFT-NEXT: .LBB28_16:
2786 ; SOFT-NEXT: mov r3, r5
2787 ; SOFT-NEXT: cmp r4, #0
2788 ; SOFT-NEXT: bne .LBB28_11
2789 ; SOFT-NEXT: b .LBB28_12
2790 ; SOFT-NEXT: .p2align 2
2791 ; SOFT-NEXT: @ %bb.17:
2792 ; SOFT-NEXT: .LCPI28_0:
2793 ; SOFT-NEXT: .long 1904214015 @ 0x717fffff
2795 ; VFP2-LABEL: test_signed_i100_f16:
2797 ; VFP2-NEXT: .save {r7, lr}
2798 ; VFP2-NEXT: push {r7, lr}
2799 ; VFP2-NEXT: .vsave {d8}
2800 ; VFP2-NEXT: vpush {d8}
2801 ; VFP2-NEXT: bl __aeabi_h2f
2802 ; VFP2-NEXT: vmov s16, r0
2803 ; VFP2-NEXT: bl __fixunssfti
2804 ; VFP2-NEXT: vldr s0, .LCPI28_0
2805 ; VFP2-NEXT: vcmp.f32 s16, #0
2806 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2808 ; VFP2-NEXT: movlt r0, #0
2809 ; VFP2-NEXT: vcmp.f32 s16, s0
2810 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2811 ; VFP2-NEXT: vcmp.f32 s16, #0
2813 ; VFP2-NEXT: movgt.w r0, #-1
2814 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2815 ; VFP2-NEXT: vcmp.f32 s16, s0
2817 ; VFP2-NEXT: movlt r1, #0
2818 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2819 ; VFP2-NEXT: vcmp.f32 s16, #0
2821 ; VFP2-NEXT: movgt.w r1, #-1
2822 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2823 ; VFP2-NEXT: vcmp.f32 s16, s0
2825 ; VFP2-NEXT: movlt r2, #0
2826 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2827 ; VFP2-NEXT: vcmp.f32 s16, #0
2829 ; VFP2-NEXT: movgt.w r2, #-1
2830 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2832 ; VFP2-NEXT: movlt r3, #0
2833 ; VFP2-NEXT: vcmp.f32 s16, s0
2834 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2836 ; VFP2-NEXT: movgt r3, #15
2837 ; VFP2-NEXT: vpop {d8}
2838 ; VFP2-NEXT: pop {r7, pc}
2839 ; VFP2-NEXT: .p2align 2
2840 ; VFP2-NEXT: @ %bb.1:
2841 ; VFP2-NEXT: .LCPI28_0:
2842 ; VFP2-NEXT: .long 0x717fffff @ float 1.26765052E+30
2844 ; FP16-LABEL: test_signed_i100_f16:
2846 ; FP16-NEXT: .save {r7, lr}
2847 ; FP16-NEXT: push {r7, lr}
2848 ; FP16-NEXT: .vsave {d8}
2849 ; FP16-NEXT: vpush {d8}
2850 ; FP16-NEXT: vmov.f16 s0, r0
2851 ; FP16-NEXT: vcvtb.f32.f16 s16, s0
2852 ; FP16-NEXT: vmov r0, s16
2853 ; FP16-NEXT: bl __fixunssfti
2854 ; FP16-NEXT: vldr s0, .LCPI28_0
2855 ; FP16-NEXT: vcmp.f32 s16, #0
2856 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2858 ; FP16-NEXT: movlt r0, #0
2859 ; FP16-NEXT: vcmp.f32 s16, s0
2860 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2861 ; FP16-NEXT: vcmp.f32 s16, #0
2863 ; FP16-NEXT: movgt.w r0, #-1
2864 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2865 ; FP16-NEXT: vcmp.f32 s16, s0
2867 ; FP16-NEXT: movlt r1, #0
2868 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2869 ; FP16-NEXT: vcmp.f32 s16, #0
2871 ; FP16-NEXT: movgt.w r1, #-1
2872 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2873 ; FP16-NEXT: vcmp.f32 s16, s0
2875 ; FP16-NEXT: movlt r2, #0
2876 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2877 ; FP16-NEXT: vcmp.f32 s16, #0
2879 ; FP16-NEXT: movgt.w r2, #-1
2880 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2882 ; FP16-NEXT: movlt r3, #0
2883 ; FP16-NEXT: vcmp.f32 s16, s0
2884 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2886 ; FP16-NEXT: movgt r3, #15
2887 ; FP16-NEXT: vpop {d8}
2888 ; FP16-NEXT: pop {r7, pc}
2889 ; FP16-NEXT: .p2align 2
2890 ; FP16-NEXT: @ %bb.1:
2891 ; FP16-NEXT: .LCPI28_0:
2892 ; FP16-NEXT: .long 0x717fffff @ float 1.26765052E+30
2893 %x = call i100 @llvm.fptoui.sat.i100.f16(half %f)
2897 define i128 @test_signed_i128_f16(half %f) nounwind {
2898 ; SOFT-LABEL: test_signed_i128_f16:
2900 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
2901 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
2902 ; SOFT-NEXT: .pad #4
2903 ; SOFT-NEXT: sub sp, #4
2904 ; SOFT-NEXT: uxth r0, r0
2905 ; SOFT-NEXT: bl __aeabi_h2f
2906 ; SOFT-NEXT: mov r7, r0
2907 ; SOFT-NEXT: ldr r1, .LCPI29_0
2908 ; SOFT-NEXT: bl __aeabi_fcmpgt
2909 ; SOFT-NEXT: mov r4, r0
2910 ; SOFT-NEXT: movs r6, #0
2911 ; SOFT-NEXT: mov r0, r7
2912 ; SOFT-NEXT: mov r1, r6
2913 ; SOFT-NEXT: bl __aeabi_fcmpge
2914 ; SOFT-NEXT: mov r5, r0
2915 ; SOFT-NEXT: mov r0, r7
2916 ; SOFT-NEXT: bl __fixunssfti
2917 ; SOFT-NEXT: mov r7, r1
2918 ; SOFT-NEXT: str r3, [sp] @ 4-byte Spill
2919 ; SOFT-NEXT: cmp r5, #0
2920 ; SOFT-NEXT: bne .LBB29_2
2921 ; SOFT-NEXT: @ %bb.1:
2922 ; SOFT-NEXT: mov r0, r5
2923 ; SOFT-NEXT: .LBB29_2:
2924 ; SOFT-NEXT: mvns r6, r6
2925 ; SOFT-NEXT: cmp r4, #0
2926 ; SOFT-NEXT: mov r3, r6
2927 ; SOFT-NEXT: bne .LBB29_4
2928 ; SOFT-NEXT: @ %bb.3:
2929 ; SOFT-NEXT: mov r3, r0
2930 ; SOFT-NEXT: .LBB29_4:
2931 ; SOFT-NEXT: cmp r5, #0
2932 ; SOFT-NEXT: bne .LBB29_6
2933 ; SOFT-NEXT: @ %bb.5:
2934 ; SOFT-NEXT: mov r7, r5
2935 ; SOFT-NEXT: .LBB29_6:
2936 ; SOFT-NEXT: cmp r4, #0
2937 ; SOFT-NEXT: mov r1, r6
2938 ; SOFT-NEXT: bne .LBB29_8
2939 ; SOFT-NEXT: @ %bb.7:
2940 ; SOFT-NEXT: mov r1, r7
2941 ; SOFT-NEXT: .LBB29_8:
2942 ; SOFT-NEXT: cmp r5, #0
2943 ; SOFT-NEXT: bne .LBB29_10
2944 ; SOFT-NEXT: @ %bb.9:
2945 ; SOFT-NEXT: mov r2, r5
2946 ; SOFT-NEXT: .LBB29_10:
2947 ; SOFT-NEXT: cmp r4, #0
2948 ; SOFT-NEXT: mov r7, r6
2949 ; SOFT-NEXT: beq .LBB29_15
2950 ; SOFT-NEXT: @ %bb.11:
2951 ; SOFT-NEXT: cmp r5, #0
2952 ; SOFT-NEXT: beq .LBB29_16
2953 ; SOFT-NEXT: .LBB29_12:
2954 ; SOFT-NEXT: cmp r4, #0
2955 ; SOFT-NEXT: bne .LBB29_14
2956 ; SOFT-NEXT: .LBB29_13:
2957 ; SOFT-NEXT: ldr r6, [sp] @ 4-byte Reload
2958 ; SOFT-NEXT: .LBB29_14:
2959 ; SOFT-NEXT: mov r0, r3
2960 ; SOFT-NEXT: mov r2, r7
2961 ; SOFT-NEXT: mov r3, r6
2962 ; SOFT-NEXT: add sp, #4
2963 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
2964 ; SOFT-NEXT: .LBB29_15:
2965 ; SOFT-NEXT: mov r7, r2
2966 ; SOFT-NEXT: cmp r5, #0
2967 ; SOFT-NEXT: bne .LBB29_12
2968 ; SOFT-NEXT: .LBB29_16:
2969 ; SOFT-NEXT: str r5, [sp] @ 4-byte Spill
2970 ; SOFT-NEXT: cmp r4, #0
2971 ; SOFT-NEXT: beq .LBB29_13
2972 ; SOFT-NEXT: b .LBB29_14
2973 ; SOFT-NEXT: .p2align 2
2974 ; SOFT-NEXT: @ %bb.17:
2975 ; SOFT-NEXT: .LCPI29_0:
2976 ; SOFT-NEXT: .long 2139095039 @ 0x7f7fffff
2978 ; VFP2-LABEL: test_signed_i128_f16:
2980 ; VFP2-NEXT: .save {r7, lr}
2981 ; VFP2-NEXT: push {r7, lr}
2982 ; VFP2-NEXT: .vsave {d8}
2983 ; VFP2-NEXT: vpush {d8}
2984 ; VFP2-NEXT: bl __aeabi_h2f
2985 ; VFP2-NEXT: vmov s16, r0
2986 ; VFP2-NEXT: bl __fixunssfti
2987 ; VFP2-NEXT: vldr s0, .LCPI29_0
2988 ; VFP2-NEXT: vcmp.f32 s16, #0
2989 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2991 ; VFP2-NEXT: movlt r0, #0
2992 ; VFP2-NEXT: vcmp.f32 s16, s0
2993 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2994 ; VFP2-NEXT: vcmp.f32 s16, #0
2996 ; VFP2-NEXT: movgt.w r0, #-1
2997 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2998 ; VFP2-NEXT: vcmp.f32 s16, s0
3000 ; VFP2-NEXT: movlt r1, #0
3001 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3002 ; VFP2-NEXT: vcmp.f32 s16, #0
3004 ; VFP2-NEXT: movgt.w r1, #-1
3005 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3006 ; VFP2-NEXT: vcmp.f32 s16, s0
3008 ; VFP2-NEXT: movlt r2, #0
3009 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3010 ; VFP2-NEXT: vcmp.f32 s16, #0
3012 ; VFP2-NEXT: movgt.w r2, #-1
3013 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3015 ; VFP2-NEXT: movlt r3, #0
3016 ; VFP2-NEXT: vcmp.f32 s16, s0
3017 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3019 ; VFP2-NEXT: movgt.w r3, #-1
3020 ; VFP2-NEXT: vpop {d8}
3021 ; VFP2-NEXT: pop {r7, pc}
3022 ; VFP2-NEXT: .p2align 2
3023 ; VFP2-NEXT: @ %bb.1:
3024 ; VFP2-NEXT: .LCPI29_0:
3025 ; VFP2-NEXT: .long 0x7f7fffff @ float 3.40282347E+38
3027 ; FP16-LABEL: test_signed_i128_f16:
3029 ; FP16-NEXT: .save {r7, lr}
3030 ; FP16-NEXT: push {r7, lr}
3031 ; FP16-NEXT: .vsave {d8}
3032 ; FP16-NEXT: vpush {d8}
3033 ; FP16-NEXT: vmov.f16 s0, r0
3034 ; FP16-NEXT: vcvtb.f32.f16 s16, s0
3035 ; FP16-NEXT: vmov r0, s16
3036 ; FP16-NEXT: bl __fixunssfti
3037 ; FP16-NEXT: vldr s0, .LCPI29_0
3038 ; FP16-NEXT: vcmp.f32 s16, #0
3039 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
3041 ; FP16-NEXT: movlt r0, #0
3042 ; FP16-NEXT: vcmp.f32 s16, s0
3043 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
3044 ; FP16-NEXT: vcmp.f32 s16, #0
3046 ; FP16-NEXT: movgt.w r0, #-1
3047 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
3048 ; FP16-NEXT: vcmp.f32 s16, s0
3050 ; FP16-NEXT: movlt r1, #0
3051 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
3052 ; FP16-NEXT: vcmp.f32 s16, #0
3054 ; FP16-NEXT: movgt.w r1, #-1
3055 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
3056 ; FP16-NEXT: vcmp.f32 s16, s0
3058 ; FP16-NEXT: movlt r2, #0
3059 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
3060 ; FP16-NEXT: vcmp.f32 s16, #0
3062 ; FP16-NEXT: movgt.w r2, #-1
3063 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
3065 ; FP16-NEXT: movlt r3, #0
3066 ; FP16-NEXT: vcmp.f32 s16, s0
3067 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
3069 ; FP16-NEXT: movgt.w r3, #-1
3070 ; FP16-NEXT: vpop {d8}
3071 ; FP16-NEXT: pop {r7, pc}
3072 ; FP16-NEXT: .p2align 2
3073 ; FP16-NEXT: @ %bb.1:
3074 ; FP16-NEXT: .LCPI29_0:
3075 ; FP16-NEXT: .long 0x7f7fffff @ float 3.40282347E+38
3076 %x = call i128 @llvm.fptoui.sat.i128.f16(half %f)