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.fptosi.sat.i1.f32 (float)
11 declare i8 @llvm.fptosi.sat.i8.f32 (float)
12 declare i13 @llvm.fptosi.sat.i13.f32 (float)
13 declare i16 @llvm.fptosi.sat.i16.f32 (float)
14 declare i19 @llvm.fptosi.sat.i19.f32 (float)
15 declare i32 @llvm.fptosi.sat.i32.f32 (float)
16 declare i50 @llvm.fptosi.sat.i50.f32 (float)
17 declare i64 @llvm.fptosi.sat.i64.f32 (float)
18 declare i100 @llvm.fptosi.sat.i100.f32(float)
19 declare i128 @llvm.fptosi.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, r7, lr}
25 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
27 ; SOFT-NEXT: sub sp, #4
28 ; SOFT-NEXT: mov r4, r0
29 ; SOFT-NEXT: ldr r1, .LCPI0_0
30 ; SOFT-NEXT: bl __aeabi_fcmpge
31 ; SOFT-NEXT: mov r7, r0
32 ; SOFT-NEXT: mov r0, r4
33 ; SOFT-NEXT: bl __aeabi_f2iz
34 ; SOFT-NEXT: movs r5, #0
35 ; SOFT-NEXT: cmp r7, #0
36 ; SOFT-NEXT: beq .LBB0_2
38 ; SOFT-NEXT: mov r6, r0
39 ; SOFT-NEXT: b .LBB0_3
41 ; SOFT-NEXT: mvns r6, r5
43 ; SOFT-NEXT: mov r0, r4
44 ; SOFT-NEXT: mov r1, r5
45 ; SOFT-NEXT: bl __aeabi_fcmpgt
46 ; SOFT-NEXT: cmp r0, #0
47 ; SOFT-NEXT: mov r7, r5
48 ; SOFT-NEXT: bne .LBB0_5
50 ; SOFT-NEXT: mov r7, r6
52 ; SOFT-NEXT: mov r0, r4
53 ; SOFT-NEXT: mov r1, r4
54 ; SOFT-NEXT: bl __aeabi_fcmpun
55 ; SOFT-NEXT: cmp r0, #0
56 ; SOFT-NEXT: bne .LBB0_7
58 ; SOFT-NEXT: mov r5, r7
60 ; SOFT-NEXT: mov r0, r5
61 ; SOFT-NEXT: add sp, #4
62 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
63 ; SOFT-NEXT: .p2align 2
65 ; SOFT-NEXT: .LCPI0_0:
66 ; SOFT-NEXT: .long 3212836864 @ 0xbf800000
68 ; VFP2-LABEL: test_signed_i1_f32:
70 ; VFP2-NEXT: vmov s2, r0
71 ; VFP2-NEXT: vmov.f32 s0, #-1.000000e+00
72 ; VFP2-NEXT: vcvt.s32.f32 s4, s2
73 ; VFP2-NEXT: vcmp.f32 s2, s0
74 ; VFP2-NEXT: vmov r0, s4
75 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
77 ; VFP2-NEXT: movlt.w r0, #-1
78 ; VFP2-NEXT: vcmp.f32 s2, #0
79 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
81 ; VFP2-NEXT: movgt r0, #0
82 ; VFP2-NEXT: vcmp.f32 s2, s2
83 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
85 ; VFP2-NEXT: movvs r0, #0
88 ; FP16-LABEL: test_signed_i1_f32:
90 ; FP16-NEXT: vmov s2, r0
91 ; FP16-NEXT: vldr s4, .LCPI0_0
92 ; FP16-NEXT: vmov.f32 s0, #-1.000000e+00
93 ; FP16-NEXT: vmaxnm.f32 s0, s2, s0
94 ; FP16-NEXT: vcmp.f32 s2, s2
95 ; FP16-NEXT: vminnm.f32 s0, s0, s4
96 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
97 ; FP16-NEXT: vcvt.s32.f32 s0, s0
98 ; FP16-NEXT: vmov r0, s0
100 ; FP16-NEXT: movvs r0, #0
102 ; FP16-NEXT: .p2align 2
103 ; FP16-NEXT: @ %bb.1:
104 ; FP16-NEXT: .LCPI0_0:
105 ; FP16-NEXT: .long 0x00000000 @ float 0
106 %x = call i1 @llvm.fptosi.sat.i1.f32(float %f)
110 define i8 @test_signed_i8_f32(float %f) nounwind {
111 ; SOFT-LABEL: test_signed_i8_f32:
113 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
114 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
116 ; SOFT-NEXT: sub sp, #4
117 ; SOFT-NEXT: mov r4, r0
118 ; SOFT-NEXT: movs r0, #195
119 ; SOFT-NEXT: lsls r1, r0, #24
120 ; SOFT-NEXT: mov r0, r4
121 ; SOFT-NEXT: bl __aeabi_fcmpge
122 ; SOFT-NEXT: mov r7, r0
123 ; SOFT-NEXT: mov r0, r4
124 ; SOFT-NEXT: bl __aeabi_f2iz
125 ; SOFT-NEXT: movs r5, #127
126 ; SOFT-NEXT: cmp r7, #0
127 ; SOFT-NEXT: beq .LBB1_2
128 ; SOFT-NEXT: @ %bb.1:
129 ; SOFT-NEXT: mov r6, r0
130 ; SOFT-NEXT: b .LBB1_3
131 ; SOFT-NEXT: .LBB1_2:
132 ; SOFT-NEXT: mvns r6, r5
133 ; SOFT-NEXT: .LBB1_3:
134 ; SOFT-NEXT: ldr r1, .LCPI1_0
135 ; SOFT-NEXT: mov r0, r4
136 ; SOFT-NEXT: bl __aeabi_fcmpgt
137 ; SOFT-NEXT: cmp r0, #0
138 ; SOFT-NEXT: bne .LBB1_5
139 ; SOFT-NEXT: @ %bb.4:
140 ; SOFT-NEXT: mov r5, r6
141 ; SOFT-NEXT: .LBB1_5:
142 ; SOFT-NEXT: mov r0, r4
143 ; SOFT-NEXT: mov r1, r4
144 ; SOFT-NEXT: bl __aeabi_fcmpun
145 ; SOFT-NEXT: cmp r0, #0
146 ; SOFT-NEXT: beq .LBB1_7
147 ; SOFT-NEXT: @ %bb.6:
148 ; SOFT-NEXT: movs r5, #0
149 ; SOFT-NEXT: .LBB1_7:
150 ; SOFT-NEXT: mov r0, r5
151 ; SOFT-NEXT: add sp, #4
152 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
153 ; SOFT-NEXT: .p2align 2
154 ; SOFT-NEXT: @ %bb.8:
155 ; SOFT-NEXT: .LCPI1_0:
156 ; SOFT-NEXT: .long 1123942400 @ 0x42fe0000
158 ; VFP2-LABEL: test_signed_i8_f32:
160 ; VFP2-NEXT: vmov s0, r0
161 ; VFP2-NEXT: vldr s2, .LCPI1_0
162 ; VFP2-NEXT: vldr s6, .LCPI1_1
163 ; VFP2-NEXT: vcvt.s32.f32 s4, s0
164 ; VFP2-NEXT: vcmp.f32 s0, s2
165 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
166 ; VFP2-NEXT: vcmp.f32 s0, s6
167 ; VFP2-NEXT: vmov r0, s4
169 ; VFP2-NEXT: mvnlt r0, #127
170 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
172 ; VFP2-NEXT: movgt r0, #127
173 ; VFP2-NEXT: vcmp.f32 s0, s0
174 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
176 ; VFP2-NEXT: movvs r0, #0
178 ; VFP2-NEXT: .p2align 2
179 ; VFP2-NEXT: @ %bb.1:
180 ; VFP2-NEXT: .LCPI1_0:
181 ; VFP2-NEXT: .long 0xc3000000 @ float -128
182 ; VFP2-NEXT: .LCPI1_1:
183 ; VFP2-NEXT: .long 0x42fe0000 @ float 127
185 ; FP16-LABEL: test_signed_i8_f32:
187 ; FP16-NEXT: vldr s0, .LCPI1_0
188 ; FP16-NEXT: vmov s2, r0
189 ; FP16-NEXT: vldr s4, .LCPI1_1
190 ; FP16-NEXT: vmaxnm.f32 s0, s2, s0
191 ; FP16-NEXT: vcmp.f32 s2, s2
192 ; FP16-NEXT: vminnm.f32 s0, s0, s4
193 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
194 ; FP16-NEXT: vcvt.s32.f32 s0, s0
195 ; FP16-NEXT: vmov r0, s0
197 ; FP16-NEXT: movvs r0, #0
199 ; FP16-NEXT: .p2align 2
200 ; FP16-NEXT: @ %bb.1:
201 ; FP16-NEXT: .LCPI1_0:
202 ; FP16-NEXT: .long 0xc3000000 @ float -128
203 ; FP16-NEXT: .LCPI1_1:
204 ; FP16-NEXT: .long 0x42fe0000 @ float 127
205 %x = call i8 @llvm.fptosi.sat.i8.f32(float %f)
209 define i13 @test_signed_i13_f32(float %f) nounwind {
210 ; SOFT-LABEL: test_signed_i13_f32:
212 ; SOFT-NEXT: .save {r4, r5, r6, lr}
213 ; SOFT-NEXT: push {r4, r5, r6, lr}
214 ; SOFT-NEXT: mov r4, r0
215 ; SOFT-NEXT: ldr r1, .LCPI2_0
216 ; SOFT-NEXT: bl __aeabi_fcmpge
217 ; SOFT-NEXT: mov r6, r0
218 ; SOFT-NEXT: mov r0, r4
219 ; SOFT-NEXT: bl __aeabi_f2iz
220 ; SOFT-NEXT: cmp r6, #0
221 ; SOFT-NEXT: beq .LBB2_2
222 ; SOFT-NEXT: @ %bb.1:
223 ; SOFT-NEXT: mov r5, r0
224 ; SOFT-NEXT: b .LBB2_3
225 ; SOFT-NEXT: .LBB2_2:
226 ; SOFT-NEXT: ldr r5, .LCPI2_1
227 ; SOFT-NEXT: .LBB2_3:
228 ; SOFT-NEXT: ldr r1, .LCPI2_2
229 ; SOFT-NEXT: mov r0, r4
230 ; SOFT-NEXT: bl __aeabi_fcmpgt
231 ; SOFT-NEXT: cmp r0, #0
232 ; SOFT-NEXT: beq .LBB2_5
233 ; SOFT-NEXT: @ %bb.4:
234 ; SOFT-NEXT: ldr r5, .LCPI2_3
235 ; SOFT-NEXT: .LBB2_5:
236 ; SOFT-NEXT: mov r0, r4
237 ; SOFT-NEXT: mov r1, r4
238 ; SOFT-NEXT: bl __aeabi_fcmpun
239 ; SOFT-NEXT: cmp r0, #0
240 ; SOFT-NEXT: beq .LBB2_7
241 ; SOFT-NEXT: @ %bb.6:
242 ; SOFT-NEXT: movs r5, #0
243 ; SOFT-NEXT: .LBB2_7:
244 ; SOFT-NEXT: mov r0, r5
245 ; SOFT-NEXT: pop {r4, r5, r6, pc}
246 ; SOFT-NEXT: .p2align 2
247 ; SOFT-NEXT: @ %bb.8:
248 ; SOFT-NEXT: .LCPI2_0:
249 ; SOFT-NEXT: .long 3313500160 @ 0xc5800000
250 ; SOFT-NEXT: .LCPI2_1:
251 ; SOFT-NEXT: .long 4294963200 @ 0xfffff000
252 ; SOFT-NEXT: .LCPI2_2:
253 ; SOFT-NEXT: .long 1166012416 @ 0x457ff000
254 ; SOFT-NEXT: .LCPI2_3:
255 ; SOFT-NEXT: .long 4095 @ 0xfff
257 ; VFP2-LABEL: test_signed_i13_f32:
259 ; VFP2-NEXT: vmov s0, r0
260 ; VFP2-NEXT: vldr s2, .LCPI2_0
261 ; VFP2-NEXT: vcvt.s32.f32 s4, s0
262 ; VFP2-NEXT: vcmp.f32 s0, s2
263 ; VFP2-NEXT: vldr s2, .LCPI2_1
264 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
265 ; VFP2-NEXT: vcmp.f32 s0, s2
266 ; VFP2-NEXT: vmov r0, s4
268 ; VFP2-NEXT: movwlt r0, #61440
269 ; VFP2-NEXT: movtlt r0, #65535
270 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
272 ; VFP2-NEXT: movwgt r0, #4095
273 ; VFP2-NEXT: vcmp.f32 s0, s0
274 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
276 ; VFP2-NEXT: movvs r0, #0
278 ; VFP2-NEXT: .p2align 2
279 ; VFP2-NEXT: @ %bb.1:
280 ; VFP2-NEXT: .LCPI2_0:
281 ; VFP2-NEXT: .long 0xc5800000 @ float -4096
282 ; VFP2-NEXT: .LCPI2_1:
283 ; VFP2-NEXT: .long 0x457ff000 @ float 4095
285 ; FP16-LABEL: test_signed_i13_f32:
287 ; FP16-NEXT: vldr s0, .LCPI2_0
288 ; FP16-NEXT: vmov s2, r0
289 ; FP16-NEXT: vldr s4, .LCPI2_1
290 ; FP16-NEXT: vmaxnm.f32 s0, s2, s0
291 ; FP16-NEXT: vcmp.f32 s2, s2
292 ; FP16-NEXT: vminnm.f32 s0, s0, s4
293 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
294 ; FP16-NEXT: vcvt.s32.f32 s0, s0
295 ; FP16-NEXT: vmov r0, s0
297 ; FP16-NEXT: movvs r0, #0
299 ; FP16-NEXT: .p2align 2
300 ; FP16-NEXT: @ %bb.1:
301 ; FP16-NEXT: .LCPI2_0:
302 ; FP16-NEXT: .long 0xc5800000 @ float -4096
303 ; FP16-NEXT: .LCPI2_1:
304 ; FP16-NEXT: .long 0x457ff000 @ float 4095
305 %x = call i13 @llvm.fptosi.sat.i13.f32(float %f)
309 define i16 @test_signed_i16_f32(float %f) nounwind {
310 ; SOFT-LABEL: test_signed_i16_f32:
312 ; SOFT-NEXT: .save {r4, r5, r6, lr}
313 ; SOFT-NEXT: push {r4, r5, r6, lr}
314 ; SOFT-NEXT: mov r4, r0
315 ; SOFT-NEXT: movs r0, #199
316 ; SOFT-NEXT: lsls r1, r0, #24
317 ; SOFT-NEXT: mov r0, r4
318 ; SOFT-NEXT: bl __aeabi_fcmpge
319 ; SOFT-NEXT: mov r6, r0
320 ; SOFT-NEXT: mov r0, r4
321 ; SOFT-NEXT: bl __aeabi_f2iz
322 ; SOFT-NEXT: cmp r6, #0
323 ; SOFT-NEXT: beq .LBB3_2
324 ; SOFT-NEXT: @ %bb.1:
325 ; SOFT-NEXT: mov r5, r0
326 ; SOFT-NEXT: b .LBB3_3
327 ; SOFT-NEXT: .LBB3_2:
328 ; SOFT-NEXT: ldr r5, .LCPI3_0
329 ; SOFT-NEXT: .LBB3_3:
330 ; SOFT-NEXT: ldr r1, .LCPI3_1
331 ; SOFT-NEXT: mov r0, r4
332 ; SOFT-NEXT: bl __aeabi_fcmpgt
333 ; SOFT-NEXT: cmp r0, #0
334 ; SOFT-NEXT: beq .LBB3_5
335 ; SOFT-NEXT: @ %bb.4:
336 ; SOFT-NEXT: ldr r5, .LCPI3_2
337 ; SOFT-NEXT: .LBB3_5:
338 ; SOFT-NEXT: mov r0, r4
339 ; SOFT-NEXT: mov r1, r4
340 ; SOFT-NEXT: bl __aeabi_fcmpun
341 ; SOFT-NEXT: cmp r0, #0
342 ; SOFT-NEXT: beq .LBB3_7
343 ; SOFT-NEXT: @ %bb.6:
344 ; SOFT-NEXT: movs r5, #0
345 ; SOFT-NEXT: .LBB3_7:
346 ; SOFT-NEXT: mov r0, r5
347 ; SOFT-NEXT: pop {r4, r5, r6, pc}
348 ; SOFT-NEXT: .p2align 2
349 ; SOFT-NEXT: @ %bb.8:
350 ; SOFT-NEXT: .LCPI3_0:
351 ; SOFT-NEXT: .long 4294934528 @ 0xffff8000
352 ; SOFT-NEXT: .LCPI3_1:
353 ; SOFT-NEXT: .long 1191181824 @ 0x46fffe00
354 ; SOFT-NEXT: .LCPI3_2:
355 ; SOFT-NEXT: .long 32767 @ 0x7fff
357 ; VFP2-LABEL: test_signed_i16_f32:
359 ; VFP2-NEXT: vmov s0, r0
360 ; VFP2-NEXT: vldr s2, .LCPI3_0
361 ; VFP2-NEXT: vcvt.s32.f32 s4, s0
362 ; VFP2-NEXT: vcmp.f32 s0, s2
363 ; VFP2-NEXT: vldr s2, .LCPI3_1
364 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
365 ; VFP2-NEXT: vcmp.f32 s0, s2
366 ; VFP2-NEXT: vmov r0, s4
368 ; VFP2-NEXT: movwlt r0, #32768
369 ; VFP2-NEXT: movtlt r0, #65535
370 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
372 ; VFP2-NEXT: movwgt r0, #32767
373 ; VFP2-NEXT: vcmp.f32 s0, s0
374 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
376 ; VFP2-NEXT: movvs r0, #0
378 ; VFP2-NEXT: .p2align 2
379 ; VFP2-NEXT: @ %bb.1:
380 ; VFP2-NEXT: .LCPI3_0:
381 ; VFP2-NEXT: .long 0xc7000000 @ float -32768
382 ; VFP2-NEXT: .LCPI3_1:
383 ; VFP2-NEXT: .long 0x46fffe00 @ float 32767
385 ; FP16-LABEL: test_signed_i16_f32:
387 ; FP16-NEXT: vldr s0, .LCPI3_0
388 ; FP16-NEXT: vmov s2, r0
389 ; FP16-NEXT: vldr s4, .LCPI3_1
390 ; FP16-NEXT: vmaxnm.f32 s0, s2, s0
391 ; FP16-NEXT: vcmp.f32 s2, s2
392 ; FP16-NEXT: vminnm.f32 s0, s0, s4
393 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
394 ; FP16-NEXT: vcvt.s32.f32 s0, s0
395 ; FP16-NEXT: vmov r0, s0
397 ; FP16-NEXT: movvs r0, #0
399 ; FP16-NEXT: .p2align 2
400 ; FP16-NEXT: @ %bb.1:
401 ; FP16-NEXT: .LCPI3_0:
402 ; FP16-NEXT: .long 0xc7000000 @ float -32768
403 ; FP16-NEXT: .LCPI3_1:
404 ; FP16-NEXT: .long 0x46fffe00 @ float 32767
405 %x = call i16 @llvm.fptosi.sat.i16.f32(float %f)
409 define i19 @test_signed_i19_f32(float %f) nounwind {
410 ; SOFT-LABEL: test_signed_i19_f32:
412 ; SOFT-NEXT: .save {r4, r5, r6, lr}
413 ; SOFT-NEXT: push {r4, r5, r6, lr}
414 ; SOFT-NEXT: mov r4, r0
415 ; SOFT-NEXT: ldr r1, .LCPI4_0
416 ; SOFT-NEXT: bl __aeabi_fcmpge
417 ; SOFT-NEXT: mov r6, r0
418 ; SOFT-NEXT: mov r0, r4
419 ; SOFT-NEXT: bl __aeabi_f2iz
420 ; SOFT-NEXT: cmp r6, #0
421 ; SOFT-NEXT: beq .LBB4_2
422 ; SOFT-NEXT: @ %bb.1:
423 ; SOFT-NEXT: mov r5, r0
424 ; SOFT-NEXT: b .LBB4_3
425 ; SOFT-NEXT: .LBB4_2:
426 ; SOFT-NEXT: ldr r5, .LCPI4_1
427 ; SOFT-NEXT: .LBB4_3:
428 ; SOFT-NEXT: ldr r1, .LCPI4_2
429 ; SOFT-NEXT: mov r0, r4
430 ; SOFT-NEXT: bl __aeabi_fcmpgt
431 ; SOFT-NEXT: cmp r0, #0
432 ; SOFT-NEXT: beq .LBB4_5
433 ; SOFT-NEXT: @ %bb.4:
434 ; SOFT-NEXT: ldr r5, .LCPI4_3
435 ; SOFT-NEXT: .LBB4_5:
436 ; SOFT-NEXT: mov r0, r4
437 ; SOFT-NEXT: mov r1, r4
438 ; SOFT-NEXT: bl __aeabi_fcmpun
439 ; SOFT-NEXT: cmp r0, #0
440 ; SOFT-NEXT: beq .LBB4_7
441 ; SOFT-NEXT: @ %bb.6:
442 ; SOFT-NEXT: movs r5, #0
443 ; SOFT-NEXT: .LBB4_7:
444 ; SOFT-NEXT: mov r0, r5
445 ; SOFT-NEXT: pop {r4, r5, r6, pc}
446 ; SOFT-NEXT: .p2align 2
447 ; SOFT-NEXT: @ %bb.8:
448 ; SOFT-NEXT: .LCPI4_0:
449 ; SOFT-NEXT: .long 3363831808 @ 0xc8800000
450 ; SOFT-NEXT: .LCPI4_1:
451 ; SOFT-NEXT: .long 4294705152 @ 0xfffc0000
452 ; SOFT-NEXT: .LCPI4_2:
453 ; SOFT-NEXT: .long 1216348096 @ 0x487fffc0
454 ; SOFT-NEXT: .LCPI4_3:
455 ; SOFT-NEXT: .long 262143 @ 0x3ffff
457 ; VFP2-LABEL: test_signed_i19_f32:
459 ; VFP2-NEXT: vmov s0, r0
460 ; VFP2-NEXT: vldr s2, .LCPI4_0
461 ; VFP2-NEXT: vcvt.s32.f32 s4, s0
462 ; VFP2-NEXT: vcmp.f32 s0, s2
463 ; VFP2-NEXT: vldr s2, .LCPI4_1
464 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
465 ; VFP2-NEXT: vcmp.f32 s0, s2
466 ; VFP2-NEXT: vmov r0, s4
468 ; VFP2-NEXT: movlt r0, #0
469 ; VFP2-NEXT: movtlt r0, #65532
470 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
472 ; VFP2-NEXT: movwgt r0, #65535
473 ; VFP2-NEXT: movtgt r0, #3
474 ; VFP2-NEXT: vcmp.f32 s0, s0
475 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
477 ; VFP2-NEXT: movvs r0, #0
479 ; VFP2-NEXT: .p2align 2
480 ; VFP2-NEXT: @ %bb.1:
481 ; VFP2-NEXT: .LCPI4_0:
482 ; VFP2-NEXT: .long 0xc8800000 @ float -262144
483 ; VFP2-NEXT: .LCPI4_1:
484 ; VFP2-NEXT: .long 0x487fffc0 @ float 262143
486 ; FP16-LABEL: test_signed_i19_f32:
488 ; FP16-NEXT: vldr s0, .LCPI4_0
489 ; FP16-NEXT: vmov s2, r0
490 ; FP16-NEXT: vldr s4, .LCPI4_1
491 ; FP16-NEXT: vmaxnm.f32 s0, s2, s0
492 ; FP16-NEXT: vcmp.f32 s2, s2
493 ; FP16-NEXT: vminnm.f32 s0, s0, s4
494 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
495 ; FP16-NEXT: vcvt.s32.f32 s0, s0
496 ; FP16-NEXT: vmov r0, s0
498 ; FP16-NEXT: movvs r0, #0
500 ; FP16-NEXT: .p2align 2
501 ; FP16-NEXT: @ %bb.1:
502 ; FP16-NEXT: .LCPI4_0:
503 ; FP16-NEXT: .long 0xc8800000 @ float -262144
504 ; FP16-NEXT: .LCPI4_1:
505 ; FP16-NEXT: .long 0x487fffc0 @ float 262143
506 %x = call i19 @llvm.fptosi.sat.i19.f32(float %f)
510 define i32 @test_signed_i32_f32(float %f) nounwind {
511 ; SOFT-LABEL: test_signed_i32_f32:
513 ; SOFT-NEXT: .save {r4, r5, r6, lr}
514 ; SOFT-NEXT: push {r4, r5, r6, lr}
515 ; SOFT-NEXT: mov r4, r0
516 ; SOFT-NEXT: movs r0, #207
517 ; SOFT-NEXT: lsls r1, r0, #24
518 ; SOFT-NEXT: mov r0, r4
519 ; SOFT-NEXT: bl __aeabi_fcmpge
520 ; SOFT-NEXT: mov r6, r0
521 ; SOFT-NEXT: mov r0, r4
522 ; SOFT-NEXT: bl __aeabi_f2iz
523 ; SOFT-NEXT: cmp r6, #0
524 ; SOFT-NEXT: beq .LBB5_2
525 ; SOFT-NEXT: @ %bb.1:
526 ; SOFT-NEXT: mov r5, r0
527 ; SOFT-NEXT: b .LBB5_3
528 ; SOFT-NEXT: .LBB5_2:
529 ; SOFT-NEXT: movs r0, #1
530 ; SOFT-NEXT: lsls r5, r0, #31
531 ; SOFT-NEXT: .LBB5_3:
532 ; SOFT-NEXT: ldr r1, .LCPI5_0
533 ; SOFT-NEXT: mov r0, r4
534 ; SOFT-NEXT: bl __aeabi_fcmpgt
535 ; SOFT-NEXT: cmp r0, #0
536 ; SOFT-NEXT: beq .LBB5_5
537 ; SOFT-NEXT: @ %bb.4:
538 ; SOFT-NEXT: ldr r5, .LCPI5_1
539 ; SOFT-NEXT: .LBB5_5:
540 ; SOFT-NEXT: mov r0, r4
541 ; SOFT-NEXT: mov r1, r4
542 ; SOFT-NEXT: bl __aeabi_fcmpun
543 ; SOFT-NEXT: cmp r0, #0
544 ; SOFT-NEXT: beq .LBB5_7
545 ; SOFT-NEXT: @ %bb.6:
546 ; SOFT-NEXT: movs r5, #0
547 ; SOFT-NEXT: .LBB5_7:
548 ; SOFT-NEXT: mov r0, r5
549 ; SOFT-NEXT: pop {r4, r5, r6, pc}
550 ; SOFT-NEXT: .p2align 2
551 ; SOFT-NEXT: @ %bb.8:
552 ; SOFT-NEXT: .LCPI5_0:
553 ; SOFT-NEXT: .long 1325400063 @ 0x4effffff
554 ; SOFT-NEXT: .LCPI5_1:
555 ; SOFT-NEXT: .long 2147483647 @ 0x7fffffff
557 ; VFP-LABEL: test_signed_i32_f32:
559 ; VFP-NEXT: vmov s0, r0
560 ; VFP-NEXT: vcvt.s32.f32 s0, s0
561 ; VFP-NEXT: vmov r0, s0
563 %x = call i32 @llvm.fptosi.sat.i32.f32(float %f)
567 define i50 @test_signed_i50_f32(float %f) nounwind {
568 ; SOFT-LABEL: test_signed_i50_f32:
570 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
571 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
572 ; SOFT-NEXT: .pad #12
573 ; SOFT-NEXT: sub sp, #12
574 ; SOFT-NEXT: mov r7, r0
575 ; SOFT-NEXT: ldr r1, .LCPI6_0
576 ; SOFT-NEXT: bl __aeabi_fcmpgt
577 ; SOFT-NEXT: str r0, [sp, #8] @ 4-byte Spill
578 ; SOFT-NEXT: movs r0, #27
579 ; SOFT-NEXT: lsls r1, r0, #27
580 ; SOFT-NEXT: mov r0, r7
581 ; SOFT-NEXT: bl __aeabi_fcmpge
582 ; SOFT-NEXT: mov r5, r0
583 ; SOFT-NEXT: mov r0, r7
584 ; SOFT-NEXT: bl __aeabi_f2lz
585 ; SOFT-NEXT: mov r4, r0
586 ; SOFT-NEXT: str r1, [sp, #4] @ 4-byte Spill
587 ; SOFT-NEXT: cmp r5, #0
588 ; SOFT-NEXT: bne .LBB6_2
589 ; SOFT-NEXT: @ %bb.1:
590 ; SOFT-NEXT: mov r4, r5
591 ; SOFT-NEXT: .LBB6_2:
592 ; SOFT-NEXT: movs r6, #0
593 ; SOFT-NEXT: ldr r0, [sp, #8] @ 4-byte Reload
594 ; SOFT-NEXT: cmp r0, #0
595 ; SOFT-NEXT: beq .LBB6_4
596 ; SOFT-NEXT: @ %bb.3:
597 ; SOFT-NEXT: mvns r4, r6
598 ; SOFT-NEXT: .LBB6_4:
599 ; SOFT-NEXT: mov r0, r7
600 ; SOFT-NEXT: mov r1, r7
601 ; SOFT-NEXT: bl __aeabi_fcmpun
602 ; SOFT-NEXT: mov r1, r0
603 ; SOFT-NEXT: cmp r0, #0
604 ; SOFT-NEXT: mov r0, r6
605 ; SOFT-NEXT: bne .LBB6_6
606 ; SOFT-NEXT: @ %bb.5:
607 ; SOFT-NEXT: mov r0, r4
608 ; SOFT-NEXT: .LBB6_6:
609 ; SOFT-NEXT: cmp r5, #0
610 ; SOFT-NEXT: beq .LBB6_8
611 ; SOFT-NEXT: @ %bb.7:
612 ; SOFT-NEXT: ldr r3, [sp, #4] @ 4-byte Reload
613 ; SOFT-NEXT: b .LBB6_9
614 ; SOFT-NEXT: .LBB6_8:
615 ; SOFT-NEXT: ldr r3, .LCPI6_1
616 ; SOFT-NEXT: .LBB6_9:
617 ; SOFT-NEXT: ldr r2, [sp, #8] @ 4-byte Reload
618 ; SOFT-NEXT: cmp r2, #0
619 ; SOFT-NEXT: beq .LBB6_11
620 ; SOFT-NEXT: @ %bb.10:
621 ; SOFT-NEXT: ldr r3, .LCPI6_2
622 ; SOFT-NEXT: .LBB6_11:
623 ; SOFT-NEXT: cmp r1, #0
624 ; SOFT-NEXT: bne .LBB6_13
625 ; SOFT-NEXT: @ %bb.12:
626 ; SOFT-NEXT: mov r6, r3
627 ; SOFT-NEXT: .LBB6_13:
628 ; SOFT-NEXT: mov r1, r6
629 ; SOFT-NEXT: add sp, #12
630 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
631 ; SOFT-NEXT: .p2align 2
632 ; SOFT-NEXT: @ %bb.14:
633 ; SOFT-NEXT: .LCPI6_0:
634 ; SOFT-NEXT: .long 1476395007 @ 0x57ffffff
635 ; SOFT-NEXT: .LCPI6_1:
636 ; SOFT-NEXT: .long 4294836224 @ 0xfffe0000
637 ; SOFT-NEXT: .LCPI6_2:
638 ; SOFT-NEXT: .long 131071 @ 0x1ffff
640 ; VFP-LABEL: test_signed_i50_f32:
642 ; VFP-NEXT: .save {r7, lr}
643 ; VFP-NEXT: push {r7, lr}
644 ; VFP-NEXT: .vsave {d8}
645 ; VFP-NEXT: vpush {d8}
646 ; VFP-NEXT: vmov s16, r0
647 ; VFP-NEXT: bl __aeabi_f2lz
648 ; VFP-NEXT: vldr s0, .LCPI6_0
649 ; VFP-NEXT: vldr s2, .LCPI6_1
650 ; VFP-NEXT: vcmp.f32 s16, s0
651 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
652 ; VFP-NEXT: vcmp.f32 s16, s2
654 ; VFP-NEXT: movlt r1, #0
655 ; VFP-NEXT: movtlt r1, #65534
656 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
657 ; VFP-NEXT: vcmp.f32 s16, s0
659 ; VFP-NEXT: movwgt r1, #65535
660 ; VFP-NEXT: movtgt r1, #1
661 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
663 ; VFP-NEXT: movlt r0, #0
664 ; VFP-NEXT: vcmp.f32 s16, s2
665 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
667 ; VFP-NEXT: movgt.w r0, #-1
668 ; VFP-NEXT: vcmp.f32 s16, s16
669 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
671 ; VFP-NEXT: movvs r0, #0
672 ; VFP-NEXT: movvs r1, #0
673 ; VFP-NEXT: vpop {d8}
674 ; VFP-NEXT: pop {r7, pc}
675 ; VFP-NEXT: .p2align 2
677 ; VFP-NEXT: .LCPI6_0:
678 ; VFP-NEXT: .long 0xd8000000 @ float -5.62949953E+14
679 ; VFP-NEXT: .LCPI6_1:
680 ; VFP-NEXT: .long 0x57ffffff @ float 5.6294992E+14
681 %x = call i50 @llvm.fptosi.sat.i50.f32(float %f)
685 define i64 @test_signed_i64_f32(float %f) nounwind {
686 ; SOFT-LABEL: test_signed_i64_f32:
688 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
689 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
690 ; SOFT-NEXT: .pad #12
691 ; SOFT-NEXT: sub sp, #12
692 ; SOFT-NEXT: mov r7, r0
693 ; SOFT-NEXT: ldr r1, .LCPI7_0
694 ; SOFT-NEXT: bl __aeabi_fcmpgt
695 ; SOFT-NEXT: str r0, [sp, #8] @ 4-byte Spill
696 ; SOFT-NEXT: movs r0, #223
697 ; SOFT-NEXT: lsls r1, r0, #24
698 ; SOFT-NEXT: mov r0, r7
699 ; SOFT-NEXT: bl __aeabi_fcmpge
700 ; SOFT-NEXT: mov r5, r0
701 ; SOFT-NEXT: mov r0, r7
702 ; SOFT-NEXT: bl __aeabi_f2lz
703 ; SOFT-NEXT: mov r4, r0
704 ; SOFT-NEXT: str r1, [sp, #4] @ 4-byte Spill
705 ; SOFT-NEXT: cmp r5, #0
706 ; SOFT-NEXT: bne .LBB7_2
707 ; SOFT-NEXT: @ %bb.1:
708 ; SOFT-NEXT: mov r4, r5
709 ; SOFT-NEXT: .LBB7_2:
710 ; SOFT-NEXT: movs r6, #0
711 ; SOFT-NEXT: ldr r0, [sp, #8] @ 4-byte Reload
712 ; SOFT-NEXT: cmp r0, #0
713 ; SOFT-NEXT: beq .LBB7_4
714 ; SOFT-NEXT: @ %bb.3:
715 ; SOFT-NEXT: mvns r4, r6
716 ; SOFT-NEXT: .LBB7_4:
717 ; SOFT-NEXT: mov r0, r7
718 ; SOFT-NEXT: mov r1, r7
719 ; SOFT-NEXT: bl __aeabi_fcmpun
720 ; SOFT-NEXT: mov r1, r0
721 ; SOFT-NEXT: cmp r0, #0
722 ; SOFT-NEXT: mov r0, r6
723 ; SOFT-NEXT: bne .LBB7_6
724 ; SOFT-NEXT: @ %bb.5:
725 ; SOFT-NEXT: mov r0, r4
726 ; SOFT-NEXT: .LBB7_6:
727 ; SOFT-NEXT: cmp r5, #0
728 ; SOFT-NEXT: beq .LBB7_8
729 ; SOFT-NEXT: @ %bb.7:
730 ; SOFT-NEXT: ldr r3, [sp, #4] @ 4-byte Reload
731 ; SOFT-NEXT: b .LBB7_9
732 ; SOFT-NEXT: .LBB7_8:
733 ; SOFT-NEXT: movs r2, #1
734 ; SOFT-NEXT: lsls r3, r2, #31
735 ; SOFT-NEXT: .LBB7_9:
736 ; SOFT-NEXT: ldr r2, [sp, #8] @ 4-byte Reload
737 ; SOFT-NEXT: cmp r2, #0
738 ; SOFT-NEXT: beq .LBB7_11
739 ; SOFT-NEXT: @ %bb.10:
740 ; SOFT-NEXT: ldr r3, .LCPI7_1
741 ; SOFT-NEXT: .LBB7_11:
742 ; SOFT-NEXT: cmp r1, #0
743 ; SOFT-NEXT: bne .LBB7_13
744 ; SOFT-NEXT: @ %bb.12:
745 ; SOFT-NEXT: mov r6, r3
746 ; SOFT-NEXT: .LBB7_13:
747 ; SOFT-NEXT: mov r1, r6
748 ; SOFT-NEXT: add sp, #12
749 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
750 ; SOFT-NEXT: .p2align 2
751 ; SOFT-NEXT: @ %bb.14:
752 ; SOFT-NEXT: .LCPI7_0:
753 ; SOFT-NEXT: .long 1593835519 @ 0x5effffff
754 ; SOFT-NEXT: .LCPI7_1:
755 ; SOFT-NEXT: .long 2147483647 @ 0x7fffffff
757 ; VFP-LABEL: test_signed_i64_f32:
759 ; VFP-NEXT: .save {r4, lr}
760 ; VFP-NEXT: push {r4, lr}
761 ; VFP-NEXT: mov r4, r0
762 ; VFP-NEXT: bl __aeabi_f2lz
763 ; VFP-NEXT: vldr s0, .LCPI7_0
764 ; VFP-NEXT: vmov s2, r4
765 ; VFP-NEXT: vldr s4, .LCPI7_1
766 ; VFP-NEXT: vcmp.f32 s2, s0
767 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
768 ; VFP-NEXT: vcmp.f32 s2, s4
770 ; VFP-NEXT: movlt r0, #0
771 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
772 ; VFP-NEXT: vcmp.f32 s2, s2
774 ; VFP-NEXT: movgt.w r0, #-1
775 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
776 ; VFP-NEXT: vcmp.f32 s2, s0
778 ; VFP-NEXT: movvs r0, #0
779 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
781 ; VFP-NEXT: movlt.w r1, #-2147483648
782 ; VFP-NEXT: vcmp.f32 s2, s4
783 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
785 ; VFP-NEXT: mvngt r1, #-2147483648
786 ; VFP-NEXT: vcmp.f32 s2, s2
787 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
789 ; VFP-NEXT: movvs r1, #0
790 ; VFP-NEXT: pop {r4, pc}
791 ; VFP-NEXT: .p2align 2
793 ; VFP-NEXT: .LCPI7_0:
794 ; VFP-NEXT: .long 0xdf000000 @ float -9.22337203E+18
795 ; VFP-NEXT: .LCPI7_1:
796 ; VFP-NEXT: .long 0x5effffff @ float 9.22337149E+18
797 %x = call i64 @llvm.fptosi.sat.i64.f32(float %f)
801 define i100 @test_signed_i100_f32(float %f) nounwind {
802 ; SOFT-LABEL: test_signed_i100_f32:
804 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
805 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
806 ; SOFT-NEXT: .pad #20
807 ; SOFT-NEXT: sub sp, #20
808 ; SOFT-NEXT: mov r6, r0
809 ; SOFT-NEXT: ldr r1, .LCPI8_0
810 ; SOFT-NEXT: bl __aeabi_fcmpgt
811 ; SOFT-NEXT: mov r4, r0
812 ; SOFT-NEXT: movs r0, #241
813 ; SOFT-NEXT: lsls r1, r0, #24
814 ; SOFT-NEXT: mov r0, r6
815 ; SOFT-NEXT: bl __aeabi_fcmpge
816 ; SOFT-NEXT: mov r7, r0
817 ; SOFT-NEXT: mov r0, r6
818 ; SOFT-NEXT: bl __fixsfti
819 ; SOFT-NEXT: str r1, [sp, #4] @ 4-byte Spill
820 ; SOFT-NEXT: str r2, [sp, #12] @ 4-byte Spill
821 ; SOFT-NEXT: str r3, [sp] @ 4-byte Spill
822 ; SOFT-NEXT: cmp r7, #0
823 ; SOFT-NEXT: bne .LBB8_2
824 ; SOFT-NEXT: @ %bb.1:
825 ; SOFT-NEXT: mov r0, r7
826 ; SOFT-NEXT: .LBB8_2:
827 ; SOFT-NEXT: movs r5, #0
828 ; SOFT-NEXT: mvns r1, r5
829 ; SOFT-NEXT: str r4, [sp, #16] @ 4-byte Spill
830 ; SOFT-NEXT: cmp r4, #0
831 ; SOFT-NEXT: str r1, [sp, #8] @ 4-byte Spill
832 ; SOFT-NEXT: mov r4, r1
833 ; SOFT-NEXT: bne .LBB8_4
834 ; SOFT-NEXT: @ %bb.3:
835 ; SOFT-NEXT: mov r4, r0
836 ; SOFT-NEXT: .LBB8_4:
837 ; SOFT-NEXT: mov r0, r6
838 ; SOFT-NEXT: mov r1, r6
839 ; SOFT-NEXT: bl __aeabi_fcmpun
840 ; SOFT-NEXT: mov r3, r0
841 ; SOFT-NEXT: cmp r0, #0
842 ; SOFT-NEXT: mov r0, r5
843 ; SOFT-NEXT: bne .LBB8_6
844 ; SOFT-NEXT: @ %bb.5:
845 ; SOFT-NEXT: mov r0, r4
846 ; SOFT-NEXT: .LBB8_6:
847 ; SOFT-NEXT: cmp r7, #0
848 ; SOFT-NEXT: ldr r6, [sp, #8] @ 4-byte Reload
849 ; SOFT-NEXT: bne .LBB8_8
850 ; SOFT-NEXT: @ %bb.7:
851 ; SOFT-NEXT: str r7, [sp, #4] @ 4-byte Spill
852 ; SOFT-NEXT: .LBB8_8:
853 ; SOFT-NEXT: ldr r4, [sp, #16] @ 4-byte Reload
854 ; SOFT-NEXT: cmp r4, #0
855 ; SOFT-NEXT: mov r2, r6
856 ; SOFT-NEXT: bne .LBB8_10
857 ; SOFT-NEXT: @ %bb.9:
858 ; SOFT-NEXT: ldr r2, [sp, #4] @ 4-byte Reload
859 ; SOFT-NEXT: .LBB8_10:
860 ; SOFT-NEXT: cmp r3, #0
861 ; SOFT-NEXT: mov r1, r5
862 ; SOFT-NEXT: beq .LBB8_18
863 ; SOFT-NEXT: @ %bb.11:
864 ; SOFT-NEXT: cmp r7, #0
865 ; SOFT-NEXT: beq .LBB8_19
866 ; SOFT-NEXT: .LBB8_12:
867 ; SOFT-NEXT: cmp r4, #0
868 ; SOFT-NEXT: bne .LBB8_14
869 ; SOFT-NEXT: .LBB8_13:
870 ; SOFT-NEXT: ldr r6, [sp, #12] @ 4-byte Reload
871 ; SOFT-NEXT: .LBB8_14:
872 ; SOFT-NEXT: cmp r3, #0
873 ; SOFT-NEXT: mov r2, r5
874 ; SOFT-NEXT: bne .LBB8_16
875 ; SOFT-NEXT: @ %bb.15:
876 ; SOFT-NEXT: mov r2, r6
877 ; SOFT-NEXT: .LBB8_16:
878 ; SOFT-NEXT: movs r4, #7
879 ; SOFT-NEXT: cmp r7, #0
880 ; SOFT-NEXT: beq .LBB8_20
881 ; SOFT-NEXT: @ %bb.17:
882 ; SOFT-NEXT: ldr r7, [sp] @ 4-byte Reload
883 ; SOFT-NEXT: b .LBB8_21
884 ; SOFT-NEXT: .LBB8_18:
885 ; SOFT-NEXT: mov r1, r2
886 ; SOFT-NEXT: cmp r7, #0
887 ; SOFT-NEXT: bne .LBB8_12
888 ; SOFT-NEXT: .LBB8_19:
889 ; SOFT-NEXT: str r7, [sp, #12] @ 4-byte Spill
890 ; SOFT-NEXT: cmp r4, #0
891 ; SOFT-NEXT: beq .LBB8_13
892 ; SOFT-NEXT: b .LBB8_14
893 ; SOFT-NEXT: .LBB8_20:
894 ; SOFT-NEXT: mvns r7, r4
895 ; SOFT-NEXT: .LBB8_21:
896 ; SOFT-NEXT: ldr r6, [sp, #16] @ 4-byte Reload
897 ; SOFT-NEXT: cmp r6, #0
898 ; SOFT-NEXT: bne .LBB8_23
899 ; SOFT-NEXT: @ %bb.22:
900 ; SOFT-NEXT: mov r4, r7
901 ; SOFT-NEXT: .LBB8_23:
902 ; SOFT-NEXT: cmp r3, #0
903 ; SOFT-NEXT: bne .LBB8_25
904 ; SOFT-NEXT: @ %bb.24:
905 ; SOFT-NEXT: mov r5, r4
906 ; SOFT-NEXT: .LBB8_25:
907 ; SOFT-NEXT: mov r3, r5
908 ; SOFT-NEXT: add sp, #20
909 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
910 ; SOFT-NEXT: .p2align 2
911 ; SOFT-NEXT: @ %bb.26:
912 ; SOFT-NEXT: .LCPI8_0:
913 ; SOFT-NEXT: .long 1895825407 @ 0x70ffffff
915 ; VFP-LABEL: test_signed_i100_f32:
917 ; VFP-NEXT: .save {r4, lr}
918 ; VFP-NEXT: push {r4, lr}
919 ; VFP-NEXT: mov r4, r0
920 ; VFP-NEXT: bl __fixsfti
921 ; VFP-NEXT: vldr s0, .LCPI8_0
922 ; VFP-NEXT: vmov s2, r4
923 ; VFP-NEXT: vldr s4, .LCPI8_1
924 ; VFP-NEXT: vcmp.f32 s2, s0
925 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
926 ; VFP-NEXT: vcmp.f32 s2, s4
928 ; VFP-NEXT: movlt r0, #0
929 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
930 ; VFP-NEXT: vcmp.f32 s2, s2
932 ; VFP-NEXT: movgt.w r0, #-1
933 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
934 ; VFP-NEXT: vcmp.f32 s2, s0
936 ; VFP-NEXT: movvs r0, #0
937 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
938 ; VFP-NEXT: vcmp.f32 s2, s4
940 ; VFP-NEXT: movlt r1, #0
941 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
942 ; VFP-NEXT: vcmp.f32 s2, s2
944 ; VFP-NEXT: movgt.w r1, #-1
945 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
946 ; VFP-NEXT: vcmp.f32 s2, s0
948 ; VFP-NEXT: movvs r1, #0
949 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
950 ; VFP-NEXT: vcmp.f32 s2, s4
952 ; VFP-NEXT: movlt r2, #0
953 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
954 ; VFP-NEXT: vcmp.f32 s2, s2
956 ; VFP-NEXT: movgt.w r2, #-1
957 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
958 ; VFP-NEXT: vcmp.f32 s2, s0
960 ; VFP-NEXT: movvs r2, #0
961 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
963 ; VFP-NEXT: mvnlt r3, #7
964 ; VFP-NEXT: vcmp.f32 s2, s4
965 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
967 ; VFP-NEXT: movgt r3, #7
968 ; VFP-NEXT: vcmp.f32 s2, s2
969 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
971 ; VFP-NEXT: movvs r3, #0
972 ; VFP-NEXT: pop {r4, pc}
973 ; VFP-NEXT: .p2align 2
975 ; VFP-NEXT: .LCPI8_0:
976 ; VFP-NEXT: .long 0xf1000000 @ float -6.338253E+29
977 ; VFP-NEXT: .LCPI8_1:
978 ; VFP-NEXT: .long 0x70ffffff @ float 6.33825262E+29
979 %x = call i100 @llvm.fptosi.sat.i100.f32(float %f)
983 define i128 @test_signed_i128_f32(float %f) nounwind {
984 ; SOFT-LABEL: test_signed_i128_f32:
986 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
987 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
988 ; SOFT-NEXT: .pad #20
989 ; SOFT-NEXT: sub sp, #20
990 ; SOFT-NEXT: mov r6, r0
991 ; SOFT-NEXT: ldr r1, .LCPI9_0
992 ; SOFT-NEXT: bl __aeabi_fcmpgt
993 ; SOFT-NEXT: mov r4, r0
994 ; SOFT-NEXT: movs r0, #255
995 ; SOFT-NEXT: lsls r1, r0, #24
996 ; SOFT-NEXT: mov r0, r6
997 ; SOFT-NEXT: bl __aeabi_fcmpge
998 ; SOFT-NEXT: mov r7, r0
999 ; SOFT-NEXT: mov r0, r6
1000 ; SOFT-NEXT: bl __fixsfti
1001 ; SOFT-NEXT: str r1, [sp, #4] @ 4-byte Spill
1002 ; SOFT-NEXT: str r2, [sp, #12] @ 4-byte Spill
1003 ; SOFT-NEXT: str r3, [sp] @ 4-byte Spill
1004 ; SOFT-NEXT: cmp r7, #0
1005 ; SOFT-NEXT: bne .LBB9_2
1006 ; SOFT-NEXT: @ %bb.1:
1007 ; SOFT-NEXT: mov r0, r7
1008 ; SOFT-NEXT: .LBB9_2:
1009 ; SOFT-NEXT: movs r5, #0
1010 ; SOFT-NEXT: mvns r1, r5
1011 ; SOFT-NEXT: str r4, [sp, #16] @ 4-byte Spill
1012 ; SOFT-NEXT: cmp r4, #0
1013 ; SOFT-NEXT: str r1, [sp, #8] @ 4-byte Spill
1014 ; SOFT-NEXT: mov r4, r1
1015 ; SOFT-NEXT: bne .LBB9_4
1016 ; SOFT-NEXT: @ %bb.3:
1017 ; SOFT-NEXT: mov r4, r0
1018 ; SOFT-NEXT: .LBB9_4:
1019 ; SOFT-NEXT: mov r0, r6
1020 ; SOFT-NEXT: mov r1, r6
1021 ; SOFT-NEXT: bl __aeabi_fcmpun
1022 ; SOFT-NEXT: mov r3, r0
1023 ; SOFT-NEXT: cmp r0, #0
1024 ; SOFT-NEXT: mov r0, r5
1025 ; SOFT-NEXT: bne .LBB9_6
1026 ; SOFT-NEXT: @ %bb.5:
1027 ; SOFT-NEXT: mov r0, r4
1028 ; SOFT-NEXT: .LBB9_6:
1029 ; SOFT-NEXT: cmp r7, #0
1030 ; SOFT-NEXT: ldr r6, [sp, #8] @ 4-byte Reload
1031 ; SOFT-NEXT: bne .LBB9_8
1032 ; SOFT-NEXT: @ %bb.7:
1033 ; SOFT-NEXT: str r7, [sp, #4] @ 4-byte Spill
1034 ; SOFT-NEXT: .LBB9_8:
1035 ; SOFT-NEXT: ldr r4, [sp, #16] @ 4-byte Reload
1036 ; SOFT-NEXT: cmp r4, #0
1037 ; SOFT-NEXT: mov r2, r6
1038 ; SOFT-NEXT: bne .LBB9_10
1039 ; SOFT-NEXT: @ %bb.9:
1040 ; SOFT-NEXT: ldr r2, [sp, #4] @ 4-byte Reload
1041 ; SOFT-NEXT: .LBB9_10:
1042 ; SOFT-NEXT: cmp r3, #0
1043 ; SOFT-NEXT: mov r1, r5
1044 ; SOFT-NEXT: beq .LBB9_18
1045 ; SOFT-NEXT: @ %bb.11:
1046 ; SOFT-NEXT: cmp r7, #0
1047 ; SOFT-NEXT: beq .LBB9_19
1048 ; SOFT-NEXT: .LBB9_12:
1049 ; SOFT-NEXT: cmp r4, #0
1050 ; SOFT-NEXT: bne .LBB9_14
1051 ; SOFT-NEXT: .LBB9_13:
1052 ; SOFT-NEXT: ldr r6, [sp, #12] @ 4-byte Reload
1053 ; SOFT-NEXT: .LBB9_14:
1054 ; SOFT-NEXT: cmp r3, #0
1055 ; SOFT-NEXT: mov r2, r5
1056 ; SOFT-NEXT: bne .LBB9_16
1057 ; SOFT-NEXT: @ %bb.15:
1058 ; SOFT-NEXT: mov r2, r6
1059 ; SOFT-NEXT: .LBB9_16:
1060 ; SOFT-NEXT: cmp r7, #0
1061 ; SOFT-NEXT: beq .LBB9_20
1062 ; SOFT-NEXT: @ %bb.17:
1063 ; SOFT-NEXT: ldr r6, [sp] @ 4-byte Reload
1064 ; SOFT-NEXT: cmp r4, #0
1065 ; SOFT-NEXT: bne .LBB9_21
1066 ; SOFT-NEXT: b .LBB9_22
1067 ; SOFT-NEXT: .LBB9_18:
1068 ; SOFT-NEXT: mov r1, r2
1069 ; SOFT-NEXT: cmp r7, #0
1070 ; SOFT-NEXT: bne .LBB9_12
1071 ; SOFT-NEXT: .LBB9_19:
1072 ; SOFT-NEXT: str r7, [sp, #12] @ 4-byte Spill
1073 ; SOFT-NEXT: cmp r4, #0
1074 ; SOFT-NEXT: beq .LBB9_13
1075 ; SOFT-NEXT: b .LBB9_14
1076 ; SOFT-NEXT: .LBB9_20:
1077 ; SOFT-NEXT: movs r4, #1
1078 ; SOFT-NEXT: lsls r6, r4, #31
1079 ; SOFT-NEXT: ldr r4, [sp, #16] @ 4-byte Reload
1080 ; SOFT-NEXT: cmp r4, #0
1081 ; SOFT-NEXT: beq .LBB9_22
1082 ; SOFT-NEXT: .LBB9_21:
1083 ; SOFT-NEXT: ldr r6, .LCPI9_1
1084 ; SOFT-NEXT: .LBB9_22:
1085 ; SOFT-NEXT: cmp r3, #0
1086 ; SOFT-NEXT: bne .LBB9_24
1087 ; SOFT-NEXT: @ %bb.23:
1088 ; SOFT-NEXT: mov r5, r6
1089 ; SOFT-NEXT: .LBB9_24:
1090 ; SOFT-NEXT: mov r3, r5
1091 ; SOFT-NEXT: add sp, #20
1092 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
1093 ; SOFT-NEXT: .p2align 2
1094 ; SOFT-NEXT: @ %bb.25:
1095 ; SOFT-NEXT: .LCPI9_0:
1096 ; SOFT-NEXT: .long 2130706431 @ 0x7effffff
1097 ; SOFT-NEXT: .LCPI9_1:
1098 ; SOFT-NEXT: .long 2147483647 @ 0x7fffffff
1100 ; VFP-LABEL: test_signed_i128_f32:
1102 ; VFP-NEXT: .save {r4, lr}
1103 ; VFP-NEXT: push {r4, lr}
1104 ; VFP-NEXT: mov r4, r0
1105 ; VFP-NEXT: bl __fixsfti
1106 ; VFP-NEXT: vldr s0, .LCPI9_0
1107 ; VFP-NEXT: vmov s2, r4
1108 ; VFP-NEXT: vldr s4, .LCPI9_1
1109 ; VFP-NEXT: vcmp.f32 s2, s0
1110 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
1111 ; VFP-NEXT: vcmp.f32 s2, s4
1113 ; VFP-NEXT: movlt r0, #0
1114 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
1115 ; VFP-NEXT: vcmp.f32 s2, s2
1117 ; VFP-NEXT: movgt.w r0, #-1
1118 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
1119 ; VFP-NEXT: vcmp.f32 s2, s0
1121 ; VFP-NEXT: movvs r0, #0
1122 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
1123 ; VFP-NEXT: vcmp.f32 s2, s4
1125 ; VFP-NEXT: movlt r1, #0
1126 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
1127 ; VFP-NEXT: vcmp.f32 s2, s2
1129 ; VFP-NEXT: movgt.w r1, #-1
1130 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
1131 ; VFP-NEXT: vcmp.f32 s2, s0
1133 ; VFP-NEXT: movvs r1, #0
1134 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
1135 ; VFP-NEXT: vcmp.f32 s2, s4
1137 ; VFP-NEXT: movlt r2, #0
1138 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
1139 ; VFP-NEXT: vcmp.f32 s2, s2
1141 ; VFP-NEXT: movgt.w r2, #-1
1142 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
1143 ; VFP-NEXT: vcmp.f32 s2, s0
1145 ; VFP-NEXT: movvs r2, #0
1146 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
1148 ; VFP-NEXT: movlt.w r3, #-2147483648
1149 ; VFP-NEXT: vcmp.f32 s2, s4
1150 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
1152 ; VFP-NEXT: mvngt r3, #-2147483648
1153 ; VFP-NEXT: vcmp.f32 s2, s2
1154 ; VFP-NEXT: vmrs APSR_nzcv, fpscr
1156 ; VFP-NEXT: movvs r3, #0
1157 ; VFP-NEXT: pop {r4, pc}
1158 ; VFP-NEXT: .p2align 2
1159 ; VFP-NEXT: @ %bb.1:
1160 ; VFP-NEXT: .LCPI9_0:
1161 ; VFP-NEXT: .long 0xff000000 @ float -1.70141183E+38
1162 ; VFP-NEXT: .LCPI9_1:
1163 ; VFP-NEXT: .long 0x7effffff @ float 1.70141173E+38
1164 %x = call i128 @llvm.fptosi.sat.i128.f32(float %f)
1169 ; 64-bit float to signed integer
1172 declare i1 @llvm.fptosi.sat.i1.f64 (double)
1173 declare i8 @llvm.fptosi.sat.i8.f64 (double)
1174 declare i13 @llvm.fptosi.sat.i13.f64 (double)
1175 declare i16 @llvm.fptosi.sat.i16.f64 (double)
1176 declare i19 @llvm.fptosi.sat.i19.f64 (double)
1177 declare i32 @llvm.fptosi.sat.i32.f64 (double)
1178 declare i50 @llvm.fptosi.sat.i50.f64 (double)
1179 declare i64 @llvm.fptosi.sat.i64.f64 (double)
1180 declare i100 @llvm.fptosi.sat.i100.f64(double)
1181 declare i128 @llvm.fptosi.sat.i128.f64(double)
1183 define i1 @test_signed_i1_f64(double %f) nounwind {
1184 ; SOFT-LABEL: test_signed_i1_f64:
1186 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
1187 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
1188 ; SOFT-NEXT: .pad #4
1189 ; SOFT-NEXT: sub sp, #4
1190 ; SOFT-NEXT: mov r5, r1
1191 ; SOFT-NEXT: mov r6, r0
1192 ; SOFT-NEXT: movs r4, #0
1193 ; SOFT-NEXT: ldr r3, .LCPI10_0
1194 ; SOFT-NEXT: mov r2, r4
1195 ; SOFT-NEXT: bl __aeabi_dcmpge
1196 ; SOFT-NEXT: mov r7, r0
1197 ; SOFT-NEXT: mov r0, r6
1198 ; SOFT-NEXT: mov r1, r5
1199 ; SOFT-NEXT: bl __aeabi_d2iz
1200 ; SOFT-NEXT: cmp r7, #0
1201 ; SOFT-NEXT: bne .LBB10_2
1202 ; SOFT-NEXT: @ %bb.1:
1203 ; SOFT-NEXT: mvns r0, r4
1204 ; SOFT-NEXT: .LBB10_2:
1205 ; SOFT-NEXT: str r0, [sp] @ 4-byte Spill
1206 ; SOFT-NEXT: mov r0, r6
1207 ; SOFT-NEXT: mov r1, r5
1208 ; SOFT-NEXT: mov r2, r4
1209 ; SOFT-NEXT: mov r3, r4
1210 ; SOFT-NEXT: bl __aeabi_dcmpgt
1211 ; SOFT-NEXT: cmp r0, #0
1212 ; SOFT-NEXT: mov r7, r4
1213 ; SOFT-NEXT: bne .LBB10_4
1214 ; SOFT-NEXT: @ %bb.3:
1215 ; SOFT-NEXT: ldr r7, [sp] @ 4-byte Reload
1216 ; SOFT-NEXT: .LBB10_4:
1217 ; SOFT-NEXT: mov r0, r6
1218 ; SOFT-NEXT: mov r1, r5
1219 ; SOFT-NEXT: mov r2, r6
1220 ; SOFT-NEXT: mov r3, r5
1221 ; SOFT-NEXT: bl __aeabi_dcmpun
1222 ; SOFT-NEXT: cmp r0, #0
1223 ; SOFT-NEXT: bne .LBB10_6
1224 ; SOFT-NEXT: @ %bb.5:
1225 ; SOFT-NEXT: mov r4, r7
1226 ; SOFT-NEXT: .LBB10_6:
1227 ; SOFT-NEXT: mov r0, r4
1228 ; SOFT-NEXT: add sp, #4
1229 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
1230 ; SOFT-NEXT: .p2align 2
1231 ; SOFT-NEXT: @ %bb.7:
1232 ; SOFT-NEXT: .LCPI10_0:
1233 ; SOFT-NEXT: .long 3220176896 @ 0xbff00000
1235 ; VFP2-LABEL: test_signed_i1_f64:
1237 ; VFP2-NEXT: vmov.f64 d17, #-1.000000e+00
1238 ; VFP2-NEXT: vmov d16, r0, r1
1239 ; VFP2-NEXT: vcmp.f64 d16, d17
1240 ; VFP2-NEXT: vcvt.s32.f64 s0, d16
1241 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1242 ; VFP2-NEXT: vmov r0, s0
1243 ; VFP2-NEXT: vcmp.f64 d16, #0
1245 ; VFP2-NEXT: movlt.w r0, #-1
1246 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1248 ; VFP2-NEXT: movgt r0, #0
1249 ; VFP2-NEXT: vcmp.f64 d16, d16
1250 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1252 ; VFP2-NEXT: movvs r0, #0
1255 ; FP16-LABEL: test_signed_i1_f64:
1257 ; FP16-NEXT: vmov.f64 d0, #-1.000000e+00
1258 ; FP16-NEXT: vmov d1, r0, r1
1259 ; FP16-NEXT: vldr d2, .LCPI10_0
1260 ; FP16-NEXT: vmaxnm.f64 d0, d1, d0
1261 ; FP16-NEXT: vminnm.f64 d0, d0, d2
1262 ; FP16-NEXT: vcmp.f64 d1, d1
1263 ; FP16-NEXT: vcvt.s32.f64 s0, d0
1264 ; FP16-NEXT: vmov r0, s0
1265 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
1267 ; FP16-NEXT: movvs r0, #0
1269 ; FP16-NEXT: .p2align 3
1270 ; FP16-NEXT: @ %bb.1:
1271 ; FP16-NEXT: .LCPI10_0:
1272 ; FP16-NEXT: .long 0 @ double 0
1273 ; FP16-NEXT: .long 0
1274 %x = call i1 @llvm.fptosi.sat.i1.f64(double %f)
1278 define i8 @test_signed_i8_f64(double %f) nounwind {
1279 ; SOFT-LABEL: test_signed_i8_f64:
1281 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
1282 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
1283 ; SOFT-NEXT: .pad #4
1284 ; SOFT-NEXT: sub sp, #4
1285 ; SOFT-NEXT: mov r5, r1
1286 ; SOFT-NEXT: mov r6, r0
1287 ; SOFT-NEXT: movs r4, #0
1288 ; SOFT-NEXT: ldr r3, .LCPI11_0
1289 ; SOFT-NEXT: mov r2, r4
1290 ; SOFT-NEXT: bl __aeabi_dcmpgt
1291 ; SOFT-NEXT: str r0, [sp] @ 4-byte Spill
1292 ; SOFT-NEXT: ldr r3, .LCPI11_1
1293 ; SOFT-NEXT: mov r0, r6
1294 ; SOFT-NEXT: mov r1, r5
1295 ; SOFT-NEXT: mov r2, r4
1296 ; SOFT-NEXT: bl __aeabi_dcmpge
1297 ; SOFT-NEXT: mov r7, r0
1298 ; SOFT-NEXT: mov r0, r6
1299 ; SOFT-NEXT: mov r1, r5
1300 ; SOFT-NEXT: bl __aeabi_d2iz
1301 ; SOFT-NEXT: movs r1, #127
1302 ; SOFT-NEXT: cmp r7, #0
1303 ; SOFT-NEXT: bne .LBB11_2
1304 ; SOFT-NEXT: @ %bb.1:
1305 ; SOFT-NEXT: mvns r0, r1
1306 ; SOFT-NEXT: .LBB11_2:
1307 ; SOFT-NEXT: ldr r2, [sp] @ 4-byte Reload
1308 ; SOFT-NEXT: cmp r2, #0
1309 ; SOFT-NEXT: bne .LBB11_4
1310 ; SOFT-NEXT: @ %bb.3:
1311 ; SOFT-NEXT: mov r1, r0
1312 ; SOFT-NEXT: .LBB11_4:
1313 ; SOFT-NEXT: mov r7, r1
1314 ; SOFT-NEXT: mov r0, r6
1315 ; SOFT-NEXT: mov r1, r5
1316 ; SOFT-NEXT: mov r2, r6
1317 ; SOFT-NEXT: mov r3, r5
1318 ; SOFT-NEXT: bl __aeabi_dcmpun
1319 ; SOFT-NEXT: cmp r0, #0
1320 ; SOFT-NEXT: bne .LBB11_6
1321 ; SOFT-NEXT: @ %bb.5:
1322 ; SOFT-NEXT: mov r4, r7
1323 ; SOFT-NEXT: .LBB11_6:
1324 ; SOFT-NEXT: mov r0, r4
1325 ; SOFT-NEXT: add sp, #4
1326 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
1327 ; SOFT-NEXT: .p2align 2
1328 ; SOFT-NEXT: @ %bb.7:
1329 ; SOFT-NEXT: .LCPI11_0:
1330 ; SOFT-NEXT: .long 1080016896 @ 0x405fc000
1331 ; SOFT-NEXT: .LCPI11_1:
1332 ; SOFT-NEXT: .long 3227516928 @ 0xc0600000
1334 ; VFP2-LABEL: test_signed_i8_f64:
1336 ; VFP2-NEXT: vmov d16, r0, r1
1337 ; VFP2-NEXT: vldr d17, .LCPI11_0
1338 ; VFP2-NEXT: vldr d18, .LCPI11_1
1339 ; VFP2-NEXT: vcvt.s32.f64 s0, d16
1340 ; VFP2-NEXT: vcmp.f64 d16, d17
1341 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1342 ; VFP2-NEXT: vmov r0, s0
1343 ; VFP2-NEXT: vcmp.f64 d16, d18
1345 ; VFP2-NEXT: mvnlt r0, #127
1346 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1348 ; VFP2-NEXT: movgt r0, #127
1349 ; VFP2-NEXT: vcmp.f64 d16, d16
1350 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1352 ; VFP2-NEXT: movvs r0, #0
1354 ; VFP2-NEXT: .p2align 3
1355 ; VFP2-NEXT: @ %bb.1:
1356 ; VFP2-NEXT: .LCPI11_0:
1357 ; VFP2-NEXT: .long 0 @ double -128
1358 ; VFP2-NEXT: .long 3227516928
1359 ; VFP2-NEXT: .LCPI11_1:
1360 ; VFP2-NEXT: .long 0 @ double 127
1361 ; VFP2-NEXT: .long 1080016896
1363 ; FP16-LABEL: test_signed_i8_f64:
1365 ; FP16-NEXT: vldr d0, .LCPI11_0
1366 ; FP16-NEXT: vmov d1, r0, r1
1367 ; FP16-NEXT: vldr d2, .LCPI11_1
1368 ; FP16-NEXT: vmaxnm.f64 d0, d1, d0
1369 ; FP16-NEXT: vcmp.f64 d1, d1
1370 ; FP16-NEXT: vminnm.f64 d0, d0, d2
1371 ; FP16-NEXT: vcvt.s32.f64 s0, d0
1372 ; FP16-NEXT: vmov r0, s0
1373 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
1375 ; FP16-NEXT: movvs r0, #0
1377 ; FP16-NEXT: .p2align 3
1378 ; FP16-NEXT: @ %bb.1:
1379 ; FP16-NEXT: .LCPI11_0:
1380 ; FP16-NEXT: .long 0 @ double -128
1381 ; FP16-NEXT: .long 3227516928
1382 ; FP16-NEXT: .LCPI11_1:
1383 ; FP16-NEXT: .long 0 @ double 127
1384 ; FP16-NEXT: .long 1080016896
1385 %x = call i8 @llvm.fptosi.sat.i8.f64(double %f)
1389 define i13 @test_signed_i13_f64(double %f) nounwind {
1390 ; SOFT-LABEL: test_signed_i13_f64:
1392 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
1393 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
1394 ; SOFT-NEXT: .pad #4
1395 ; SOFT-NEXT: sub sp, #4
1396 ; SOFT-NEXT: mov r5, r1
1397 ; SOFT-NEXT: mov r6, r0
1398 ; SOFT-NEXT: movs r4, #0
1399 ; SOFT-NEXT: ldr r3, .LCPI12_0
1400 ; SOFT-NEXT: mov r2, r4
1401 ; SOFT-NEXT: bl __aeabi_dcmpgt
1402 ; SOFT-NEXT: str r0, [sp] @ 4-byte Spill
1403 ; SOFT-NEXT: ldr r3, .LCPI12_1
1404 ; SOFT-NEXT: mov r0, r6
1405 ; SOFT-NEXT: mov r1, r5
1406 ; SOFT-NEXT: mov r2, r4
1407 ; SOFT-NEXT: bl __aeabi_dcmpge
1408 ; SOFT-NEXT: mov r7, r0
1409 ; SOFT-NEXT: mov r0, r6
1410 ; SOFT-NEXT: mov r1, r5
1411 ; SOFT-NEXT: bl __aeabi_d2iz
1412 ; SOFT-NEXT: cmp r7, #0
1413 ; SOFT-NEXT: bne .LBB12_2
1414 ; SOFT-NEXT: @ %bb.1:
1415 ; SOFT-NEXT: ldr r0, .LCPI12_2
1416 ; SOFT-NEXT: .LBB12_2:
1417 ; SOFT-NEXT: ldr r1, [sp] @ 4-byte Reload
1418 ; SOFT-NEXT: cmp r1, #0
1419 ; SOFT-NEXT: bne .LBB12_4
1420 ; SOFT-NEXT: @ %bb.3:
1421 ; SOFT-NEXT: mov r7, r0
1422 ; SOFT-NEXT: b .LBB12_5
1423 ; SOFT-NEXT: .LBB12_4:
1424 ; SOFT-NEXT: ldr r7, .LCPI12_3
1425 ; SOFT-NEXT: .LBB12_5:
1426 ; SOFT-NEXT: mov r0, r6
1427 ; SOFT-NEXT: mov r1, r5
1428 ; SOFT-NEXT: mov r2, r6
1429 ; SOFT-NEXT: mov r3, r5
1430 ; SOFT-NEXT: bl __aeabi_dcmpun
1431 ; SOFT-NEXT: cmp r0, #0
1432 ; SOFT-NEXT: bne .LBB12_7
1433 ; SOFT-NEXT: @ %bb.6:
1434 ; SOFT-NEXT: mov r4, r7
1435 ; SOFT-NEXT: .LBB12_7:
1436 ; SOFT-NEXT: mov r0, r4
1437 ; SOFT-NEXT: add sp, #4
1438 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
1439 ; SOFT-NEXT: .p2align 2
1440 ; SOFT-NEXT: @ %bb.8:
1441 ; SOFT-NEXT: .LCPI12_0:
1442 ; SOFT-NEXT: .long 1085275648 @ 0x40affe00
1443 ; SOFT-NEXT: .LCPI12_1:
1444 ; SOFT-NEXT: .long 3232759808 @ 0xc0b00000
1445 ; SOFT-NEXT: .LCPI12_2:
1446 ; SOFT-NEXT: .long 4294963200 @ 0xfffff000
1447 ; SOFT-NEXT: .LCPI12_3:
1448 ; SOFT-NEXT: .long 4095 @ 0xfff
1450 ; VFP2-LABEL: test_signed_i13_f64:
1452 ; VFP2-NEXT: vmov d16, r0, r1
1453 ; VFP2-NEXT: vldr d17, .LCPI12_0
1454 ; VFP2-NEXT: vcvt.s32.f64 s0, d16
1455 ; VFP2-NEXT: vcmp.f64 d16, d17
1456 ; VFP2-NEXT: vldr d17, .LCPI12_1
1457 ; VFP2-NEXT: vmov r0, s0
1458 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1460 ; VFP2-NEXT: movwlt r0, #61440
1461 ; VFP2-NEXT: movtlt r0, #65535
1462 ; VFP2-NEXT: vcmp.f64 d16, d17
1463 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1465 ; VFP2-NEXT: movwgt r0, #4095
1466 ; VFP2-NEXT: vcmp.f64 d16, d16
1467 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1469 ; VFP2-NEXT: movvs r0, #0
1471 ; VFP2-NEXT: .p2align 3
1472 ; VFP2-NEXT: @ %bb.1:
1473 ; VFP2-NEXT: .LCPI12_0:
1474 ; VFP2-NEXT: .long 0 @ double -4096
1475 ; VFP2-NEXT: .long 3232759808
1476 ; VFP2-NEXT: .LCPI12_1:
1477 ; VFP2-NEXT: .long 0 @ double 4095
1478 ; VFP2-NEXT: .long 1085275648
1480 ; FP16-LABEL: test_signed_i13_f64:
1482 ; FP16-NEXT: vldr d0, .LCPI12_0
1483 ; FP16-NEXT: vmov d1, r0, r1
1484 ; FP16-NEXT: vldr d2, .LCPI12_1
1485 ; FP16-NEXT: vmaxnm.f64 d0, d1, d0
1486 ; FP16-NEXT: vcmp.f64 d1, d1
1487 ; FP16-NEXT: vminnm.f64 d0, d0, d2
1488 ; FP16-NEXT: vcvt.s32.f64 s0, d0
1489 ; FP16-NEXT: vmov r0, s0
1490 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
1492 ; FP16-NEXT: movvs r0, #0
1494 ; FP16-NEXT: .p2align 3
1495 ; FP16-NEXT: @ %bb.1:
1496 ; FP16-NEXT: .LCPI12_0:
1497 ; FP16-NEXT: .long 0 @ double -4096
1498 ; FP16-NEXT: .long 3232759808
1499 ; FP16-NEXT: .LCPI12_1:
1500 ; FP16-NEXT: .long 0 @ double 4095
1501 ; FP16-NEXT: .long 1085275648
1502 %x = call i13 @llvm.fptosi.sat.i13.f64(double %f)
1506 define i16 @test_signed_i16_f64(double %f) nounwind {
1507 ; SOFT-LABEL: test_signed_i16_f64:
1509 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
1510 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
1511 ; SOFT-NEXT: .pad #4
1512 ; SOFT-NEXT: sub sp, #4
1513 ; SOFT-NEXT: mov r5, r1
1514 ; SOFT-NEXT: mov r6, r0
1515 ; SOFT-NEXT: movs r4, #0
1516 ; SOFT-NEXT: ldr r3, .LCPI13_0
1517 ; SOFT-NEXT: mov r2, r4
1518 ; SOFT-NEXT: bl __aeabi_dcmpgt
1519 ; SOFT-NEXT: str r0, [sp] @ 4-byte Spill
1520 ; SOFT-NEXT: ldr r3, .LCPI13_1
1521 ; SOFT-NEXT: mov r0, r6
1522 ; SOFT-NEXT: mov r1, r5
1523 ; SOFT-NEXT: mov r2, r4
1524 ; SOFT-NEXT: bl __aeabi_dcmpge
1525 ; SOFT-NEXT: mov r7, r0
1526 ; SOFT-NEXT: mov r0, r6
1527 ; SOFT-NEXT: mov r1, r5
1528 ; SOFT-NEXT: bl __aeabi_d2iz
1529 ; SOFT-NEXT: cmp r7, #0
1530 ; SOFT-NEXT: bne .LBB13_2
1531 ; SOFT-NEXT: @ %bb.1:
1532 ; SOFT-NEXT: ldr r0, .LCPI13_2
1533 ; SOFT-NEXT: .LBB13_2:
1534 ; SOFT-NEXT: ldr r1, [sp] @ 4-byte Reload
1535 ; SOFT-NEXT: cmp r1, #0
1536 ; SOFT-NEXT: bne .LBB13_4
1537 ; SOFT-NEXT: @ %bb.3:
1538 ; SOFT-NEXT: mov r7, r0
1539 ; SOFT-NEXT: b .LBB13_5
1540 ; SOFT-NEXT: .LBB13_4:
1541 ; SOFT-NEXT: ldr r7, .LCPI13_3
1542 ; SOFT-NEXT: .LBB13_5:
1543 ; SOFT-NEXT: mov r0, r6
1544 ; SOFT-NEXT: mov r1, r5
1545 ; SOFT-NEXT: mov r2, r6
1546 ; SOFT-NEXT: mov r3, r5
1547 ; SOFT-NEXT: bl __aeabi_dcmpun
1548 ; SOFT-NEXT: cmp r0, #0
1549 ; SOFT-NEXT: bne .LBB13_7
1550 ; SOFT-NEXT: @ %bb.6:
1551 ; SOFT-NEXT: mov r4, r7
1552 ; SOFT-NEXT: .LBB13_7:
1553 ; SOFT-NEXT: mov r0, r4
1554 ; SOFT-NEXT: add sp, #4
1555 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
1556 ; SOFT-NEXT: .p2align 2
1557 ; SOFT-NEXT: @ %bb.8:
1558 ; SOFT-NEXT: .LCPI13_0:
1559 ; SOFT-NEXT: .long 1088421824 @ 0x40dfffc0
1560 ; SOFT-NEXT: .LCPI13_1:
1561 ; SOFT-NEXT: .long 3235905536 @ 0xc0e00000
1562 ; SOFT-NEXT: .LCPI13_2:
1563 ; SOFT-NEXT: .long 4294934528 @ 0xffff8000
1564 ; SOFT-NEXT: .LCPI13_3:
1565 ; SOFT-NEXT: .long 32767 @ 0x7fff
1567 ; VFP2-LABEL: test_signed_i16_f64:
1569 ; VFP2-NEXT: vmov d16, r0, r1
1570 ; VFP2-NEXT: vldr d17, .LCPI13_0
1571 ; VFP2-NEXT: vcvt.s32.f64 s0, d16
1572 ; VFP2-NEXT: vcmp.f64 d16, d17
1573 ; VFP2-NEXT: vldr d17, .LCPI13_1
1574 ; VFP2-NEXT: vmov r0, s0
1575 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1577 ; VFP2-NEXT: movwlt r0, #32768
1578 ; VFP2-NEXT: movtlt r0, #65535
1579 ; VFP2-NEXT: vcmp.f64 d16, d17
1580 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1582 ; VFP2-NEXT: movwgt r0, #32767
1583 ; VFP2-NEXT: vcmp.f64 d16, d16
1584 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1586 ; VFP2-NEXT: movvs r0, #0
1588 ; VFP2-NEXT: .p2align 3
1589 ; VFP2-NEXT: @ %bb.1:
1590 ; VFP2-NEXT: .LCPI13_0:
1591 ; VFP2-NEXT: .long 0 @ double -32768
1592 ; VFP2-NEXT: .long 3235905536
1593 ; VFP2-NEXT: .LCPI13_1:
1594 ; VFP2-NEXT: .long 0 @ double 32767
1595 ; VFP2-NEXT: .long 1088421824
1597 ; FP16-LABEL: test_signed_i16_f64:
1599 ; FP16-NEXT: vldr d0, .LCPI13_0
1600 ; FP16-NEXT: vmov d1, r0, r1
1601 ; FP16-NEXT: vldr d2, .LCPI13_1
1602 ; FP16-NEXT: vmaxnm.f64 d0, d1, d0
1603 ; FP16-NEXT: vcmp.f64 d1, d1
1604 ; FP16-NEXT: vminnm.f64 d0, d0, d2
1605 ; FP16-NEXT: vcvt.s32.f64 s0, d0
1606 ; FP16-NEXT: vmov r0, s0
1607 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
1609 ; FP16-NEXT: movvs r0, #0
1611 ; FP16-NEXT: .p2align 3
1612 ; FP16-NEXT: @ %bb.1:
1613 ; FP16-NEXT: .LCPI13_0:
1614 ; FP16-NEXT: .long 0 @ double -32768
1615 ; FP16-NEXT: .long 3235905536
1616 ; FP16-NEXT: .LCPI13_1:
1617 ; FP16-NEXT: .long 0 @ double 32767
1618 ; FP16-NEXT: .long 1088421824
1619 %x = call i16 @llvm.fptosi.sat.i16.f64(double %f)
1623 define i19 @test_signed_i19_f64(double %f) nounwind {
1624 ; SOFT-LABEL: test_signed_i19_f64:
1626 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
1627 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
1628 ; SOFT-NEXT: .pad #4
1629 ; SOFT-NEXT: sub sp, #4
1630 ; SOFT-NEXT: mov r5, r1
1631 ; SOFT-NEXT: mov r6, r0
1632 ; SOFT-NEXT: movs r4, #0
1633 ; SOFT-NEXT: ldr r3, .LCPI14_0
1634 ; SOFT-NEXT: mov r2, r4
1635 ; SOFT-NEXT: bl __aeabi_dcmpgt
1636 ; SOFT-NEXT: str r0, [sp] @ 4-byte Spill
1637 ; SOFT-NEXT: ldr r3, .LCPI14_1
1638 ; SOFT-NEXT: mov r0, r6
1639 ; SOFT-NEXT: mov r1, r5
1640 ; SOFT-NEXT: mov r2, r4
1641 ; SOFT-NEXT: bl __aeabi_dcmpge
1642 ; SOFT-NEXT: mov r7, r0
1643 ; SOFT-NEXT: mov r0, r6
1644 ; SOFT-NEXT: mov r1, r5
1645 ; SOFT-NEXT: bl __aeabi_d2iz
1646 ; SOFT-NEXT: cmp r7, #0
1647 ; SOFT-NEXT: bne .LBB14_2
1648 ; SOFT-NEXT: @ %bb.1:
1649 ; SOFT-NEXT: ldr r0, .LCPI14_2
1650 ; SOFT-NEXT: .LBB14_2:
1651 ; SOFT-NEXT: ldr r1, [sp] @ 4-byte Reload
1652 ; SOFT-NEXT: cmp r1, #0
1653 ; SOFT-NEXT: bne .LBB14_4
1654 ; SOFT-NEXT: @ %bb.3:
1655 ; SOFT-NEXT: mov r7, r0
1656 ; SOFT-NEXT: b .LBB14_5
1657 ; SOFT-NEXT: .LBB14_4:
1658 ; SOFT-NEXT: ldr r7, .LCPI14_3
1659 ; SOFT-NEXT: .LBB14_5:
1660 ; SOFT-NEXT: mov r0, r6
1661 ; SOFT-NEXT: mov r1, r5
1662 ; SOFT-NEXT: mov r2, r6
1663 ; SOFT-NEXT: mov r3, r5
1664 ; SOFT-NEXT: bl __aeabi_dcmpun
1665 ; SOFT-NEXT: cmp r0, #0
1666 ; SOFT-NEXT: bne .LBB14_7
1667 ; SOFT-NEXT: @ %bb.6:
1668 ; SOFT-NEXT: mov r4, r7
1669 ; SOFT-NEXT: .LBB14_7:
1670 ; SOFT-NEXT: mov r0, r4
1671 ; SOFT-NEXT: add sp, #4
1672 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
1673 ; SOFT-NEXT: .p2align 2
1674 ; SOFT-NEXT: @ %bb.8:
1675 ; SOFT-NEXT: .LCPI14_0:
1676 ; SOFT-NEXT: .long 1091567608 @ 0x410ffff8
1677 ; SOFT-NEXT: .LCPI14_1:
1678 ; SOFT-NEXT: .long 3239051264 @ 0xc1100000
1679 ; SOFT-NEXT: .LCPI14_2:
1680 ; SOFT-NEXT: .long 4294705152 @ 0xfffc0000
1681 ; SOFT-NEXT: .LCPI14_3:
1682 ; SOFT-NEXT: .long 262143 @ 0x3ffff
1684 ; VFP2-LABEL: test_signed_i19_f64:
1686 ; VFP2-NEXT: vmov d16, r0, r1
1687 ; VFP2-NEXT: vldr d17, .LCPI14_0
1688 ; VFP2-NEXT: vcvt.s32.f64 s0, d16
1689 ; VFP2-NEXT: vcmp.f64 d16, d17
1690 ; VFP2-NEXT: vldr d17, .LCPI14_1
1691 ; VFP2-NEXT: vmov r0, s0
1692 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1694 ; VFP2-NEXT: movlt r0, #0
1695 ; VFP2-NEXT: movtlt r0, #65532
1696 ; VFP2-NEXT: vcmp.f64 d16, d17
1697 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1699 ; VFP2-NEXT: movwgt r0, #65535
1700 ; VFP2-NEXT: movtgt r0, #3
1701 ; VFP2-NEXT: vcmp.f64 d16, d16
1702 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1704 ; VFP2-NEXT: movvs r0, #0
1706 ; VFP2-NEXT: .p2align 3
1707 ; VFP2-NEXT: @ %bb.1:
1708 ; VFP2-NEXT: .LCPI14_0:
1709 ; VFP2-NEXT: .long 0 @ double -262144
1710 ; VFP2-NEXT: .long 3239051264
1711 ; VFP2-NEXT: .LCPI14_1:
1712 ; VFP2-NEXT: .long 0 @ double 262143
1713 ; VFP2-NEXT: .long 1091567608
1715 ; FP16-LABEL: test_signed_i19_f64:
1717 ; FP16-NEXT: vldr d0, .LCPI14_0
1718 ; FP16-NEXT: vmov d1, r0, r1
1719 ; FP16-NEXT: vldr d2, .LCPI14_1
1720 ; FP16-NEXT: vmaxnm.f64 d0, d1, d0
1721 ; FP16-NEXT: vcmp.f64 d1, d1
1722 ; FP16-NEXT: vminnm.f64 d0, d0, d2
1723 ; FP16-NEXT: vcvt.s32.f64 s0, d0
1724 ; FP16-NEXT: vmov r0, s0
1725 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
1727 ; FP16-NEXT: movvs r0, #0
1729 ; FP16-NEXT: .p2align 3
1730 ; FP16-NEXT: @ %bb.1:
1731 ; FP16-NEXT: .LCPI14_0:
1732 ; FP16-NEXT: .long 0 @ double -262144
1733 ; FP16-NEXT: .long 3239051264
1734 ; FP16-NEXT: .LCPI14_1:
1735 ; FP16-NEXT: .long 0 @ double 262143
1736 ; FP16-NEXT: .long 1091567608
1737 %x = call i19 @llvm.fptosi.sat.i19.f64(double %f)
1741 define i32 @test_signed_i32_f64(double %f) nounwind {
1742 ; SOFT-LABEL: test_signed_i32_f64:
1744 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
1745 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
1746 ; SOFT-NEXT: .pad #4
1747 ; SOFT-NEXT: sub sp, #4
1748 ; SOFT-NEXT: mov r4, r1
1749 ; SOFT-NEXT: mov r5, r0
1750 ; SOFT-NEXT: ldr r2, .LCPI15_0
1751 ; SOFT-NEXT: ldr r3, .LCPI15_1
1752 ; SOFT-NEXT: bl __aeabi_dcmpgt
1753 ; SOFT-NEXT: str r0, [sp] @ 4-byte Spill
1754 ; SOFT-NEXT: movs r6, #0
1755 ; SOFT-NEXT: ldr r3, .LCPI15_2
1756 ; SOFT-NEXT: mov r0, r5
1757 ; SOFT-NEXT: mov r1, r4
1758 ; SOFT-NEXT: mov r2, r6
1759 ; SOFT-NEXT: bl __aeabi_dcmpge
1760 ; SOFT-NEXT: mov r7, r0
1761 ; SOFT-NEXT: mov r0, r5
1762 ; SOFT-NEXT: mov r1, r4
1763 ; SOFT-NEXT: bl __aeabi_d2iz
1764 ; SOFT-NEXT: cmp r7, #0
1765 ; SOFT-NEXT: bne .LBB15_2
1766 ; SOFT-NEXT: @ %bb.1:
1767 ; SOFT-NEXT: movs r0, #1
1768 ; SOFT-NEXT: lsls r0, r0, #31
1769 ; SOFT-NEXT: .LBB15_2:
1770 ; SOFT-NEXT: ldr r1, [sp] @ 4-byte Reload
1771 ; SOFT-NEXT: cmp r1, #0
1772 ; SOFT-NEXT: bne .LBB15_4
1773 ; SOFT-NEXT: @ %bb.3:
1774 ; SOFT-NEXT: mov r7, r0
1775 ; SOFT-NEXT: b .LBB15_5
1776 ; SOFT-NEXT: .LBB15_4:
1777 ; SOFT-NEXT: ldr r7, .LCPI15_3
1778 ; SOFT-NEXT: .LBB15_5:
1779 ; SOFT-NEXT: mov r0, r5
1780 ; SOFT-NEXT: mov r1, r4
1781 ; SOFT-NEXT: mov r2, r5
1782 ; SOFT-NEXT: mov r3, r4
1783 ; SOFT-NEXT: bl __aeabi_dcmpun
1784 ; SOFT-NEXT: cmp r0, #0
1785 ; SOFT-NEXT: bne .LBB15_7
1786 ; SOFT-NEXT: @ %bb.6:
1787 ; SOFT-NEXT: mov r6, r7
1788 ; SOFT-NEXT: .LBB15_7:
1789 ; SOFT-NEXT: mov r0, r6
1790 ; SOFT-NEXT: add sp, #4
1791 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
1792 ; SOFT-NEXT: .p2align 2
1793 ; SOFT-NEXT: @ %bb.8:
1794 ; SOFT-NEXT: .LCPI15_0:
1795 ; SOFT-NEXT: .long 4290772992 @ 0xffc00000
1796 ; SOFT-NEXT: .LCPI15_1:
1797 ; SOFT-NEXT: .long 1105199103 @ 0x41dfffff
1798 ; SOFT-NEXT: .LCPI15_2:
1799 ; SOFT-NEXT: .long 3252682752 @ 0xc1e00000
1800 ; SOFT-NEXT: .LCPI15_3:
1801 ; SOFT-NEXT: .long 2147483647 @ 0x7fffffff
1803 ; VFP2-LABEL: test_signed_i32_f64:
1805 ; VFP2-NEXT: vmov d16, r0, r1
1806 ; VFP2-NEXT: vcvt.s32.f64 s0, d16
1807 ; VFP2-NEXT: vmov r0, s0
1810 ; FP16-LABEL: test_signed_i32_f64:
1812 ; FP16-NEXT: vmov d0, r0, r1
1813 ; FP16-NEXT: vcvt.s32.f64 s0, d0
1814 ; FP16-NEXT: vmov r0, s0
1816 %x = call i32 @llvm.fptosi.sat.i32.f64(double %f)
1820 define i50 @test_signed_i50_f64(double %f) nounwind {
1821 ; SOFT-LABEL: test_signed_i50_f64:
1823 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
1824 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
1825 ; SOFT-NEXT: .pad #12
1826 ; SOFT-NEXT: sub sp, #12
1827 ; SOFT-NEXT: mov r7, r1
1828 ; SOFT-NEXT: mov r6, r0
1829 ; SOFT-NEXT: movs r0, #15
1830 ; SOFT-NEXT: mvns r2, r0
1831 ; SOFT-NEXT: ldr r3, .LCPI16_0
1832 ; SOFT-NEXT: mov r0, r6
1833 ; SOFT-NEXT: bl __aeabi_dcmpgt
1834 ; SOFT-NEXT: str r0, [sp, #8] @ 4-byte Spill
1835 ; SOFT-NEXT: movs r0, #195
1836 ; SOFT-NEXT: lsls r3, r0, #24
1837 ; SOFT-NEXT: movs r4, #0
1838 ; SOFT-NEXT: mov r0, r6
1839 ; SOFT-NEXT: mov r1, r7
1840 ; SOFT-NEXT: mov r2, r4
1841 ; SOFT-NEXT: bl __aeabi_dcmpge
1842 ; SOFT-NEXT: mov r5, r0
1843 ; SOFT-NEXT: mov r0, r6
1844 ; SOFT-NEXT: mov r1, r7
1845 ; SOFT-NEXT: bl __aeabi_d2lz
1846 ; SOFT-NEXT: mov r2, r0
1847 ; SOFT-NEXT: str r1, [sp, #4] @ 4-byte Spill
1848 ; SOFT-NEXT: cmp r5, #0
1849 ; SOFT-NEXT: bne .LBB16_2
1850 ; SOFT-NEXT: @ %bb.1:
1851 ; SOFT-NEXT: mov r2, r5
1852 ; SOFT-NEXT: .LBB16_2:
1853 ; SOFT-NEXT: ldr r0, [sp, #8] @ 4-byte Reload
1854 ; SOFT-NEXT: cmp r0, #0
1855 ; SOFT-NEXT: bne .LBB16_4
1856 ; SOFT-NEXT: @ %bb.3:
1857 ; SOFT-NEXT: str r2, [sp] @ 4-byte Spill
1858 ; SOFT-NEXT: b .LBB16_5
1859 ; SOFT-NEXT: .LBB16_4:
1860 ; SOFT-NEXT: mvns r0, r4
1861 ; SOFT-NEXT: str r0, [sp] @ 4-byte Spill
1862 ; SOFT-NEXT: .LBB16_5:
1863 ; SOFT-NEXT: mov r0, r6
1864 ; SOFT-NEXT: mov r1, r7
1865 ; SOFT-NEXT: mov r2, r6
1866 ; SOFT-NEXT: mov r3, r7
1867 ; SOFT-NEXT: bl __aeabi_dcmpun
1868 ; SOFT-NEXT: mov r1, r0
1869 ; SOFT-NEXT: cmp r0, #0
1870 ; SOFT-NEXT: mov r0, r4
1871 ; SOFT-NEXT: bne .LBB16_7
1872 ; SOFT-NEXT: @ %bb.6:
1873 ; SOFT-NEXT: ldr r0, [sp] @ 4-byte Reload
1874 ; SOFT-NEXT: .LBB16_7:
1875 ; SOFT-NEXT: cmp r5, #0
1876 ; SOFT-NEXT: beq .LBB16_9
1877 ; SOFT-NEXT: @ %bb.8:
1878 ; SOFT-NEXT: ldr r3, [sp, #4] @ 4-byte Reload
1879 ; SOFT-NEXT: b .LBB16_10
1880 ; SOFT-NEXT: .LBB16_9:
1881 ; SOFT-NEXT: ldr r3, .LCPI16_1
1882 ; SOFT-NEXT: .LBB16_10:
1883 ; SOFT-NEXT: ldr r2, [sp, #8] @ 4-byte Reload
1884 ; SOFT-NEXT: cmp r2, #0
1885 ; SOFT-NEXT: beq .LBB16_12
1886 ; SOFT-NEXT: @ %bb.11:
1887 ; SOFT-NEXT: ldr r3, .LCPI16_2
1888 ; SOFT-NEXT: .LBB16_12:
1889 ; SOFT-NEXT: cmp r1, #0
1890 ; SOFT-NEXT: bne .LBB16_14
1891 ; SOFT-NEXT: @ %bb.13:
1892 ; SOFT-NEXT: mov r4, r3
1893 ; SOFT-NEXT: .LBB16_14:
1894 ; SOFT-NEXT: mov r1, r4
1895 ; SOFT-NEXT: add sp, #12
1896 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
1897 ; SOFT-NEXT: .p2align 2
1898 ; SOFT-NEXT: @ %bb.15:
1899 ; SOFT-NEXT: .LCPI16_0:
1900 ; SOFT-NEXT: .long 1124073471 @ 0x42ffffff
1901 ; SOFT-NEXT: .LCPI16_1:
1902 ; SOFT-NEXT: .long 4294836224 @ 0xfffe0000
1903 ; SOFT-NEXT: .LCPI16_2:
1904 ; SOFT-NEXT: .long 131071 @ 0x1ffff
1906 ; VFP2-LABEL: test_signed_i50_f64:
1908 ; VFP2-NEXT: .save {r7, lr}
1909 ; VFP2-NEXT: push {r7, lr}
1910 ; VFP2-NEXT: .vsave {d8}
1911 ; VFP2-NEXT: vpush {d8}
1912 ; VFP2-NEXT: vmov d8, r0, r1
1913 ; VFP2-NEXT: bl __aeabi_d2lz
1914 ; VFP2-NEXT: vldr d16, .LCPI16_0
1915 ; VFP2-NEXT: vldr d17, .LCPI16_1
1916 ; VFP2-NEXT: vcmp.f64 d8, d16
1917 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1919 ; VFP2-NEXT: movlt r1, #0
1920 ; VFP2-NEXT: movtlt r1, #65534
1921 ; VFP2-NEXT: vcmp.f64 d8, d17
1922 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1924 ; VFP2-NEXT: movwgt r1, #65535
1925 ; VFP2-NEXT: movtgt r1, #1
1926 ; VFP2-NEXT: vcmp.f64 d8, d8
1927 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1929 ; VFP2-NEXT: movvs r1, #0
1930 ; VFP2-NEXT: vcmp.f64 d8, d16
1931 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1933 ; VFP2-NEXT: movlt r0, #0
1934 ; VFP2-NEXT: vcmp.f64 d8, d17
1935 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1937 ; VFP2-NEXT: movgt.w r0, #-1
1938 ; VFP2-NEXT: vcmp.f64 d8, d8
1939 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1941 ; VFP2-NEXT: movvs r0, #0
1942 ; VFP2-NEXT: vpop {d8}
1943 ; VFP2-NEXT: pop {r7, pc}
1944 ; VFP2-NEXT: .p2align 3
1945 ; VFP2-NEXT: @ %bb.1:
1946 ; VFP2-NEXT: .LCPI16_0:
1947 ; VFP2-NEXT: .long 0 @ double -562949953421312
1948 ; VFP2-NEXT: .long 3271557120
1949 ; VFP2-NEXT: .LCPI16_1:
1950 ; VFP2-NEXT: .long 4294967280 @ double 562949953421311
1951 ; VFP2-NEXT: .long 1124073471
1953 ; FP16-LABEL: test_signed_i50_f64:
1955 ; FP16-NEXT: .save {r7, lr}
1956 ; FP16-NEXT: push {r7, lr}
1957 ; FP16-NEXT: .vsave {d8}
1958 ; FP16-NEXT: vpush {d8}
1959 ; FP16-NEXT: vldr d0, .LCPI16_0
1960 ; FP16-NEXT: vmov d8, r0, r1
1961 ; FP16-NEXT: vldr d1, .LCPI16_1
1962 ; FP16-NEXT: vmaxnm.f64 d0, d8, d0
1963 ; FP16-NEXT: vminnm.f64 d0, d0, d1
1964 ; FP16-NEXT: vmov r0, r1, d0
1965 ; FP16-NEXT: bl __aeabi_d2lz
1966 ; FP16-NEXT: vcmp.f64 d8, d8
1967 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
1969 ; FP16-NEXT: movvs r0, #0
1970 ; FP16-NEXT: movvs r1, #0
1971 ; FP16-NEXT: vpop {d8}
1972 ; FP16-NEXT: pop {r7, pc}
1973 ; FP16-NEXT: .p2align 3
1974 ; FP16-NEXT: @ %bb.1:
1975 ; FP16-NEXT: .LCPI16_0:
1976 ; FP16-NEXT: .long 0 @ double -562949953421312
1977 ; FP16-NEXT: .long 3271557120
1978 ; FP16-NEXT: .LCPI16_1:
1979 ; FP16-NEXT: .long 4294967280 @ double 562949953421311
1980 ; FP16-NEXT: .long 1124073471
1981 %x = call i50 @llvm.fptosi.sat.i50.f64(double %f)
1985 define i64 @test_signed_i64_f64(double %f) nounwind {
1986 ; SOFT-LABEL: test_signed_i64_f64:
1988 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
1989 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
1990 ; SOFT-NEXT: .pad #12
1991 ; SOFT-NEXT: sub sp, #12
1992 ; SOFT-NEXT: mov r6, r1
1993 ; SOFT-NEXT: mov r5, r0
1994 ; SOFT-NEXT: movs r4, #0
1995 ; SOFT-NEXT: mvns r2, r4
1996 ; SOFT-NEXT: ldr r3, .LCPI17_0
1997 ; SOFT-NEXT: str r2, [sp, #4] @ 4-byte Spill
1998 ; SOFT-NEXT: bl __aeabi_dcmpgt
1999 ; SOFT-NEXT: str r0, [sp, #8] @ 4-byte Spill
2000 ; SOFT-NEXT: ldr r3, .LCPI17_1
2001 ; SOFT-NEXT: mov r0, r5
2002 ; SOFT-NEXT: mov r1, r6
2003 ; SOFT-NEXT: mov r2, r4
2004 ; SOFT-NEXT: bl __aeabi_dcmpge
2005 ; SOFT-NEXT: mov r7, r0
2006 ; SOFT-NEXT: mov r0, r5
2007 ; SOFT-NEXT: mov r1, r6
2008 ; SOFT-NEXT: bl __aeabi_d2lz
2009 ; SOFT-NEXT: str r1, [sp] @ 4-byte Spill
2010 ; SOFT-NEXT: cmp r7, #0
2011 ; SOFT-NEXT: bne .LBB17_2
2012 ; SOFT-NEXT: @ %bb.1:
2013 ; SOFT-NEXT: mov r0, r7
2014 ; SOFT-NEXT: .LBB17_2:
2015 ; SOFT-NEXT: ldr r1, [sp, #8] @ 4-byte Reload
2016 ; SOFT-NEXT: cmp r1, #0
2017 ; SOFT-NEXT: bne .LBB17_4
2018 ; SOFT-NEXT: @ %bb.3:
2019 ; SOFT-NEXT: str r0, [sp, #4] @ 4-byte Spill
2020 ; SOFT-NEXT: .LBB17_4:
2021 ; SOFT-NEXT: mov r0, r5
2022 ; SOFT-NEXT: mov r1, r6
2023 ; SOFT-NEXT: mov r2, r5
2024 ; SOFT-NEXT: mov r3, r6
2025 ; SOFT-NEXT: bl __aeabi_dcmpun
2026 ; SOFT-NEXT: mov r1, r0
2027 ; SOFT-NEXT: cmp r0, #0
2028 ; SOFT-NEXT: mov r0, r4
2029 ; SOFT-NEXT: bne .LBB17_6
2030 ; SOFT-NEXT: @ %bb.5:
2031 ; SOFT-NEXT: ldr r0, [sp, #4] @ 4-byte Reload
2032 ; SOFT-NEXT: .LBB17_6:
2033 ; SOFT-NEXT: cmp r7, #0
2034 ; SOFT-NEXT: beq .LBB17_8
2035 ; SOFT-NEXT: @ %bb.7:
2036 ; SOFT-NEXT: ldr r3, [sp] @ 4-byte Reload
2037 ; SOFT-NEXT: b .LBB17_9
2038 ; SOFT-NEXT: .LBB17_8:
2039 ; SOFT-NEXT: movs r2, #1
2040 ; SOFT-NEXT: lsls r3, r2, #31
2041 ; SOFT-NEXT: .LBB17_9:
2042 ; SOFT-NEXT: ldr r2, [sp, #8] @ 4-byte Reload
2043 ; SOFT-NEXT: cmp r2, #0
2044 ; SOFT-NEXT: beq .LBB17_11
2045 ; SOFT-NEXT: @ %bb.10:
2046 ; SOFT-NEXT: ldr r3, .LCPI17_2
2047 ; SOFT-NEXT: .LBB17_11:
2048 ; SOFT-NEXT: cmp r1, #0
2049 ; SOFT-NEXT: bne .LBB17_13
2050 ; SOFT-NEXT: @ %bb.12:
2051 ; SOFT-NEXT: mov r4, r3
2052 ; SOFT-NEXT: .LBB17_13:
2053 ; SOFT-NEXT: mov r1, r4
2054 ; SOFT-NEXT: add sp, #12
2055 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
2056 ; SOFT-NEXT: .p2align 2
2057 ; SOFT-NEXT: @ %bb.14:
2058 ; SOFT-NEXT: .LCPI17_0:
2059 ; SOFT-NEXT: .long 1138753535 @ 0x43dfffff
2060 ; SOFT-NEXT: .LCPI17_1:
2061 ; SOFT-NEXT: .long 3286237184 @ 0xc3e00000
2062 ; SOFT-NEXT: .LCPI17_2:
2063 ; SOFT-NEXT: .long 2147483647 @ 0x7fffffff
2065 ; VFP2-LABEL: test_signed_i64_f64:
2067 ; VFP2-NEXT: .save {r4, r5, r7, lr}
2068 ; VFP2-NEXT: push {r4, r5, r7, lr}
2069 ; VFP2-NEXT: mov r4, r1
2070 ; VFP2-NEXT: mov r5, r0
2071 ; VFP2-NEXT: bl __aeabi_d2lz
2072 ; VFP2-NEXT: vldr d16, .LCPI17_0
2073 ; VFP2-NEXT: vmov d17, r5, r4
2074 ; VFP2-NEXT: vldr d18, .LCPI17_1
2075 ; VFP2-NEXT: vcmp.f64 d17, d16
2076 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2078 ; VFP2-NEXT: movlt r0, #0
2079 ; VFP2-NEXT: vcmp.f64 d17, d18
2080 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2082 ; VFP2-NEXT: movgt.w r0, #-1
2083 ; VFP2-NEXT: vcmp.f64 d17, d17
2084 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2086 ; VFP2-NEXT: movvs r0, #0
2087 ; VFP2-NEXT: vcmp.f64 d17, d16
2088 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2090 ; VFP2-NEXT: movlt.w r1, #-2147483648
2091 ; VFP2-NEXT: vcmp.f64 d17, d18
2092 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2094 ; VFP2-NEXT: mvngt r1, #-2147483648
2095 ; VFP2-NEXT: vcmp.f64 d17, d17
2096 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2098 ; VFP2-NEXT: movvs r1, #0
2099 ; VFP2-NEXT: pop {r4, r5, r7, pc}
2100 ; VFP2-NEXT: .p2align 3
2101 ; VFP2-NEXT: @ %bb.1:
2102 ; VFP2-NEXT: .LCPI17_0:
2103 ; VFP2-NEXT: .long 0 @ double -9.2233720368547758E+18
2104 ; VFP2-NEXT: .long 3286237184
2105 ; VFP2-NEXT: .LCPI17_1:
2106 ; VFP2-NEXT: .long 4294967295 @ double 9.2233720368547748E+18
2107 ; VFP2-NEXT: .long 1138753535
2109 ; FP16-LABEL: test_signed_i64_f64:
2111 ; FP16-NEXT: .save {r4, r5, r7, lr}
2112 ; FP16-NEXT: push {r4, r5, r7, lr}
2113 ; FP16-NEXT: mov r4, r1
2114 ; FP16-NEXT: mov r5, r0
2115 ; FP16-NEXT: bl __aeabi_d2lz
2116 ; FP16-NEXT: vldr d0, .LCPI17_0
2117 ; FP16-NEXT: vmov d1, r5, r4
2118 ; FP16-NEXT: vldr d2, .LCPI17_1
2119 ; FP16-NEXT: vcmp.f64 d1, d0
2120 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2122 ; FP16-NEXT: movlt r0, #0
2123 ; FP16-NEXT: vcmp.f64 d1, d2
2124 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2126 ; FP16-NEXT: movgt.w r0, #-1
2127 ; FP16-NEXT: vcmp.f64 d1, d1
2128 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2130 ; FP16-NEXT: movvs r0, #0
2131 ; FP16-NEXT: vcmp.f64 d1, d0
2132 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2134 ; FP16-NEXT: movlt.w r1, #-2147483648
2135 ; FP16-NEXT: vcmp.f64 d1, d2
2136 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2138 ; FP16-NEXT: mvngt r1, #-2147483648
2139 ; FP16-NEXT: vcmp.f64 d1, d1
2140 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2142 ; FP16-NEXT: movvs r1, #0
2143 ; FP16-NEXT: pop {r4, r5, r7, pc}
2144 ; FP16-NEXT: .p2align 3
2145 ; FP16-NEXT: @ %bb.1:
2146 ; FP16-NEXT: .LCPI17_0:
2147 ; FP16-NEXT: .long 0 @ double -9.2233720368547758E+18
2148 ; FP16-NEXT: .long 3286237184
2149 ; FP16-NEXT: .LCPI17_1:
2150 ; FP16-NEXT: .long 4294967295 @ double 9.2233720368547748E+18
2151 ; FP16-NEXT: .long 1138753535
2152 %x = call i64 @llvm.fptosi.sat.i64.f64(double %f)
2156 define i100 @test_signed_i100_f64(double %f) nounwind {
2157 ; SOFT-LABEL: test_signed_i100_f64:
2159 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
2160 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
2161 ; SOFT-NEXT: .pad #28
2162 ; SOFT-NEXT: sub sp, #28
2163 ; SOFT-NEXT: mov r5, r1
2164 ; SOFT-NEXT: mov r6, r0
2165 ; SOFT-NEXT: movs r4, #0
2166 ; SOFT-NEXT: mvns r2, r4
2167 ; SOFT-NEXT: ldr r3, .LCPI18_0
2168 ; SOFT-NEXT: str r2, [sp, #24] @ 4-byte Spill
2169 ; SOFT-NEXT: bl __aeabi_dcmpgt
2170 ; SOFT-NEXT: str r0, [sp, #20] @ 4-byte Spill
2171 ; SOFT-NEXT: ldr r3, .LCPI18_1
2172 ; SOFT-NEXT: mov r0, r6
2173 ; SOFT-NEXT: mov r1, r5
2174 ; SOFT-NEXT: mov r2, r4
2175 ; SOFT-NEXT: bl __aeabi_dcmpge
2176 ; SOFT-NEXT: mov r7, r0
2177 ; SOFT-NEXT: mov r0, r6
2178 ; SOFT-NEXT: mov r1, r5
2179 ; SOFT-NEXT: bl __fixdfti
2180 ; SOFT-NEXT: str r1, [sp, #12] @ 4-byte Spill
2181 ; SOFT-NEXT: str r2, [sp, #16] @ 4-byte Spill
2182 ; SOFT-NEXT: str r3, [sp, #8] @ 4-byte Spill
2183 ; SOFT-NEXT: cmp r7, #0
2184 ; SOFT-NEXT: bne .LBB18_2
2185 ; SOFT-NEXT: @ %bb.1:
2186 ; SOFT-NEXT: mov r0, r7
2187 ; SOFT-NEXT: .LBB18_2:
2188 ; SOFT-NEXT: ldr r1, [sp, #20] @ 4-byte Reload
2189 ; SOFT-NEXT: cmp r1, #0
2190 ; SOFT-NEXT: ldr r1, [sp, #24] @ 4-byte Reload
2191 ; SOFT-NEXT: bne .LBB18_4
2192 ; SOFT-NEXT: @ %bb.3:
2193 ; SOFT-NEXT: mov r1, r0
2194 ; SOFT-NEXT: .LBB18_4:
2195 ; SOFT-NEXT: str r1, [sp, #4] @ 4-byte Spill
2196 ; SOFT-NEXT: mov r0, r6
2197 ; SOFT-NEXT: mov r1, r5
2198 ; SOFT-NEXT: mov r2, r6
2199 ; SOFT-NEXT: mov r3, r5
2200 ; SOFT-NEXT: bl __aeabi_dcmpun
2201 ; SOFT-NEXT: mov r3, r0
2202 ; SOFT-NEXT: cmp r0, #0
2203 ; SOFT-NEXT: mov r0, r4
2204 ; SOFT-NEXT: bne .LBB18_6
2205 ; SOFT-NEXT: @ %bb.5:
2206 ; SOFT-NEXT: ldr r0, [sp, #4] @ 4-byte Reload
2207 ; SOFT-NEXT: .LBB18_6:
2208 ; SOFT-NEXT: cmp r7, #0
2209 ; SOFT-NEXT: ldr r6, [sp, #20] @ 4-byte Reload
2210 ; SOFT-NEXT: bne .LBB18_8
2211 ; SOFT-NEXT: @ %bb.7:
2212 ; SOFT-NEXT: str r7, [sp, #12] @ 4-byte Spill
2213 ; SOFT-NEXT: .LBB18_8:
2214 ; SOFT-NEXT: cmp r6, #0
2215 ; SOFT-NEXT: ldr r2, [sp, #24] @ 4-byte Reload
2216 ; SOFT-NEXT: bne .LBB18_10
2217 ; SOFT-NEXT: @ %bb.9:
2218 ; SOFT-NEXT: ldr r2, [sp, #12] @ 4-byte Reload
2219 ; SOFT-NEXT: .LBB18_10:
2220 ; SOFT-NEXT: cmp r3, #0
2221 ; SOFT-NEXT: mov r1, r4
2222 ; SOFT-NEXT: beq .LBB18_18
2223 ; SOFT-NEXT: @ %bb.11:
2224 ; SOFT-NEXT: cmp r7, #0
2225 ; SOFT-NEXT: beq .LBB18_19
2226 ; SOFT-NEXT: .LBB18_12:
2227 ; SOFT-NEXT: cmp r6, #0
2228 ; SOFT-NEXT: bne .LBB18_14
2229 ; SOFT-NEXT: .LBB18_13:
2230 ; SOFT-NEXT: ldr r2, [sp, #16] @ 4-byte Reload
2231 ; SOFT-NEXT: str r2, [sp, #24] @ 4-byte Spill
2232 ; SOFT-NEXT: .LBB18_14:
2233 ; SOFT-NEXT: cmp r3, #0
2234 ; SOFT-NEXT: mov r2, r4
2235 ; SOFT-NEXT: bne .LBB18_16
2236 ; SOFT-NEXT: @ %bb.15:
2237 ; SOFT-NEXT: ldr r2, [sp, #24] @ 4-byte Reload
2238 ; SOFT-NEXT: .LBB18_16:
2239 ; SOFT-NEXT: movs r5, #7
2240 ; SOFT-NEXT: cmp r7, #0
2241 ; SOFT-NEXT: beq .LBB18_20
2242 ; SOFT-NEXT: @ %bb.17:
2243 ; SOFT-NEXT: ldr r7, [sp, #8] @ 4-byte Reload
2244 ; SOFT-NEXT: cmp r6, #0
2245 ; SOFT-NEXT: beq .LBB18_21
2246 ; SOFT-NEXT: b .LBB18_22
2247 ; SOFT-NEXT: .LBB18_18:
2248 ; SOFT-NEXT: mov r1, r2
2249 ; SOFT-NEXT: cmp r7, #0
2250 ; SOFT-NEXT: bne .LBB18_12
2251 ; SOFT-NEXT: .LBB18_19:
2252 ; SOFT-NEXT: str r7, [sp, #16] @ 4-byte Spill
2253 ; SOFT-NEXT: cmp r6, #0
2254 ; SOFT-NEXT: beq .LBB18_13
2255 ; SOFT-NEXT: b .LBB18_14
2256 ; SOFT-NEXT: .LBB18_20:
2257 ; SOFT-NEXT: mvns r7, r5
2258 ; SOFT-NEXT: cmp r6, #0
2259 ; SOFT-NEXT: bne .LBB18_22
2260 ; SOFT-NEXT: .LBB18_21:
2261 ; SOFT-NEXT: mov r5, r7
2262 ; SOFT-NEXT: .LBB18_22:
2263 ; SOFT-NEXT: cmp r3, #0
2264 ; SOFT-NEXT: bne .LBB18_24
2265 ; SOFT-NEXT: @ %bb.23:
2266 ; SOFT-NEXT: mov r4, r5
2267 ; SOFT-NEXT: .LBB18_24:
2268 ; SOFT-NEXT: mov r3, r4
2269 ; SOFT-NEXT: add sp, #28
2270 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
2271 ; SOFT-NEXT: .p2align 2
2272 ; SOFT-NEXT: @ %bb.25:
2273 ; SOFT-NEXT: .LCPI18_0:
2274 ; SOFT-NEXT: .long 1176502271 @ 0x461fffff
2275 ; SOFT-NEXT: .LCPI18_1:
2276 ; SOFT-NEXT: .long 3323985920 @ 0xc6200000
2278 ; VFP2-LABEL: test_signed_i100_f64:
2280 ; VFP2-NEXT: .save {r4, r5, r7, lr}
2281 ; VFP2-NEXT: push {r4, r5, r7, lr}
2282 ; VFP2-NEXT: mov r4, r1
2283 ; VFP2-NEXT: mov r5, r0
2284 ; VFP2-NEXT: bl __fixdfti
2285 ; VFP2-NEXT: vldr d16, .LCPI18_0
2286 ; VFP2-NEXT: vmov d17, r5, r4
2287 ; VFP2-NEXT: vldr d18, .LCPI18_1
2288 ; VFP2-NEXT: vcmp.f64 d17, d16
2289 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2291 ; VFP2-NEXT: movlt r0, #0
2292 ; VFP2-NEXT: vcmp.f64 d17, d18
2293 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2295 ; VFP2-NEXT: movgt.w r0, #-1
2296 ; VFP2-NEXT: vcmp.f64 d17, d17
2297 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2299 ; VFP2-NEXT: movvs r0, #0
2300 ; VFP2-NEXT: vcmp.f64 d17, d16
2301 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2303 ; VFP2-NEXT: movlt r1, #0
2304 ; VFP2-NEXT: vcmp.f64 d17, d18
2305 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2307 ; VFP2-NEXT: movgt.w r1, #-1
2308 ; VFP2-NEXT: vcmp.f64 d17, d17
2309 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2311 ; VFP2-NEXT: movvs r1, #0
2312 ; VFP2-NEXT: vcmp.f64 d17, d16
2313 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2315 ; VFP2-NEXT: movlt r2, #0
2316 ; VFP2-NEXT: vcmp.f64 d17, d18
2317 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2319 ; VFP2-NEXT: movgt.w r2, #-1
2320 ; VFP2-NEXT: vcmp.f64 d17, d17
2321 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2323 ; VFP2-NEXT: movvs r2, #0
2324 ; VFP2-NEXT: vcmp.f64 d17, d16
2325 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2327 ; VFP2-NEXT: mvnlt r3, #7
2328 ; VFP2-NEXT: vcmp.f64 d17, d18
2329 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2331 ; VFP2-NEXT: movgt r3, #7
2332 ; VFP2-NEXT: vcmp.f64 d17, d17
2333 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2335 ; VFP2-NEXT: movvs r3, #0
2336 ; VFP2-NEXT: pop {r4, r5, r7, pc}
2337 ; VFP2-NEXT: .p2align 3
2338 ; VFP2-NEXT: @ %bb.1:
2339 ; VFP2-NEXT: .LCPI18_0:
2340 ; VFP2-NEXT: .long 0 @ double -6.338253001141147E+29
2341 ; VFP2-NEXT: .long 3323985920
2342 ; VFP2-NEXT: .LCPI18_1:
2343 ; VFP2-NEXT: .long 4294967295 @ double 6.3382530011411463E+29
2344 ; VFP2-NEXT: .long 1176502271
2346 ; FP16-LABEL: test_signed_i100_f64:
2348 ; FP16-NEXT: .save {r4, r5, r7, lr}
2349 ; FP16-NEXT: push {r4, r5, r7, lr}
2350 ; FP16-NEXT: mov r4, r1
2351 ; FP16-NEXT: mov r5, r0
2352 ; FP16-NEXT: bl __fixdfti
2353 ; FP16-NEXT: vldr d2, .LCPI18_0
2354 ; FP16-NEXT: vmov d0, r5, r4
2355 ; FP16-NEXT: vldr d1, .LCPI18_1
2356 ; FP16-NEXT: vcmp.f64 d0, d2
2357 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2359 ; FP16-NEXT: movlt r0, #0
2360 ; FP16-NEXT: vcmp.f64 d0, d1
2361 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2363 ; FP16-NEXT: movgt.w r0, #-1
2364 ; FP16-NEXT: vcmp.f64 d0, d0
2365 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2367 ; FP16-NEXT: movvs r0, #0
2368 ; FP16-NEXT: vcmp.f64 d0, d2
2369 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2371 ; FP16-NEXT: movlt r1, #0
2372 ; FP16-NEXT: vcmp.f64 d0, d1
2373 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2375 ; FP16-NEXT: movgt.w r1, #-1
2376 ; FP16-NEXT: vcmp.f64 d0, d0
2377 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2379 ; FP16-NEXT: movvs r1, #0
2380 ; FP16-NEXT: vcmp.f64 d0, d2
2381 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2383 ; FP16-NEXT: movlt r2, #0
2384 ; FP16-NEXT: vcmp.f64 d0, d1
2385 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2387 ; FP16-NEXT: movgt.w r2, #-1
2388 ; FP16-NEXT: vcmp.f64 d0, d0
2389 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2391 ; FP16-NEXT: movvs r2, #0
2392 ; FP16-NEXT: vcmp.f64 d0, d2
2393 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2395 ; FP16-NEXT: mvnlt r3, #7
2396 ; FP16-NEXT: vcmp.f64 d0, d1
2397 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2399 ; FP16-NEXT: movgt r3, #7
2400 ; FP16-NEXT: vcmp.f64 d0, d0
2401 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2403 ; FP16-NEXT: movvs r3, #0
2404 ; FP16-NEXT: pop {r4, r5, r7, pc}
2405 ; FP16-NEXT: .p2align 3
2406 ; FP16-NEXT: @ %bb.1:
2407 ; FP16-NEXT: .LCPI18_0:
2408 ; FP16-NEXT: .long 0 @ double -6.338253001141147E+29
2409 ; FP16-NEXT: .long 3323985920
2410 ; FP16-NEXT: .LCPI18_1:
2411 ; FP16-NEXT: .long 4294967295 @ double 6.3382530011411463E+29
2412 ; FP16-NEXT: .long 1176502271
2413 %x = call i100 @llvm.fptosi.sat.i100.f64(double %f)
2417 define i128 @test_signed_i128_f64(double %f) nounwind {
2418 ; SOFT-LABEL: test_signed_i128_f64:
2420 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
2421 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
2422 ; SOFT-NEXT: .pad #28
2423 ; SOFT-NEXT: sub sp, #28
2424 ; SOFT-NEXT: mov r5, r1
2425 ; SOFT-NEXT: mov r6, r0
2426 ; SOFT-NEXT: movs r4, #0
2427 ; SOFT-NEXT: mvns r2, r4
2428 ; SOFT-NEXT: ldr r3, .LCPI19_0
2429 ; SOFT-NEXT: str r2, [sp, #24] @ 4-byte Spill
2430 ; SOFT-NEXT: bl __aeabi_dcmpgt
2431 ; SOFT-NEXT: str r0, [sp, #20] @ 4-byte Spill
2432 ; SOFT-NEXT: ldr r3, .LCPI19_1
2433 ; SOFT-NEXT: mov r0, r6
2434 ; SOFT-NEXT: mov r1, r5
2435 ; SOFT-NEXT: mov r2, r4
2436 ; SOFT-NEXT: bl __aeabi_dcmpge
2437 ; SOFT-NEXT: mov r7, r0
2438 ; SOFT-NEXT: mov r0, r6
2439 ; SOFT-NEXT: mov r1, r5
2440 ; SOFT-NEXT: bl __fixdfti
2441 ; SOFT-NEXT: str r1, [sp, #12] @ 4-byte Spill
2442 ; SOFT-NEXT: str r2, [sp, #16] @ 4-byte Spill
2443 ; SOFT-NEXT: str r3, [sp, #8] @ 4-byte Spill
2444 ; SOFT-NEXT: cmp r7, #0
2445 ; SOFT-NEXT: bne .LBB19_2
2446 ; SOFT-NEXT: @ %bb.1:
2447 ; SOFT-NEXT: mov r0, r7
2448 ; SOFT-NEXT: .LBB19_2:
2449 ; SOFT-NEXT: ldr r1, [sp, #20] @ 4-byte Reload
2450 ; SOFT-NEXT: cmp r1, #0
2451 ; SOFT-NEXT: ldr r1, [sp, #24] @ 4-byte Reload
2452 ; SOFT-NEXT: bne .LBB19_4
2453 ; SOFT-NEXT: @ %bb.3:
2454 ; SOFT-NEXT: mov r1, r0
2455 ; SOFT-NEXT: .LBB19_4:
2456 ; SOFT-NEXT: str r1, [sp, #4] @ 4-byte Spill
2457 ; SOFT-NEXT: mov r0, r6
2458 ; SOFT-NEXT: mov r1, r5
2459 ; SOFT-NEXT: mov r2, r6
2460 ; SOFT-NEXT: mov r3, r5
2461 ; SOFT-NEXT: bl __aeabi_dcmpun
2462 ; SOFT-NEXT: mov r3, r0
2463 ; SOFT-NEXT: cmp r0, #0
2464 ; SOFT-NEXT: mov r0, r4
2465 ; SOFT-NEXT: bne .LBB19_6
2466 ; SOFT-NEXT: @ %bb.5:
2467 ; SOFT-NEXT: ldr r0, [sp, #4] @ 4-byte Reload
2468 ; SOFT-NEXT: .LBB19_6:
2469 ; SOFT-NEXT: cmp r7, #0
2470 ; SOFT-NEXT: ldr r6, [sp, #20] @ 4-byte Reload
2471 ; SOFT-NEXT: bne .LBB19_8
2472 ; SOFT-NEXT: @ %bb.7:
2473 ; SOFT-NEXT: str r7, [sp, #12] @ 4-byte Spill
2474 ; SOFT-NEXT: .LBB19_8:
2475 ; SOFT-NEXT: cmp r6, #0
2476 ; SOFT-NEXT: ldr r2, [sp, #24] @ 4-byte Reload
2477 ; SOFT-NEXT: bne .LBB19_10
2478 ; SOFT-NEXT: @ %bb.9:
2479 ; SOFT-NEXT: ldr r2, [sp, #12] @ 4-byte Reload
2480 ; SOFT-NEXT: .LBB19_10:
2481 ; SOFT-NEXT: cmp r3, #0
2482 ; SOFT-NEXT: mov r1, r4
2483 ; SOFT-NEXT: beq .LBB19_18
2484 ; SOFT-NEXT: @ %bb.11:
2485 ; SOFT-NEXT: cmp r7, #0
2486 ; SOFT-NEXT: beq .LBB19_19
2487 ; SOFT-NEXT: .LBB19_12:
2488 ; SOFT-NEXT: cmp r6, #0
2489 ; SOFT-NEXT: bne .LBB19_14
2490 ; SOFT-NEXT: .LBB19_13:
2491 ; SOFT-NEXT: ldr r2, [sp, #16] @ 4-byte Reload
2492 ; SOFT-NEXT: str r2, [sp, #24] @ 4-byte Spill
2493 ; SOFT-NEXT: .LBB19_14:
2494 ; SOFT-NEXT: cmp r3, #0
2495 ; SOFT-NEXT: mov r2, r4
2496 ; SOFT-NEXT: bne .LBB19_16
2497 ; SOFT-NEXT: @ %bb.15:
2498 ; SOFT-NEXT: ldr r2, [sp, #24] @ 4-byte Reload
2499 ; SOFT-NEXT: .LBB19_16:
2500 ; SOFT-NEXT: cmp r7, #0
2501 ; SOFT-NEXT: beq .LBB19_20
2502 ; SOFT-NEXT: @ %bb.17:
2503 ; SOFT-NEXT: ldr r5, [sp, #8] @ 4-byte Reload
2504 ; SOFT-NEXT: cmp r6, #0
2505 ; SOFT-NEXT: bne .LBB19_21
2506 ; SOFT-NEXT: b .LBB19_22
2507 ; SOFT-NEXT: .LBB19_18:
2508 ; SOFT-NEXT: mov r1, r2
2509 ; SOFT-NEXT: cmp r7, #0
2510 ; SOFT-NEXT: bne .LBB19_12
2511 ; SOFT-NEXT: .LBB19_19:
2512 ; SOFT-NEXT: str r7, [sp, #16] @ 4-byte Spill
2513 ; SOFT-NEXT: cmp r6, #0
2514 ; SOFT-NEXT: beq .LBB19_13
2515 ; SOFT-NEXT: b .LBB19_14
2516 ; SOFT-NEXT: .LBB19_20:
2517 ; SOFT-NEXT: movs r5, #1
2518 ; SOFT-NEXT: lsls r5, r5, #31
2519 ; SOFT-NEXT: cmp r6, #0
2520 ; SOFT-NEXT: beq .LBB19_22
2521 ; SOFT-NEXT: .LBB19_21:
2522 ; SOFT-NEXT: ldr r5, .LCPI19_2
2523 ; SOFT-NEXT: .LBB19_22:
2524 ; SOFT-NEXT: cmp r3, #0
2525 ; SOFT-NEXT: bne .LBB19_24
2526 ; SOFT-NEXT: @ %bb.23:
2527 ; SOFT-NEXT: mov r4, r5
2528 ; SOFT-NEXT: .LBB19_24:
2529 ; SOFT-NEXT: mov r3, r4
2530 ; SOFT-NEXT: add sp, #28
2531 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
2532 ; SOFT-NEXT: .p2align 2
2533 ; SOFT-NEXT: @ %bb.25:
2534 ; SOFT-NEXT: .LCPI19_0:
2535 ; SOFT-NEXT: .long 1205862399 @ 0x47dfffff
2536 ; SOFT-NEXT: .LCPI19_1:
2537 ; SOFT-NEXT: .long 3353346048 @ 0xc7e00000
2538 ; SOFT-NEXT: .LCPI19_2:
2539 ; SOFT-NEXT: .long 2147483647 @ 0x7fffffff
2541 ; VFP2-LABEL: test_signed_i128_f64:
2543 ; VFP2-NEXT: .save {r4, r5, r7, lr}
2544 ; VFP2-NEXT: push {r4, r5, r7, lr}
2545 ; VFP2-NEXT: mov r4, r1
2546 ; VFP2-NEXT: mov r5, r0
2547 ; VFP2-NEXT: bl __fixdfti
2548 ; VFP2-NEXT: vldr d16, .LCPI19_0
2549 ; VFP2-NEXT: vmov d17, r5, r4
2550 ; VFP2-NEXT: vldr d18, .LCPI19_1
2551 ; VFP2-NEXT: vcmp.f64 d17, d16
2552 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2554 ; VFP2-NEXT: movlt r0, #0
2555 ; VFP2-NEXT: vcmp.f64 d17, d18
2556 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2558 ; VFP2-NEXT: movgt.w r0, #-1
2559 ; VFP2-NEXT: vcmp.f64 d17, d17
2560 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2562 ; VFP2-NEXT: movvs r0, #0
2563 ; VFP2-NEXT: vcmp.f64 d17, d16
2564 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2566 ; VFP2-NEXT: movlt r1, #0
2567 ; VFP2-NEXT: vcmp.f64 d17, d18
2568 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2570 ; VFP2-NEXT: movgt.w r1, #-1
2571 ; VFP2-NEXT: vcmp.f64 d17, d17
2572 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2574 ; VFP2-NEXT: movvs r1, #0
2575 ; VFP2-NEXT: vcmp.f64 d17, d16
2576 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2578 ; VFP2-NEXT: movlt r2, #0
2579 ; VFP2-NEXT: vcmp.f64 d17, d18
2580 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2582 ; VFP2-NEXT: movgt.w r2, #-1
2583 ; VFP2-NEXT: vcmp.f64 d17, d17
2584 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2586 ; VFP2-NEXT: movvs r2, #0
2587 ; VFP2-NEXT: vcmp.f64 d17, d16
2588 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2590 ; VFP2-NEXT: movlt.w r3, #-2147483648
2591 ; VFP2-NEXT: vcmp.f64 d17, d18
2592 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2594 ; VFP2-NEXT: mvngt r3, #-2147483648
2595 ; VFP2-NEXT: vcmp.f64 d17, d17
2596 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2598 ; VFP2-NEXT: movvs r3, #0
2599 ; VFP2-NEXT: pop {r4, r5, r7, pc}
2600 ; VFP2-NEXT: .p2align 3
2601 ; VFP2-NEXT: @ %bb.1:
2602 ; VFP2-NEXT: .LCPI19_0:
2603 ; VFP2-NEXT: .long 0 @ double -1.7014118346046923E+38
2604 ; VFP2-NEXT: .long 3353346048
2605 ; VFP2-NEXT: .LCPI19_1:
2606 ; VFP2-NEXT: .long 4294967295 @ double 1.7014118346046921E+38
2607 ; VFP2-NEXT: .long 1205862399
2609 ; FP16-LABEL: test_signed_i128_f64:
2611 ; FP16-NEXT: .save {r4, r5, r7, lr}
2612 ; FP16-NEXT: push {r4, r5, r7, lr}
2613 ; FP16-NEXT: mov r4, r1
2614 ; FP16-NEXT: mov r5, r0
2615 ; FP16-NEXT: bl __fixdfti
2616 ; FP16-NEXT: vldr d2, .LCPI19_0
2617 ; FP16-NEXT: vmov d0, r5, r4
2618 ; FP16-NEXT: vldr d1, .LCPI19_1
2619 ; FP16-NEXT: vcmp.f64 d0, d2
2620 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2622 ; FP16-NEXT: movlt r0, #0
2623 ; FP16-NEXT: vcmp.f64 d0, d1
2624 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2626 ; FP16-NEXT: movgt.w r0, #-1
2627 ; FP16-NEXT: vcmp.f64 d0, d0
2628 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2630 ; FP16-NEXT: movvs r0, #0
2631 ; FP16-NEXT: vcmp.f64 d0, d2
2632 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2634 ; FP16-NEXT: movlt r1, #0
2635 ; FP16-NEXT: vcmp.f64 d0, d1
2636 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2638 ; FP16-NEXT: movgt.w r1, #-1
2639 ; FP16-NEXT: vcmp.f64 d0, d0
2640 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2642 ; FP16-NEXT: movvs r1, #0
2643 ; FP16-NEXT: vcmp.f64 d0, d2
2644 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2646 ; FP16-NEXT: movlt r2, #0
2647 ; FP16-NEXT: vcmp.f64 d0, d1
2648 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2650 ; FP16-NEXT: movgt.w r2, #-1
2651 ; FP16-NEXT: vcmp.f64 d0, d0
2652 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2654 ; FP16-NEXT: movvs r2, #0
2655 ; FP16-NEXT: vcmp.f64 d0, d2
2656 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2658 ; FP16-NEXT: movlt.w r3, #-2147483648
2659 ; FP16-NEXT: vcmp.f64 d0, d1
2660 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2662 ; FP16-NEXT: mvngt r3, #-2147483648
2663 ; FP16-NEXT: vcmp.f64 d0, d0
2664 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2666 ; FP16-NEXT: movvs r3, #0
2667 ; FP16-NEXT: pop {r4, r5, r7, pc}
2668 ; FP16-NEXT: .p2align 3
2669 ; FP16-NEXT: @ %bb.1:
2670 ; FP16-NEXT: .LCPI19_0:
2671 ; FP16-NEXT: .long 0 @ double -1.7014118346046923E+38
2672 ; FP16-NEXT: .long 3353346048
2673 ; FP16-NEXT: .LCPI19_1:
2674 ; FP16-NEXT: .long 4294967295 @ double 1.7014118346046921E+38
2675 ; FP16-NEXT: .long 1205862399
2676 %x = call i128 @llvm.fptosi.sat.i128.f64(double %f)
2681 ; 16-bit float to signed integer
2684 declare i1 @llvm.fptosi.sat.i1.f16 (half)
2685 declare i8 @llvm.fptosi.sat.i8.f16 (half)
2686 declare i13 @llvm.fptosi.sat.i13.f16 (half)
2687 declare i16 @llvm.fptosi.sat.i16.f16 (half)
2688 declare i19 @llvm.fptosi.sat.i19.f16 (half)
2689 declare i32 @llvm.fptosi.sat.i32.f16 (half)
2690 declare i50 @llvm.fptosi.sat.i50.f16 (half)
2691 declare i64 @llvm.fptosi.sat.i64.f16 (half)
2692 declare i100 @llvm.fptosi.sat.i100.f16(half)
2693 declare i128 @llvm.fptosi.sat.i128.f16(half)
2695 define i1 @test_signed_i1_f16(half %f) nounwind {
2696 ; SOFT-LABEL: test_signed_i1_f16:
2698 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
2699 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
2700 ; SOFT-NEXT: .pad #4
2701 ; SOFT-NEXT: sub sp, #4
2702 ; SOFT-NEXT: uxth r0, r0
2703 ; SOFT-NEXT: bl __aeabi_h2f
2704 ; SOFT-NEXT: mov r4, r0
2705 ; SOFT-NEXT: ldr r1, .LCPI20_0
2706 ; SOFT-NEXT: bl __aeabi_fcmpge
2707 ; SOFT-NEXT: mov r7, r0
2708 ; SOFT-NEXT: mov r0, r4
2709 ; SOFT-NEXT: bl __aeabi_f2iz
2710 ; SOFT-NEXT: movs r5, #0
2711 ; SOFT-NEXT: cmp r7, #0
2712 ; SOFT-NEXT: beq .LBB20_2
2713 ; SOFT-NEXT: @ %bb.1:
2714 ; SOFT-NEXT: mov r6, r0
2715 ; SOFT-NEXT: b .LBB20_3
2716 ; SOFT-NEXT: .LBB20_2:
2717 ; SOFT-NEXT: mvns r6, r5
2718 ; SOFT-NEXT: .LBB20_3:
2719 ; SOFT-NEXT: mov r0, r4
2720 ; SOFT-NEXT: mov r1, r5
2721 ; SOFT-NEXT: bl __aeabi_fcmpgt
2722 ; SOFT-NEXT: cmp r0, #0
2723 ; SOFT-NEXT: mov r7, r5
2724 ; SOFT-NEXT: bne .LBB20_5
2725 ; SOFT-NEXT: @ %bb.4:
2726 ; SOFT-NEXT: mov r7, r6
2727 ; SOFT-NEXT: .LBB20_5:
2728 ; SOFT-NEXT: mov r0, r4
2729 ; SOFT-NEXT: mov r1, r4
2730 ; SOFT-NEXT: bl __aeabi_fcmpun
2731 ; SOFT-NEXT: cmp r0, #0
2732 ; SOFT-NEXT: bne .LBB20_7
2733 ; SOFT-NEXT: @ %bb.6:
2734 ; SOFT-NEXT: mov r5, r7
2735 ; SOFT-NEXT: .LBB20_7:
2736 ; SOFT-NEXT: mov r0, r5
2737 ; SOFT-NEXT: add sp, #4
2738 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
2739 ; SOFT-NEXT: .p2align 2
2740 ; SOFT-NEXT: @ %bb.8:
2741 ; SOFT-NEXT: .LCPI20_0:
2742 ; SOFT-NEXT: .long 3212836864 @ 0xbf800000
2744 ; VFP2-LABEL: test_signed_i1_f16:
2746 ; VFP2-NEXT: .save {r7, lr}
2747 ; VFP2-NEXT: push {r7, lr}
2748 ; VFP2-NEXT: bl __aeabi_h2f
2749 ; VFP2-NEXT: vmov s2, r0
2750 ; VFP2-NEXT: vmov.f32 s0, #-1.000000e+00
2751 ; VFP2-NEXT: vcvt.s32.f32 s4, s2
2752 ; VFP2-NEXT: vcmp.f32 s2, s0
2753 ; VFP2-NEXT: vmov r0, s4
2754 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2756 ; VFP2-NEXT: movlt.w r0, #-1
2757 ; VFP2-NEXT: vcmp.f32 s2, #0
2758 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2760 ; VFP2-NEXT: movgt r0, #0
2761 ; VFP2-NEXT: vcmp.f32 s2, s2
2762 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2764 ; VFP2-NEXT: movvs r0, #0
2765 ; VFP2-NEXT: pop {r7, pc}
2767 ; FP16-LABEL: test_signed_i1_f16:
2769 ; FP16-NEXT: vmov.f16 s0, r0
2770 ; FP16-NEXT: vldr s2, .LCPI20_0
2771 ; FP16-NEXT: vcvtb.f32.f16 s0, s0
2772 ; FP16-NEXT: vmov.f32 s4, #-1.000000e+00
2773 ; FP16-NEXT: vmaxnm.f32 s4, s0, s4
2774 ; FP16-NEXT: vcmp.f32 s0, s0
2775 ; FP16-NEXT: vminnm.f32 s2, s4, s2
2776 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2777 ; FP16-NEXT: vcvt.s32.f32 s2, s2
2778 ; FP16-NEXT: vmov r0, s2
2780 ; FP16-NEXT: movvs r0, #0
2782 ; FP16-NEXT: .p2align 2
2783 ; FP16-NEXT: @ %bb.1:
2784 ; FP16-NEXT: .LCPI20_0:
2785 ; FP16-NEXT: .long 0x00000000 @ float 0
2786 %x = call i1 @llvm.fptosi.sat.i1.f16(half %f)
2790 define i8 @test_signed_i8_f16(half %f) nounwind {
2791 ; SOFT-LABEL: test_signed_i8_f16:
2793 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
2794 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
2795 ; SOFT-NEXT: .pad #4
2796 ; SOFT-NEXT: sub sp, #4
2797 ; SOFT-NEXT: uxth r0, r0
2798 ; SOFT-NEXT: bl __aeabi_h2f
2799 ; SOFT-NEXT: mov r4, r0
2800 ; SOFT-NEXT: movs r0, #195
2801 ; SOFT-NEXT: lsls r1, r0, #24
2802 ; SOFT-NEXT: mov r0, r4
2803 ; SOFT-NEXT: bl __aeabi_fcmpge
2804 ; SOFT-NEXT: mov r7, r0
2805 ; SOFT-NEXT: mov r0, r4
2806 ; SOFT-NEXT: bl __aeabi_f2iz
2807 ; SOFT-NEXT: movs r5, #127
2808 ; SOFT-NEXT: cmp r7, #0
2809 ; SOFT-NEXT: beq .LBB21_2
2810 ; SOFT-NEXT: @ %bb.1:
2811 ; SOFT-NEXT: mov r6, r0
2812 ; SOFT-NEXT: b .LBB21_3
2813 ; SOFT-NEXT: .LBB21_2:
2814 ; SOFT-NEXT: mvns r6, r5
2815 ; SOFT-NEXT: .LBB21_3:
2816 ; SOFT-NEXT: ldr r1, .LCPI21_0
2817 ; SOFT-NEXT: mov r0, r4
2818 ; SOFT-NEXT: bl __aeabi_fcmpgt
2819 ; SOFT-NEXT: cmp r0, #0
2820 ; SOFT-NEXT: bne .LBB21_5
2821 ; SOFT-NEXT: @ %bb.4:
2822 ; SOFT-NEXT: mov r5, r6
2823 ; SOFT-NEXT: .LBB21_5:
2824 ; SOFT-NEXT: mov r0, r4
2825 ; SOFT-NEXT: mov r1, r4
2826 ; SOFT-NEXT: bl __aeabi_fcmpun
2827 ; SOFT-NEXT: cmp r0, #0
2828 ; SOFT-NEXT: beq .LBB21_7
2829 ; SOFT-NEXT: @ %bb.6:
2830 ; SOFT-NEXT: movs r5, #0
2831 ; SOFT-NEXT: .LBB21_7:
2832 ; SOFT-NEXT: mov r0, r5
2833 ; SOFT-NEXT: add sp, #4
2834 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
2835 ; SOFT-NEXT: .p2align 2
2836 ; SOFT-NEXT: @ %bb.8:
2837 ; SOFT-NEXT: .LCPI21_0:
2838 ; SOFT-NEXT: .long 1123942400 @ 0x42fe0000
2840 ; VFP2-LABEL: test_signed_i8_f16:
2842 ; VFP2-NEXT: .save {r7, lr}
2843 ; VFP2-NEXT: push {r7, lr}
2844 ; VFP2-NEXT: bl __aeabi_h2f
2845 ; VFP2-NEXT: vmov s0, r0
2846 ; VFP2-NEXT: vldr s2, .LCPI21_0
2847 ; VFP2-NEXT: vldr s6, .LCPI21_1
2848 ; VFP2-NEXT: vcvt.s32.f32 s4, s0
2849 ; VFP2-NEXT: vcmp.f32 s0, s2
2850 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2851 ; VFP2-NEXT: vcmp.f32 s0, s6
2852 ; VFP2-NEXT: vmov r0, s4
2854 ; VFP2-NEXT: mvnlt r0, #127
2855 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2857 ; VFP2-NEXT: movgt r0, #127
2858 ; VFP2-NEXT: vcmp.f32 s0, s0
2859 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2861 ; VFP2-NEXT: movvs r0, #0
2862 ; VFP2-NEXT: pop {r7, pc}
2863 ; VFP2-NEXT: .p2align 2
2864 ; VFP2-NEXT: @ %bb.1:
2865 ; VFP2-NEXT: .LCPI21_0:
2866 ; VFP2-NEXT: .long 0xc3000000 @ float -128
2867 ; VFP2-NEXT: .LCPI21_1:
2868 ; VFP2-NEXT: .long 0x42fe0000 @ float 127
2870 ; FP16-LABEL: test_signed_i8_f16:
2872 ; FP16-NEXT: vmov.f16 s0, r0
2873 ; FP16-NEXT: vldr s4, .LCPI21_1
2874 ; FP16-NEXT: vcvtb.f32.f16 s0, s0
2875 ; FP16-NEXT: vldr s2, .LCPI21_0
2876 ; FP16-NEXT: vmaxnm.f32 s4, s0, s4
2877 ; FP16-NEXT: vcmp.f32 s0, s0
2878 ; FP16-NEXT: vminnm.f32 s2, s4, s2
2879 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2880 ; FP16-NEXT: vcvt.s32.f32 s2, s2
2881 ; FP16-NEXT: vmov r0, s2
2883 ; FP16-NEXT: movvs r0, #0
2885 ; FP16-NEXT: .p2align 2
2886 ; FP16-NEXT: @ %bb.1:
2887 ; FP16-NEXT: .LCPI21_0:
2888 ; FP16-NEXT: .long 0x42fe0000 @ float 127
2889 ; FP16-NEXT: .LCPI21_1:
2890 ; FP16-NEXT: .long 0xc3000000 @ float -128
2891 %x = call i8 @llvm.fptosi.sat.i8.f16(half %f)
2895 define i13 @test_signed_i13_f16(half %f) nounwind {
2896 ; SOFT-LABEL: test_signed_i13_f16:
2898 ; SOFT-NEXT: .save {r4, r5, r6, lr}
2899 ; SOFT-NEXT: push {r4, r5, r6, lr}
2900 ; SOFT-NEXT: uxth r0, r0
2901 ; SOFT-NEXT: bl __aeabi_h2f
2902 ; SOFT-NEXT: mov r4, r0
2903 ; SOFT-NEXT: ldr r1, .LCPI22_0
2904 ; SOFT-NEXT: bl __aeabi_fcmpge
2905 ; SOFT-NEXT: mov r6, r0
2906 ; SOFT-NEXT: mov r0, r4
2907 ; SOFT-NEXT: bl __aeabi_f2iz
2908 ; SOFT-NEXT: cmp r6, #0
2909 ; SOFT-NEXT: beq .LBB22_2
2910 ; SOFT-NEXT: @ %bb.1:
2911 ; SOFT-NEXT: mov r5, r0
2912 ; SOFT-NEXT: b .LBB22_3
2913 ; SOFT-NEXT: .LBB22_2:
2914 ; SOFT-NEXT: ldr r5, .LCPI22_1
2915 ; SOFT-NEXT: .LBB22_3:
2916 ; SOFT-NEXT: ldr r1, .LCPI22_2
2917 ; SOFT-NEXT: mov r0, r4
2918 ; SOFT-NEXT: bl __aeabi_fcmpgt
2919 ; SOFT-NEXT: cmp r0, #0
2920 ; SOFT-NEXT: beq .LBB22_5
2921 ; SOFT-NEXT: @ %bb.4:
2922 ; SOFT-NEXT: ldr r5, .LCPI22_3
2923 ; SOFT-NEXT: .LBB22_5:
2924 ; SOFT-NEXT: mov r0, r4
2925 ; SOFT-NEXT: mov r1, r4
2926 ; SOFT-NEXT: bl __aeabi_fcmpun
2927 ; SOFT-NEXT: cmp r0, #0
2928 ; SOFT-NEXT: beq .LBB22_7
2929 ; SOFT-NEXT: @ %bb.6:
2930 ; SOFT-NEXT: movs r5, #0
2931 ; SOFT-NEXT: .LBB22_7:
2932 ; SOFT-NEXT: mov r0, r5
2933 ; SOFT-NEXT: pop {r4, r5, r6, pc}
2934 ; SOFT-NEXT: .p2align 2
2935 ; SOFT-NEXT: @ %bb.8:
2936 ; SOFT-NEXT: .LCPI22_0:
2937 ; SOFT-NEXT: .long 3313500160 @ 0xc5800000
2938 ; SOFT-NEXT: .LCPI22_1:
2939 ; SOFT-NEXT: .long 4294963200 @ 0xfffff000
2940 ; SOFT-NEXT: .LCPI22_2:
2941 ; SOFT-NEXT: .long 1166012416 @ 0x457ff000
2942 ; SOFT-NEXT: .LCPI22_3:
2943 ; SOFT-NEXT: .long 4095 @ 0xfff
2945 ; VFP2-LABEL: test_signed_i13_f16:
2947 ; VFP2-NEXT: .save {r7, lr}
2948 ; VFP2-NEXT: push {r7, lr}
2949 ; VFP2-NEXT: bl __aeabi_h2f
2950 ; VFP2-NEXT: vmov s0, r0
2951 ; VFP2-NEXT: vldr s2, .LCPI22_0
2952 ; VFP2-NEXT: vcvt.s32.f32 s4, s0
2953 ; VFP2-NEXT: vcmp.f32 s0, s2
2954 ; VFP2-NEXT: vldr s2, .LCPI22_1
2955 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2956 ; VFP2-NEXT: vcmp.f32 s0, s2
2957 ; VFP2-NEXT: vmov r0, s4
2959 ; VFP2-NEXT: movwlt r0, #61440
2960 ; VFP2-NEXT: movtlt r0, #65535
2961 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2963 ; VFP2-NEXT: movwgt r0, #4095
2964 ; VFP2-NEXT: vcmp.f32 s0, s0
2965 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2967 ; VFP2-NEXT: movvs r0, #0
2968 ; VFP2-NEXT: pop {r7, pc}
2969 ; VFP2-NEXT: .p2align 2
2970 ; VFP2-NEXT: @ %bb.1:
2971 ; VFP2-NEXT: .LCPI22_0:
2972 ; VFP2-NEXT: .long 0xc5800000 @ float -4096
2973 ; VFP2-NEXT: .LCPI22_1:
2974 ; VFP2-NEXT: .long 0x457ff000 @ float 4095
2976 ; FP16-LABEL: test_signed_i13_f16:
2978 ; FP16-NEXT: vmov.f16 s0, r0
2979 ; FP16-NEXT: vldr s4, .LCPI22_1
2980 ; FP16-NEXT: vcvtb.f32.f16 s0, s0
2981 ; FP16-NEXT: vldr s2, .LCPI22_0
2982 ; FP16-NEXT: vmaxnm.f32 s4, s0, s4
2983 ; FP16-NEXT: vcmp.f32 s0, s0
2984 ; FP16-NEXT: vminnm.f32 s2, s4, s2
2985 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
2986 ; FP16-NEXT: vcvt.s32.f32 s2, s2
2987 ; FP16-NEXT: vmov r0, s2
2989 ; FP16-NEXT: movvs r0, #0
2991 ; FP16-NEXT: .p2align 2
2992 ; FP16-NEXT: @ %bb.1:
2993 ; FP16-NEXT: .LCPI22_0:
2994 ; FP16-NEXT: .long 0x457ff000 @ float 4095
2995 ; FP16-NEXT: .LCPI22_1:
2996 ; FP16-NEXT: .long 0xc5800000 @ float -4096
2997 %x = call i13 @llvm.fptosi.sat.i13.f16(half %f)
3001 define i16 @test_signed_i16_f16(half %f) nounwind {
3002 ; SOFT-LABEL: test_signed_i16_f16:
3004 ; SOFT-NEXT: .save {r4, r5, r6, lr}
3005 ; SOFT-NEXT: push {r4, r5, r6, lr}
3006 ; SOFT-NEXT: uxth r0, r0
3007 ; SOFT-NEXT: bl __aeabi_h2f
3008 ; SOFT-NEXT: mov r4, r0
3009 ; SOFT-NEXT: movs r0, #199
3010 ; SOFT-NEXT: lsls r1, r0, #24
3011 ; SOFT-NEXT: mov r0, r4
3012 ; SOFT-NEXT: bl __aeabi_fcmpge
3013 ; SOFT-NEXT: mov r6, r0
3014 ; SOFT-NEXT: mov r0, r4
3015 ; SOFT-NEXT: bl __aeabi_f2iz
3016 ; SOFT-NEXT: cmp r6, #0
3017 ; SOFT-NEXT: beq .LBB23_2
3018 ; SOFT-NEXT: @ %bb.1:
3019 ; SOFT-NEXT: mov r5, r0
3020 ; SOFT-NEXT: b .LBB23_3
3021 ; SOFT-NEXT: .LBB23_2:
3022 ; SOFT-NEXT: ldr r5, .LCPI23_0
3023 ; SOFT-NEXT: .LBB23_3:
3024 ; SOFT-NEXT: ldr r1, .LCPI23_1
3025 ; SOFT-NEXT: mov r0, r4
3026 ; SOFT-NEXT: bl __aeabi_fcmpgt
3027 ; SOFT-NEXT: cmp r0, #0
3028 ; SOFT-NEXT: beq .LBB23_5
3029 ; SOFT-NEXT: @ %bb.4:
3030 ; SOFT-NEXT: ldr r5, .LCPI23_2
3031 ; SOFT-NEXT: .LBB23_5:
3032 ; SOFT-NEXT: mov r0, r4
3033 ; SOFT-NEXT: mov r1, r4
3034 ; SOFT-NEXT: bl __aeabi_fcmpun
3035 ; SOFT-NEXT: cmp r0, #0
3036 ; SOFT-NEXT: beq .LBB23_7
3037 ; SOFT-NEXT: @ %bb.6:
3038 ; SOFT-NEXT: movs r5, #0
3039 ; SOFT-NEXT: .LBB23_7:
3040 ; SOFT-NEXT: mov r0, r5
3041 ; SOFT-NEXT: pop {r4, r5, r6, pc}
3042 ; SOFT-NEXT: .p2align 2
3043 ; SOFT-NEXT: @ %bb.8:
3044 ; SOFT-NEXT: .LCPI23_0:
3045 ; SOFT-NEXT: .long 4294934528 @ 0xffff8000
3046 ; SOFT-NEXT: .LCPI23_1:
3047 ; SOFT-NEXT: .long 1191181824 @ 0x46fffe00
3048 ; SOFT-NEXT: .LCPI23_2:
3049 ; SOFT-NEXT: .long 32767 @ 0x7fff
3051 ; VFP2-LABEL: test_signed_i16_f16:
3053 ; VFP2-NEXT: .save {r7, lr}
3054 ; VFP2-NEXT: push {r7, lr}
3055 ; VFP2-NEXT: bl __aeabi_h2f
3056 ; VFP2-NEXT: vmov s0, r0
3057 ; VFP2-NEXT: vldr s2, .LCPI23_0
3058 ; VFP2-NEXT: vcvt.s32.f32 s4, s0
3059 ; VFP2-NEXT: vcmp.f32 s0, s2
3060 ; VFP2-NEXT: vldr s2, .LCPI23_1
3061 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3062 ; VFP2-NEXT: vcmp.f32 s0, s2
3063 ; VFP2-NEXT: vmov r0, s4
3065 ; VFP2-NEXT: movwlt r0, #32768
3066 ; VFP2-NEXT: movtlt r0, #65535
3067 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3069 ; VFP2-NEXT: movwgt r0, #32767
3070 ; VFP2-NEXT: vcmp.f32 s0, s0
3071 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3073 ; VFP2-NEXT: movvs r0, #0
3074 ; VFP2-NEXT: pop {r7, pc}
3075 ; VFP2-NEXT: .p2align 2
3076 ; VFP2-NEXT: @ %bb.1:
3077 ; VFP2-NEXT: .LCPI23_0:
3078 ; VFP2-NEXT: .long 0xc7000000 @ float -32768
3079 ; VFP2-NEXT: .LCPI23_1:
3080 ; VFP2-NEXT: .long 0x46fffe00 @ float 32767
3082 ; FP16-LABEL: test_signed_i16_f16:
3084 ; FP16-NEXT: vmov.f16 s0, r0
3085 ; FP16-NEXT: vldr s4, .LCPI23_1
3086 ; FP16-NEXT: vcvtb.f32.f16 s0, s0
3087 ; FP16-NEXT: vldr s2, .LCPI23_0
3088 ; FP16-NEXT: vmaxnm.f32 s4, s0, s4
3089 ; FP16-NEXT: vcmp.f32 s0, s0
3090 ; FP16-NEXT: vminnm.f32 s2, s4, s2
3091 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
3092 ; FP16-NEXT: vcvt.s32.f32 s2, s2
3093 ; FP16-NEXT: vmov r0, s2
3095 ; FP16-NEXT: movvs r0, #0
3097 ; FP16-NEXT: .p2align 2
3098 ; FP16-NEXT: @ %bb.1:
3099 ; FP16-NEXT: .LCPI23_0:
3100 ; FP16-NEXT: .long 0x46fffe00 @ float 32767
3101 ; FP16-NEXT: .LCPI23_1:
3102 ; FP16-NEXT: .long 0xc7000000 @ float -32768
3103 %x = call i16 @llvm.fptosi.sat.i16.f16(half %f)
3107 define i19 @test_signed_i19_f16(half %f) nounwind {
3108 ; SOFT-LABEL: test_signed_i19_f16:
3110 ; SOFT-NEXT: .save {r4, r5, r6, lr}
3111 ; SOFT-NEXT: push {r4, r5, r6, lr}
3112 ; SOFT-NEXT: uxth r0, r0
3113 ; SOFT-NEXT: bl __aeabi_h2f
3114 ; SOFT-NEXT: mov r4, r0
3115 ; SOFT-NEXT: ldr r1, .LCPI24_0
3116 ; SOFT-NEXT: bl __aeabi_fcmpge
3117 ; SOFT-NEXT: mov r6, r0
3118 ; SOFT-NEXT: mov r0, r4
3119 ; SOFT-NEXT: bl __aeabi_f2iz
3120 ; SOFT-NEXT: cmp r6, #0
3121 ; SOFT-NEXT: beq .LBB24_2
3122 ; SOFT-NEXT: @ %bb.1:
3123 ; SOFT-NEXT: mov r5, r0
3124 ; SOFT-NEXT: b .LBB24_3
3125 ; SOFT-NEXT: .LBB24_2:
3126 ; SOFT-NEXT: ldr r5, .LCPI24_1
3127 ; SOFT-NEXT: .LBB24_3:
3128 ; SOFT-NEXT: ldr r1, .LCPI24_2
3129 ; SOFT-NEXT: mov r0, r4
3130 ; SOFT-NEXT: bl __aeabi_fcmpgt
3131 ; SOFT-NEXT: cmp r0, #0
3132 ; SOFT-NEXT: beq .LBB24_5
3133 ; SOFT-NEXT: @ %bb.4:
3134 ; SOFT-NEXT: ldr r5, .LCPI24_3
3135 ; SOFT-NEXT: .LBB24_5:
3136 ; SOFT-NEXT: mov r0, r4
3137 ; SOFT-NEXT: mov r1, r4
3138 ; SOFT-NEXT: bl __aeabi_fcmpun
3139 ; SOFT-NEXT: cmp r0, #0
3140 ; SOFT-NEXT: beq .LBB24_7
3141 ; SOFT-NEXT: @ %bb.6:
3142 ; SOFT-NEXT: movs r5, #0
3143 ; SOFT-NEXT: .LBB24_7:
3144 ; SOFT-NEXT: mov r0, r5
3145 ; SOFT-NEXT: pop {r4, r5, r6, pc}
3146 ; SOFT-NEXT: .p2align 2
3147 ; SOFT-NEXT: @ %bb.8:
3148 ; SOFT-NEXT: .LCPI24_0:
3149 ; SOFT-NEXT: .long 3363831808 @ 0xc8800000
3150 ; SOFT-NEXT: .LCPI24_1:
3151 ; SOFT-NEXT: .long 4294705152 @ 0xfffc0000
3152 ; SOFT-NEXT: .LCPI24_2:
3153 ; SOFT-NEXT: .long 1216348096 @ 0x487fffc0
3154 ; SOFT-NEXT: .LCPI24_3:
3155 ; SOFT-NEXT: .long 262143 @ 0x3ffff
3157 ; VFP2-LABEL: test_signed_i19_f16:
3159 ; VFP2-NEXT: .save {r7, lr}
3160 ; VFP2-NEXT: push {r7, lr}
3161 ; VFP2-NEXT: bl __aeabi_h2f
3162 ; VFP2-NEXT: vmov s0, r0
3163 ; VFP2-NEXT: vldr s2, .LCPI24_0
3164 ; VFP2-NEXT: vcvt.s32.f32 s4, s0
3165 ; VFP2-NEXT: vcmp.f32 s0, s2
3166 ; VFP2-NEXT: vldr s2, .LCPI24_1
3167 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3168 ; VFP2-NEXT: vcmp.f32 s0, s2
3169 ; VFP2-NEXT: vmov r0, s4
3171 ; VFP2-NEXT: movlt r0, #0
3172 ; VFP2-NEXT: movtlt r0, #65532
3173 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3175 ; VFP2-NEXT: movwgt r0, #65535
3176 ; VFP2-NEXT: movtgt r0, #3
3177 ; VFP2-NEXT: vcmp.f32 s0, s0
3178 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3180 ; VFP2-NEXT: movvs r0, #0
3181 ; VFP2-NEXT: pop {r7, pc}
3182 ; VFP2-NEXT: .p2align 2
3183 ; VFP2-NEXT: @ %bb.1:
3184 ; VFP2-NEXT: .LCPI24_0:
3185 ; VFP2-NEXT: .long 0xc8800000 @ float -262144
3186 ; VFP2-NEXT: .LCPI24_1:
3187 ; VFP2-NEXT: .long 0x487fffc0 @ float 262143
3189 ; FP16-LABEL: test_signed_i19_f16:
3191 ; FP16-NEXT: vmov.f16 s0, r0
3192 ; FP16-NEXT: vldr s4, .LCPI24_1
3193 ; FP16-NEXT: vcvtb.f32.f16 s0, s0
3194 ; FP16-NEXT: vldr s2, .LCPI24_0
3195 ; FP16-NEXT: vmaxnm.f32 s4, s0, s4
3196 ; FP16-NEXT: vcmp.f32 s0, s0
3197 ; FP16-NEXT: vminnm.f32 s2, s4, s2
3198 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
3199 ; FP16-NEXT: vcvt.s32.f32 s2, s2
3200 ; FP16-NEXT: vmov r0, s2
3202 ; FP16-NEXT: movvs r0, #0
3204 ; FP16-NEXT: .p2align 2
3205 ; FP16-NEXT: @ %bb.1:
3206 ; FP16-NEXT: .LCPI24_0:
3207 ; FP16-NEXT: .long 0x487fffc0 @ float 262143
3208 ; FP16-NEXT: .LCPI24_1:
3209 ; FP16-NEXT: .long 0xc8800000 @ float -262144
3210 %x = call i19 @llvm.fptosi.sat.i19.f16(half %f)
3214 define i32 @test_signed_i32_f16(half %f) nounwind {
3215 ; SOFT-LABEL: test_signed_i32_f16:
3217 ; SOFT-NEXT: .save {r4, r5, r6, lr}
3218 ; SOFT-NEXT: push {r4, r5, r6, lr}
3219 ; SOFT-NEXT: uxth r0, r0
3220 ; SOFT-NEXT: bl __aeabi_h2f
3221 ; SOFT-NEXT: mov r4, r0
3222 ; SOFT-NEXT: movs r0, #207
3223 ; SOFT-NEXT: lsls r1, r0, #24
3224 ; SOFT-NEXT: mov r0, r4
3225 ; SOFT-NEXT: bl __aeabi_fcmpge
3226 ; SOFT-NEXT: mov r6, r0
3227 ; SOFT-NEXT: mov r0, r4
3228 ; SOFT-NEXT: bl __aeabi_f2iz
3229 ; SOFT-NEXT: cmp r6, #0
3230 ; SOFT-NEXT: beq .LBB25_2
3231 ; SOFT-NEXT: @ %bb.1:
3232 ; SOFT-NEXT: mov r5, r0
3233 ; SOFT-NEXT: b .LBB25_3
3234 ; SOFT-NEXT: .LBB25_2:
3235 ; SOFT-NEXT: movs r0, #1
3236 ; SOFT-NEXT: lsls r5, r0, #31
3237 ; SOFT-NEXT: .LBB25_3:
3238 ; SOFT-NEXT: ldr r1, .LCPI25_0
3239 ; SOFT-NEXT: mov r0, r4
3240 ; SOFT-NEXT: bl __aeabi_fcmpgt
3241 ; SOFT-NEXT: cmp r0, #0
3242 ; SOFT-NEXT: beq .LBB25_5
3243 ; SOFT-NEXT: @ %bb.4:
3244 ; SOFT-NEXT: ldr r5, .LCPI25_1
3245 ; SOFT-NEXT: .LBB25_5:
3246 ; SOFT-NEXT: mov r0, r4
3247 ; SOFT-NEXT: mov r1, r4
3248 ; SOFT-NEXT: bl __aeabi_fcmpun
3249 ; SOFT-NEXT: cmp r0, #0
3250 ; SOFT-NEXT: beq .LBB25_7
3251 ; SOFT-NEXT: @ %bb.6:
3252 ; SOFT-NEXT: movs r5, #0
3253 ; SOFT-NEXT: .LBB25_7:
3254 ; SOFT-NEXT: mov r0, r5
3255 ; SOFT-NEXT: pop {r4, r5, r6, pc}
3256 ; SOFT-NEXT: .p2align 2
3257 ; SOFT-NEXT: @ %bb.8:
3258 ; SOFT-NEXT: .LCPI25_0:
3259 ; SOFT-NEXT: .long 1325400063 @ 0x4effffff
3260 ; SOFT-NEXT: .LCPI25_1:
3261 ; SOFT-NEXT: .long 2147483647 @ 0x7fffffff
3263 ; VFP2-LABEL: test_signed_i32_f16:
3265 ; VFP2-NEXT: .save {r7, lr}
3266 ; VFP2-NEXT: push {r7, lr}
3267 ; VFP2-NEXT: bl __aeabi_h2f
3268 ; VFP2-NEXT: vmov s0, r0
3269 ; VFP2-NEXT: vcvt.s32.f32 s0, s0
3270 ; VFP2-NEXT: vmov r0, s0
3271 ; VFP2-NEXT: pop {r7, pc}
3273 ; FP16-LABEL: test_signed_i32_f16:
3275 ; FP16-NEXT: vmov.f16 s0, r0
3276 ; FP16-NEXT: vcvt.s32.f16 s0, s0
3277 ; FP16-NEXT: vmov r0, s0
3279 %x = call i32 @llvm.fptosi.sat.i32.f16(half %f)
3283 define i50 @test_signed_i50_f16(half %f) nounwind {
3284 ; SOFT-LABEL: test_signed_i50_f16:
3286 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
3287 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
3288 ; SOFT-NEXT: .pad #12
3289 ; SOFT-NEXT: sub sp, #12
3290 ; SOFT-NEXT: uxth r0, r0
3291 ; SOFT-NEXT: bl __aeabi_h2f
3292 ; SOFT-NEXT: mov r7, r0
3293 ; SOFT-NEXT: ldr r1, .LCPI26_0
3294 ; SOFT-NEXT: bl __aeabi_fcmpgt
3295 ; SOFT-NEXT: str r0, [sp, #8] @ 4-byte Spill
3296 ; SOFT-NEXT: movs r0, #27
3297 ; SOFT-NEXT: lsls r1, r0, #27
3298 ; SOFT-NEXT: mov r0, r7
3299 ; SOFT-NEXT: bl __aeabi_fcmpge
3300 ; SOFT-NEXT: mov r5, r0
3301 ; SOFT-NEXT: mov r0, r7
3302 ; SOFT-NEXT: bl __aeabi_f2lz
3303 ; SOFT-NEXT: mov r4, r0
3304 ; SOFT-NEXT: str r1, [sp, #4] @ 4-byte Spill
3305 ; SOFT-NEXT: cmp r5, #0
3306 ; SOFT-NEXT: bne .LBB26_2
3307 ; SOFT-NEXT: @ %bb.1:
3308 ; SOFT-NEXT: mov r4, r5
3309 ; SOFT-NEXT: .LBB26_2:
3310 ; SOFT-NEXT: movs r6, #0
3311 ; SOFT-NEXT: ldr r0, [sp, #8] @ 4-byte Reload
3312 ; SOFT-NEXT: cmp r0, #0
3313 ; SOFT-NEXT: beq .LBB26_4
3314 ; SOFT-NEXT: @ %bb.3:
3315 ; SOFT-NEXT: mvns r4, r6
3316 ; SOFT-NEXT: .LBB26_4:
3317 ; SOFT-NEXT: mov r0, r7
3318 ; SOFT-NEXT: mov r1, r7
3319 ; SOFT-NEXT: bl __aeabi_fcmpun
3320 ; SOFT-NEXT: mov r1, r0
3321 ; SOFT-NEXT: cmp r0, #0
3322 ; SOFT-NEXT: mov r0, r6
3323 ; SOFT-NEXT: bne .LBB26_6
3324 ; SOFT-NEXT: @ %bb.5:
3325 ; SOFT-NEXT: mov r0, r4
3326 ; SOFT-NEXT: .LBB26_6:
3327 ; SOFT-NEXT: cmp r5, #0
3328 ; SOFT-NEXT: beq .LBB26_8
3329 ; SOFT-NEXT: @ %bb.7:
3330 ; SOFT-NEXT: ldr r3, [sp, #4] @ 4-byte Reload
3331 ; SOFT-NEXT: b .LBB26_9
3332 ; SOFT-NEXT: .LBB26_8:
3333 ; SOFT-NEXT: ldr r3, .LCPI26_1
3334 ; SOFT-NEXT: .LBB26_9:
3335 ; SOFT-NEXT: ldr r2, [sp, #8] @ 4-byte Reload
3336 ; SOFT-NEXT: cmp r2, #0
3337 ; SOFT-NEXT: beq .LBB26_11
3338 ; SOFT-NEXT: @ %bb.10:
3339 ; SOFT-NEXT: ldr r3, .LCPI26_2
3340 ; SOFT-NEXT: .LBB26_11:
3341 ; SOFT-NEXT: cmp r1, #0
3342 ; SOFT-NEXT: bne .LBB26_13
3343 ; SOFT-NEXT: @ %bb.12:
3344 ; SOFT-NEXT: mov r6, r3
3345 ; SOFT-NEXT: .LBB26_13:
3346 ; SOFT-NEXT: mov r1, r6
3347 ; SOFT-NEXT: add sp, #12
3348 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
3349 ; SOFT-NEXT: .p2align 2
3350 ; SOFT-NEXT: @ %bb.14:
3351 ; SOFT-NEXT: .LCPI26_0:
3352 ; SOFT-NEXT: .long 1476395007 @ 0x57ffffff
3353 ; SOFT-NEXT: .LCPI26_1:
3354 ; SOFT-NEXT: .long 4294836224 @ 0xfffe0000
3355 ; SOFT-NEXT: .LCPI26_2:
3356 ; SOFT-NEXT: .long 131071 @ 0x1ffff
3358 ; VFP2-LABEL: test_signed_i50_f16:
3360 ; VFP2-NEXT: .save {r7, lr}
3361 ; VFP2-NEXT: push {r7, lr}
3362 ; VFP2-NEXT: .vsave {d8}
3363 ; VFP2-NEXT: vpush {d8}
3364 ; VFP2-NEXT: bl __aeabi_h2f
3365 ; VFP2-NEXT: vmov s16, r0
3366 ; VFP2-NEXT: bl __aeabi_f2lz
3367 ; VFP2-NEXT: vldr s0, .LCPI26_0
3368 ; VFP2-NEXT: vldr s2, .LCPI26_1
3369 ; VFP2-NEXT: vcmp.f32 s16, s0
3370 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3371 ; VFP2-NEXT: vcmp.f32 s16, s2
3373 ; VFP2-NEXT: movlt r1, #0
3374 ; VFP2-NEXT: movtlt r1, #65534
3375 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3376 ; VFP2-NEXT: vcmp.f32 s16, s0
3378 ; VFP2-NEXT: movwgt r1, #65535
3379 ; VFP2-NEXT: movtgt r1, #1
3380 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3382 ; VFP2-NEXT: movlt r0, #0
3383 ; VFP2-NEXT: vcmp.f32 s16, s2
3384 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3386 ; VFP2-NEXT: movgt.w r0, #-1
3387 ; VFP2-NEXT: vcmp.f32 s16, s16
3388 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3390 ; VFP2-NEXT: movvs r0, #0
3391 ; VFP2-NEXT: movvs r1, #0
3392 ; VFP2-NEXT: vpop {d8}
3393 ; VFP2-NEXT: pop {r7, pc}
3394 ; VFP2-NEXT: .p2align 2
3395 ; VFP2-NEXT: @ %bb.1:
3396 ; VFP2-NEXT: .LCPI26_0:
3397 ; VFP2-NEXT: .long 0xd8000000 @ float -5.62949953E+14
3398 ; VFP2-NEXT: .LCPI26_1:
3399 ; VFP2-NEXT: .long 0x57ffffff @ float 5.6294992E+14
3401 ; FP16-LABEL: test_signed_i50_f16:
3403 ; FP16-NEXT: .save {r7, lr}
3404 ; FP16-NEXT: push {r7, lr}
3405 ; FP16-NEXT: .vsave {d8}
3406 ; FP16-NEXT: vpush {d8}
3407 ; FP16-NEXT: vmov.f16 s0, r0
3408 ; FP16-NEXT: vcvtb.f32.f16 s16, s0
3409 ; FP16-NEXT: vmov r0, s16
3410 ; FP16-NEXT: bl __aeabi_f2lz
3411 ; FP16-NEXT: vldr s0, .LCPI26_0
3412 ; FP16-NEXT: vldr s2, .LCPI26_1
3413 ; FP16-NEXT: vcmp.f32 s16, s0
3414 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
3415 ; FP16-NEXT: vcmp.f32 s16, s2
3417 ; FP16-NEXT: movlt r1, #0
3418 ; FP16-NEXT: movtlt r1, #65534
3419 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
3420 ; FP16-NEXT: vcmp.f32 s16, s0
3422 ; FP16-NEXT: movwgt r1, #65535
3423 ; FP16-NEXT: movtgt r1, #1
3424 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
3426 ; FP16-NEXT: movlt r0, #0
3427 ; FP16-NEXT: vcmp.f32 s16, s2
3428 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
3430 ; FP16-NEXT: movgt.w r0, #-1
3431 ; FP16-NEXT: vcmp.f32 s16, s16
3432 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
3434 ; FP16-NEXT: movvs r0, #0
3435 ; FP16-NEXT: movvs r1, #0
3436 ; FP16-NEXT: vpop {d8}
3437 ; FP16-NEXT: pop {r7, pc}
3438 ; FP16-NEXT: .p2align 2
3439 ; FP16-NEXT: @ %bb.1:
3440 ; FP16-NEXT: .LCPI26_0:
3441 ; FP16-NEXT: .long 0xd8000000 @ float -5.62949953E+14
3442 ; FP16-NEXT: .LCPI26_1:
3443 ; FP16-NEXT: .long 0x57ffffff @ float 5.6294992E+14
3444 %x = call i50 @llvm.fptosi.sat.i50.f16(half %f)
3448 define i64 @test_signed_i64_f16(half %f) nounwind {
3449 ; SOFT-LABEL: test_signed_i64_f16:
3451 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
3452 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
3453 ; SOFT-NEXT: .pad #12
3454 ; SOFT-NEXT: sub sp, #12
3455 ; SOFT-NEXT: uxth r0, r0
3456 ; SOFT-NEXT: bl __aeabi_h2f
3457 ; SOFT-NEXT: mov r7, r0
3458 ; SOFT-NEXT: ldr r1, .LCPI27_0
3459 ; SOFT-NEXT: bl __aeabi_fcmpgt
3460 ; SOFT-NEXT: str r0, [sp, #8] @ 4-byte Spill
3461 ; SOFT-NEXT: movs r0, #223
3462 ; SOFT-NEXT: lsls r1, r0, #24
3463 ; SOFT-NEXT: mov r0, r7
3464 ; SOFT-NEXT: bl __aeabi_fcmpge
3465 ; SOFT-NEXT: mov r5, r0
3466 ; SOFT-NEXT: mov r0, r7
3467 ; SOFT-NEXT: bl __aeabi_f2lz
3468 ; SOFT-NEXT: mov r4, r0
3469 ; SOFT-NEXT: str r1, [sp, #4] @ 4-byte Spill
3470 ; SOFT-NEXT: cmp r5, #0
3471 ; SOFT-NEXT: bne .LBB27_2
3472 ; SOFT-NEXT: @ %bb.1:
3473 ; SOFT-NEXT: mov r4, r5
3474 ; SOFT-NEXT: .LBB27_2:
3475 ; SOFT-NEXT: movs r6, #0
3476 ; SOFT-NEXT: ldr r0, [sp, #8] @ 4-byte Reload
3477 ; SOFT-NEXT: cmp r0, #0
3478 ; SOFT-NEXT: beq .LBB27_4
3479 ; SOFT-NEXT: @ %bb.3:
3480 ; SOFT-NEXT: mvns r4, r6
3481 ; SOFT-NEXT: .LBB27_4:
3482 ; SOFT-NEXT: mov r0, r7
3483 ; SOFT-NEXT: mov r1, r7
3484 ; SOFT-NEXT: bl __aeabi_fcmpun
3485 ; SOFT-NEXT: mov r1, r0
3486 ; SOFT-NEXT: cmp r0, #0
3487 ; SOFT-NEXT: mov r0, r6
3488 ; SOFT-NEXT: bne .LBB27_6
3489 ; SOFT-NEXT: @ %bb.5:
3490 ; SOFT-NEXT: mov r0, r4
3491 ; SOFT-NEXT: .LBB27_6:
3492 ; SOFT-NEXT: cmp r5, #0
3493 ; SOFT-NEXT: beq .LBB27_8
3494 ; SOFT-NEXT: @ %bb.7:
3495 ; SOFT-NEXT: ldr r3, [sp, #4] @ 4-byte Reload
3496 ; SOFT-NEXT: b .LBB27_9
3497 ; SOFT-NEXT: .LBB27_8:
3498 ; SOFT-NEXT: movs r2, #1
3499 ; SOFT-NEXT: lsls r3, r2, #31
3500 ; SOFT-NEXT: .LBB27_9:
3501 ; SOFT-NEXT: ldr r2, [sp, #8] @ 4-byte Reload
3502 ; SOFT-NEXT: cmp r2, #0
3503 ; SOFT-NEXT: beq .LBB27_11
3504 ; SOFT-NEXT: @ %bb.10:
3505 ; SOFT-NEXT: ldr r3, .LCPI27_1
3506 ; SOFT-NEXT: .LBB27_11:
3507 ; SOFT-NEXT: cmp r1, #0
3508 ; SOFT-NEXT: bne .LBB27_13
3509 ; SOFT-NEXT: @ %bb.12:
3510 ; SOFT-NEXT: mov r6, r3
3511 ; SOFT-NEXT: .LBB27_13:
3512 ; SOFT-NEXT: mov r1, r6
3513 ; SOFT-NEXT: add sp, #12
3514 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
3515 ; SOFT-NEXT: .p2align 2
3516 ; SOFT-NEXT: @ %bb.14:
3517 ; SOFT-NEXT: .LCPI27_0:
3518 ; SOFT-NEXT: .long 1593835519 @ 0x5effffff
3519 ; SOFT-NEXT: .LCPI27_1:
3520 ; SOFT-NEXT: .long 2147483647 @ 0x7fffffff
3522 ; VFP2-LABEL: test_signed_i64_f16:
3524 ; VFP2-NEXT: .save {r4, lr}
3525 ; VFP2-NEXT: push {r4, lr}
3526 ; VFP2-NEXT: bl __aeabi_h2f
3527 ; VFP2-NEXT: mov r4, r0
3528 ; VFP2-NEXT: bl __aeabi_f2lz
3529 ; VFP2-NEXT: vldr s0, .LCPI27_0
3530 ; VFP2-NEXT: vmov s2, r4
3531 ; VFP2-NEXT: vldr s4, .LCPI27_1
3532 ; VFP2-NEXT: vcmp.f32 s2, s0
3533 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3534 ; VFP2-NEXT: vcmp.f32 s2, s4
3536 ; VFP2-NEXT: movlt r0, #0
3537 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3538 ; VFP2-NEXT: vcmp.f32 s2, s2
3540 ; VFP2-NEXT: movgt.w r0, #-1
3541 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3542 ; VFP2-NEXT: vcmp.f32 s2, s0
3544 ; VFP2-NEXT: movvs r0, #0
3545 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3547 ; VFP2-NEXT: movlt.w r1, #-2147483648
3548 ; VFP2-NEXT: vcmp.f32 s2, s4
3549 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3551 ; VFP2-NEXT: mvngt r1, #-2147483648
3552 ; VFP2-NEXT: vcmp.f32 s2, s2
3553 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3555 ; VFP2-NEXT: movvs r1, #0
3556 ; VFP2-NEXT: pop {r4, pc}
3557 ; VFP2-NEXT: .p2align 2
3558 ; VFP2-NEXT: @ %bb.1:
3559 ; VFP2-NEXT: .LCPI27_0:
3560 ; VFP2-NEXT: .long 0xdf000000 @ float -9.22337203E+18
3561 ; VFP2-NEXT: .LCPI27_1:
3562 ; VFP2-NEXT: .long 0x5effffff @ float 9.22337149E+18
3564 ; FP16-LABEL: test_signed_i64_f16:
3566 ; FP16-NEXT: .save {r7, lr}
3567 ; FP16-NEXT: push {r7, lr}
3568 ; FP16-NEXT: .vsave {d8}
3569 ; FP16-NEXT: vpush {d8}
3570 ; FP16-NEXT: vmov.f16 s0, r0
3571 ; FP16-NEXT: vcvtb.f32.f16 s16, s0
3572 ; FP16-NEXT: vmov r0, s16
3573 ; FP16-NEXT: bl __aeabi_f2lz
3574 ; FP16-NEXT: vldr s0, .LCPI27_0
3575 ; FP16-NEXT: vldr s2, .LCPI27_1
3576 ; FP16-NEXT: vcmp.f32 s16, s0
3577 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
3578 ; FP16-NEXT: vcmp.f32 s16, s2
3580 ; FP16-NEXT: movlt r0, #0
3581 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
3582 ; FP16-NEXT: vcmp.f32 s16, s16
3584 ; FP16-NEXT: movgt.w r0, #-1
3585 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
3586 ; FP16-NEXT: vcmp.f32 s16, s0
3588 ; FP16-NEXT: movvs r0, #0
3589 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
3591 ; FP16-NEXT: movlt.w r1, #-2147483648
3592 ; FP16-NEXT: vcmp.f32 s16, s2
3593 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
3595 ; FP16-NEXT: mvngt r1, #-2147483648
3596 ; FP16-NEXT: vcmp.f32 s16, s16
3597 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
3599 ; FP16-NEXT: movvs r1, #0
3600 ; FP16-NEXT: vpop {d8}
3601 ; FP16-NEXT: pop {r7, pc}
3602 ; FP16-NEXT: .p2align 2
3603 ; FP16-NEXT: @ %bb.1:
3604 ; FP16-NEXT: .LCPI27_0:
3605 ; FP16-NEXT: .long 0xdf000000 @ float -9.22337203E+18
3606 ; FP16-NEXT: .LCPI27_1:
3607 ; FP16-NEXT: .long 0x5effffff @ float 9.22337149E+18
3608 %x = call i64 @llvm.fptosi.sat.i64.f16(half %f)
3612 define i100 @test_signed_i100_f16(half %f) nounwind {
3613 ; SOFT-LABEL: test_signed_i100_f16:
3615 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
3616 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
3617 ; SOFT-NEXT: .pad #20
3618 ; SOFT-NEXT: sub sp, #20
3619 ; SOFT-NEXT: uxth r0, r0
3620 ; SOFT-NEXT: bl __aeabi_h2f
3621 ; SOFT-NEXT: mov r6, r0
3622 ; SOFT-NEXT: ldr r1, .LCPI28_0
3623 ; SOFT-NEXT: bl __aeabi_fcmpgt
3624 ; SOFT-NEXT: mov r4, r0
3625 ; SOFT-NEXT: movs r0, #241
3626 ; SOFT-NEXT: lsls r1, r0, #24
3627 ; SOFT-NEXT: mov r0, r6
3628 ; SOFT-NEXT: bl __aeabi_fcmpge
3629 ; SOFT-NEXT: mov r7, r0
3630 ; SOFT-NEXT: mov r0, r6
3631 ; SOFT-NEXT: bl __fixsfti
3632 ; SOFT-NEXT: str r1, [sp, #4] @ 4-byte Spill
3633 ; SOFT-NEXT: str r2, [sp, #12] @ 4-byte Spill
3634 ; SOFT-NEXT: str r3, [sp] @ 4-byte Spill
3635 ; SOFT-NEXT: cmp r7, #0
3636 ; SOFT-NEXT: bne .LBB28_2
3637 ; SOFT-NEXT: @ %bb.1:
3638 ; SOFT-NEXT: mov r0, r7
3639 ; SOFT-NEXT: .LBB28_2:
3640 ; SOFT-NEXT: movs r5, #0
3641 ; SOFT-NEXT: mvns r1, r5
3642 ; SOFT-NEXT: str r4, [sp, #16] @ 4-byte Spill
3643 ; SOFT-NEXT: cmp r4, #0
3644 ; SOFT-NEXT: str r1, [sp, #8] @ 4-byte Spill
3645 ; SOFT-NEXT: mov r4, r1
3646 ; SOFT-NEXT: bne .LBB28_4
3647 ; SOFT-NEXT: @ %bb.3:
3648 ; SOFT-NEXT: mov r4, r0
3649 ; SOFT-NEXT: .LBB28_4:
3650 ; SOFT-NEXT: mov r0, r6
3651 ; SOFT-NEXT: mov r1, r6
3652 ; SOFT-NEXT: bl __aeabi_fcmpun
3653 ; SOFT-NEXT: mov r3, r0
3654 ; SOFT-NEXT: cmp r0, #0
3655 ; SOFT-NEXT: mov r0, r5
3656 ; SOFT-NEXT: bne .LBB28_6
3657 ; SOFT-NEXT: @ %bb.5:
3658 ; SOFT-NEXT: mov r0, r4
3659 ; SOFT-NEXT: .LBB28_6:
3660 ; SOFT-NEXT: cmp r7, #0
3661 ; SOFT-NEXT: ldr r6, [sp, #8] @ 4-byte Reload
3662 ; SOFT-NEXT: bne .LBB28_8
3663 ; SOFT-NEXT: @ %bb.7:
3664 ; SOFT-NEXT: str r7, [sp, #4] @ 4-byte Spill
3665 ; SOFT-NEXT: .LBB28_8:
3666 ; SOFT-NEXT: ldr r4, [sp, #16] @ 4-byte Reload
3667 ; SOFT-NEXT: cmp r4, #0
3668 ; SOFT-NEXT: mov r2, r6
3669 ; SOFT-NEXT: bne .LBB28_10
3670 ; SOFT-NEXT: @ %bb.9:
3671 ; SOFT-NEXT: ldr r2, [sp, #4] @ 4-byte Reload
3672 ; SOFT-NEXT: .LBB28_10:
3673 ; SOFT-NEXT: cmp r3, #0
3674 ; SOFT-NEXT: mov r1, r5
3675 ; SOFT-NEXT: beq .LBB28_18
3676 ; SOFT-NEXT: @ %bb.11:
3677 ; SOFT-NEXT: cmp r7, #0
3678 ; SOFT-NEXT: beq .LBB28_19
3679 ; SOFT-NEXT: .LBB28_12:
3680 ; SOFT-NEXT: cmp r4, #0
3681 ; SOFT-NEXT: bne .LBB28_14
3682 ; SOFT-NEXT: .LBB28_13:
3683 ; SOFT-NEXT: ldr r6, [sp, #12] @ 4-byte Reload
3684 ; SOFT-NEXT: .LBB28_14:
3685 ; SOFT-NEXT: cmp r3, #0
3686 ; SOFT-NEXT: mov r2, r5
3687 ; SOFT-NEXT: bne .LBB28_16
3688 ; SOFT-NEXT: @ %bb.15:
3689 ; SOFT-NEXT: mov r2, r6
3690 ; SOFT-NEXT: .LBB28_16:
3691 ; SOFT-NEXT: movs r4, #7
3692 ; SOFT-NEXT: cmp r7, #0
3693 ; SOFT-NEXT: beq .LBB28_20
3694 ; SOFT-NEXT: @ %bb.17:
3695 ; SOFT-NEXT: ldr r7, [sp] @ 4-byte Reload
3696 ; SOFT-NEXT: b .LBB28_21
3697 ; SOFT-NEXT: .LBB28_18:
3698 ; SOFT-NEXT: mov r1, r2
3699 ; SOFT-NEXT: cmp r7, #0
3700 ; SOFT-NEXT: bne .LBB28_12
3701 ; SOFT-NEXT: .LBB28_19:
3702 ; SOFT-NEXT: str r7, [sp, #12] @ 4-byte Spill
3703 ; SOFT-NEXT: cmp r4, #0
3704 ; SOFT-NEXT: beq .LBB28_13
3705 ; SOFT-NEXT: b .LBB28_14
3706 ; SOFT-NEXT: .LBB28_20:
3707 ; SOFT-NEXT: mvns r7, r4
3708 ; SOFT-NEXT: .LBB28_21:
3709 ; SOFT-NEXT: ldr r6, [sp, #16] @ 4-byte Reload
3710 ; SOFT-NEXT: cmp r6, #0
3711 ; SOFT-NEXT: bne .LBB28_23
3712 ; SOFT-NEXT: @ %bb.22:
3713 ; SOFT-NEXT: mov r4, r7
3714 ; SOFT-NEXT: .LBB28_23:
3715 ; SOFT-NEXT: cmp r3, #0
3716 ; SOFT-NEXT: bne .LBB28_25
3717 ; SOFT-NEXT: @ %bb.24:
3718 ; SOFT-NEXT: mov r5, r4
3719 ; SOFT-NEXT: .LBB28_25:
3720 ; SOFT-NEXT: mov r3, r5
3721 ; SOFT-NEXT: add sp, #20
3722 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
3723 ; SOFT-NEXT: .p2align 2
3724 ; SOFT-NEXT: @ %bb.26:
3725 ; SOFT-NEXT: .LCPI28_0:
3726 ; SOFT-NEXT: .long 1895825407 @ 0x70ffffff
3728 ; VFP2-LABEL: test_signed_i100_f16:
3730 ; VFP2-NEXT: .save {r4, lr}
3731 ; VFP2-NEXT: push {r4, lr}
3732 ; VFP2-NEXT: bl __aeabi_h2f
3733 ; VFP2-NEXT: mov r4, r0
3734 ; VFP2-NEXT: bl __fixsfti
3735 ; VFP2-NEXT: vldr s0, .LCPI28_0
3736 ; VFP2-NEXT: vmov s2, r4
3737 ; VFP2-NEXT: vldr s4, .LCPI28_1
3738 ; VFP2-NEXT: vcmp.f32 s2, s0
3739 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3740 ; VFP2-NEXT: vcmp.f32 s2, s4
3742 ; VFP2-NEXT: movlt r0, #0
3743 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3744 ; VFP2-NEXT: vcmp.f32 s2, s2
3746 ; VFP2-NEXT: movgt.w r0, #-1
3747 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3748 ; VFP2-NEXT: vcmp.f32 s2, s0
3750 ; VFP2-NEXT: movvs r0, #0
3751 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3752 ; VFP2-NEXT: vcmp.f32 s2, s4
3754 ; VFP2-NEXT: movlt r1, #0
3755 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3756 ; VFP2-NEXT: vcmp.f32 s2, s2
3758 ; VFP2-NEXT: movgt.w r1, #-1
3759 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3760 ; VFP2-NEXT: vcmp.f32 s2, s0
3762 ; VFP2-NEXT: movvs r1, #0
3763 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3764 ; VFP2-NEXT: vcmp.f32 s2, s4
3766 ; VFP2-NEXT: movlt r2, #0
3767 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3768 ; VFP2-NEXT: vcmp.f32 s2, s2
3770 ; VFP2-NEXT: movgt.w r2, #-1
3771 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3772 ; VFP2-NEXT: vcmp.f32 s2, s0
3774 ; VFP2-NEXT: movvs r2, #0
3775 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3777 ; VFP2-NEXT: mvnlt r3, #7
3778 ; VFP2-NEXT: vcmp.f32 s2, s4
3779 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3781 ; VFP2-NEXT: movgt r3, #7
3782 ; VFP2-NEXT: vcmp.f32 s2, s2
3783 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3785 ; VFP2-NEXT: movvs r3, #0
3786 ; VFP2-NEXT: pop {r4, pc}
3787 ; VFP2-NEXT: .p2align 2
3788 ; VFP2-NEXT: @ %bb.1:
3789 ; VFP2-NEXT: .LCPI28_0:
3790 ; VFP2-NEXT: .long 0xf1000000 @ float -6.338253E+29
3791 ; VFP2-NEXT: .LCPI28_1:
3792 ; VFP2-NEXT: .long 0x70ffffff @ float 6.33825262E+29
3794 ; FP16-LABEL: test_signed_i100_f16:
3796 ; FP16-NEXT: .save {r7, lr}
3797 ; FP16-NEXT: push {r7, lr}
3798 ; FP16-NEXT: .vsave {d8}
3799 ; FP16-NEXT: vpush {d8}
3800 ; FP16-NEXT: vmov.f16 s0, r0
3801 ; FP16-NEXT: vcvtb.f32.f16 s16, s0
3802 ; FP16-NEXT: vmov r0, s16
3803 ; FP16-NEXT: bl __fixsfti
3804 ; FP16-NEXT: vldr s0, .LCPI28_0
3805 ; FP16-NEXT: vldr s2, .LCPI28_1
3806 ; FP16-NEXT: vcmp.f32 s16, s0
3807 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
3808 ; FP16-NEXT: vcmp.f32 s16, s2
3810 ; FP16-NEXT: movlt r0, #0
3811 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
3812 ; FP16-NEXT: vcmp.f32 s16, s16
3814 ; FP16-NEXT: movgt.w r0, #-1
3815 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
3816 ; FP16-NEXT: vcmp.f32 s16, s0
3818 ; FP16-NEXT: movvs r0, #0
3819 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
3820 ; FP16-NEXT: vcmp.f32 s16, s2
3822 ; FP16-NEXT: movlt r1, #0
3823 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
3824 ; FP16-NEXT: vcmp.f32 s16, s16
3826 ; FP16-NEXT: movgt.w r1, #-1
3827 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
3828 ; FP16-NEXT: vcmp.f32 s16, s0
3830 ; FP16-NEXT: movvs r1, #0
3831 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
3832 ; FP16-NEXT: vcmp.f32 s16, s2
3834 ; FP16-NEXT: movlt r2, #0
3835 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
3836 ; FP16-NEXT: vcmp.f32 s16, s16
3838 ; FP16-NEXT: movgt.w r2, #-1
3839 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
3840 ; FP16-NEXT: vcmp.f32 s16, s0
3842 ; FP16-NEXT: movvs r2, #0
3843 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
3845 ; FP16-NEXT: mvnlt r3, #7
3846 ; FP16-NEXT: vcmp.f32 s16, s2
3847 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
3849 ; FP16-NEXT: movgt r3, #7
3850 ; FP16-NEXT: vcmp.f32 s16, s16
3851 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
3853 ; FP16-NEXT: movvs r3, #0
3854 ; FP16-NEXT: vpop {d8}
3855 ; FP16-NEXT: pop {r7, pc}
3856 ; FP16-NEXT: .p2align 2
3857 ; FP16-NEXT: @ %bb.1:
3858 ; FP16-NEXT: .LCPI28_0:
3859 ; FP16-NEXT: .long 0xf1000000 @ float -6.338253E+29
3860 ; FP16-NEXT: .LCPI28_1:
3861 ; FP16-NEXT: .long 0x70ffffff @ float 6.33825262E+29
3862 %x = call i100 @llvm.fptosi.sat.i100.f16(half %f)
3866 define i128 @test_signed_i128_f16(half %f) nounwind {
3867 ; SOFT-LABEL: test_signed_i128_f16:
3869 ; SOFT-NEXT: .save {r4, r5, r6, r7, lr}
3870 ; SOFT-NEXT: push {r4, r5, r6, r7, lr}
3871 ; SOFT-NEXT: .pad #20
3872 ; SOFT-NEXT: sub sp, #20
3873 ; SOFT-NEXT: uxth r0, r0
3874 ; SOFT-NEXT: bl __aeabi_h2f
3875 ; SOFT-NEXT: mov r6, r0
3876 ; SOFT-NEXT: ldr r1, .LCPI29_0
3877 ; SOFT-NEXT: bl __aeabi_fcmpgt
3878 ; SOFT-NEXT: mov r4, r0
3879 ; SOFT-NEXT: movs r0, #255
3880 ; SOFT-NEXT: lsls r1, r0, #24
3881 ; SOFT-NEXT: mov r0, r6
3882 ; SOFT-NEXT: bl __aeabi_fcmpge
3883 ; SOFT-NEXT: mov r7, r0
3884 ; SOFT-NEXT: mov r0, r6
3885 ; SOFT-NEXT: bl __fixsfti
3886 ; SOFT-NEXT: str r1, [sp, #4] @ 4-byte Spill
3887 ; SOFT-NEXT: str r2, [sp, #12] @ 4-byte Spill
3888 ; SOFT-NEXT: str r3, [sp] @ 4-byte Spill
3889 ; SOFT-NEXT: cmp r7, #0
3890 ; SOFT-NEXT: bne .LBB29_2
3891 ; SOFT-NEXT: @ %bb.1:
3892 ; SOFT-NEXT: mov r0, r7
3893 ; SOFT-NEXT: .LBB29_2:
3894 ; SOFT-NEXT: movs r5, #0
3895 ; SOFT-NEXT: mvns r1, r5
3896 ; SOFT-NEXT: str r4, [sp, #16] @ 4-byte Spill
3897 ; SOFT-NEXT: cmp r4, #0
3898 ; SOFT-NEXT: str r1, [sp, #8] @ 4-byte Spill
3899 ; SOFT-NEXT: mov r4, r1
3900 ; SOFT-NEXT: bne .LBB29_4
3901 ; SOFT-NEXT: @ %bb.3:
3902 ; SOFT-NEXT: mov r4, r0
3903 ; SOFT-NEXT: .LBB29_4:
3904 ; SOFT-NEXT: mov r0, r6
3905 ; SOFT-NEXT: mov r1, r6
3906 ; SOFT-NEXT: bl __aeabi_fcmpun
3907 ; SOFT-NEXT: mov r3, r0
3908 ; SOFT-NEXT: cmp r0, #0
3909 ; SOFT-NEXT: mov r0, r5
3910 ; SOFT-NEXT: bne .LBB29_6
3911 ; SOFT-NEXT: @ %bb.5:
3912 ; SOFT-NEXT: mov r0, r4
3913 ; SOFT-NEXT: .LBB29_6:
3914 ; SOFT-NEXT: cmp r7, #0
3915 ; SOFT-NEXT: ldr r6, [sp, #8] @ 4-byte Reload
3916 ; SOFT-NEXT: bne .LBB29_8
3917 ; SOFT-NEXT: @ %bb.7:
3918 ; SOFT-NEXT: str r7, [sp, #4] @ 4-byte Spill
3919 ; SOFT-NEXT: .LBB29_8:
3920 ; SOFT-NEXT: ldr r4, [sp, #16] @ 4-byte Reload
3921 ; SOFT-NEXT: cmp r4, #0
3922 ; SOFT-NEXT: mov r2, r6
3923 ; SOFT-NEXT: bne .LBB29_10
3924 ; SOFT-NEXT: @ %bb.9:
3925 ; SOFT-NEXT: ldr r2, [sp, #4] @ 4-byte Reload
3926 ; SOFT-NEXT: .LBB29_10:
3927 ; SOFT-NEXT: cmp r3, #0
3928 ; SOFT-NEXT: mov r1, r5
3929 ; SOFT-NEXT: beq .LBB29_18
3930 ; SOFT-NEXT: @ %bb.11:
3931 ; SOFT-NEXT: cmp r7, #0
3932 ; SOFT-NEXT: beq .LBB29_19
3933 ; SOFT-NEXT: .LBB29_12:
3934 ; SOFT-NEXT: cmp r4, #0
3935 ; SOFT-NEXT: bne .LBB29_14
3936 ; SOFT-NEXT: .LBB29_13:
3937 ; SOFT-NEXT: ldr r6, [sp, #12] @ 4-byte Reload
3938 ; SOFT-NEXT: .LBB29_14:
3939 ; SOFT-NEXT: cmp r3, #0
3940 ; SOFT-NEXT: mov r2, r5
3941 ; SOFT-NEXT: bne .LBB29_16
3942 ; SOFT-NEXT: @ %bb.15:
3943 ; SOFT-NEXT: mov r2, r6
3944 ; SOFT-NEXT: .LBB29_16:
3945 ; SOFT-NEXT: cmp r7, #0
3946 ; SOFT-NEXT: beq .LBB29_20
3947 ; SOFT-NEXT: @ %bb.17:
3948 ; SOFT-NEXT: ldr r6, [sp] @ 4-byte Reload
3949 ; SOFT-NEXT: cmp r4, #0
3950 ; SOFT-NEXT: bne .LBB29_21
3951 ; SOFT-NEXT: b .LBB29_22
3952 ; SOFT-NEXT: .LBB29_18:
3953 ; SOFT-NEXT: mov r1, r2
3954 ; SOFT-NEXT: cmp r7, #0
3955 ; SOFT-NEXT: bne .LBB29_12
3956 ; SOFT-NEXT: .LBB29_19:
3957 ; SOFT-NEXT: str r7, [sp, #12] @ 4-byte Spill
3958 ; SOFT-NEXT: cmp r4, #0
3959 ; SOFT-NEXT: beq .LBB29_13
3960 ; SOFT-NEXT: b .LBB29_14
3961 ; SOFT-NEXT: .LBB29_20:
3962 ; SOFT-NEXT: movs r4, #1
3963 ; SOFT-NEXT: lsls r6, r4, #31
3964 ; SOFT-NEXT: ldr r4, [sp, #16] @ 4-byte Reload
3965 ; SOFT-NEXT: cmp r4, #0
3966 ; SOFT-NEXT: beq .LBB29_22
3967 ; SOFT-NEXT: .LBB29_21:
3968 ; SOFT-NEXT: ldr r6, .LCPI29_1
3969 ; SOFT-NEXT: .LBB29_22:
3970 ; SOFT-NEXT: cmp r3, #0
3971 ; SOFT-NEXT: bne .LBB29_24
3972 ; SOFT-NEXT: @ %bb.23:
3973 ; SOFT-NEXT: mov r5, r6
3974 ; SOFT-NEXT: .LBB29_24:
3975 ; SOFT-NEXT: mov r3, r5
3976 ; SOFT-NEXT: add sp, #20
3977 ; SOFT-NEXT: pop {r4, r5, r6, r7, pc}
3978 ; SOFT-NEXT: .p2align 2
3979 ; SOFT-NEXT: @ %bb.25:
3980 ; SOFT-NEXT: .LCPI29_0:
3981 ; SOFT-NEXT: .long 2130706431 @ 0x7effffff
3982 ; SOFT-NEXT: .LCPI29_1:
3983 ; SOFT-NEXT: .long 2147483647 @ 0x7fffffff
3985 ; VFP2-LABEL: test_signed_i128_f16:
3987 ; VFP2-NEXT: .save {r4, lr}
3988 ; VFP2-NEXT: push {r4, lr}
3989 ; VFP2-NEXT: bl __aeabi_h2f
3990 ; VFP2-NEXT: mov r4, r0
3991 ; VFP2-NEXT: bl __fixsfti
3992 ; VFP2-NEXT: vldr s0, .LCPI29_0
3993 ; VFP2-NEXT: vmov s2, r4
3994 ; VFP2-NEXT: vldr s4, .LCPI29_1
3995 ; VFP2-NEXT: vcmp.f32 s2, s0
3996 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
3997 ; VFP2-NEXT: vcmp.f32 s2, s4
3999 ; VFP2-NEXT: movlt r0, #0
4000 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
4001 ; VFP2-NEXT: vcmp.f32 s2, s2
4003 ; VFP2-NEXT: movgt.w r0, #-1
4004 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
4005 ; VFP2-NEXT: vcmp.f32 s2, s0
4007 ; VFP2-NEXT: movvs r0, #0
4008 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
4009 ; VFP2-NEXT: vcmp.f32 s2, s4
4011 ; VFP2-NEXT: movlt r1, #0
4012 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
4013 ; VFP2-NEXT: vcmp.f32 s2, s2
4015 ; VFP2-NEXT: movgt.w r1, #-1
4016 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
4017 ; VFP2-NEXT: vcmp.f32 s2, s0
4019 ; VFP2-NEXT: movvs r1, #0
4020 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
4021 ; VFP2-NEXT: vcmp.f32 s2, s4
4023 ; VFP2-NEXT: movlt r2, #0
4024 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
4025 ; VFP2-NEXT: vcmp.f32 s2, s2
4027 ; VFP2-NEXT: movgt.w r2, #-1
4028 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
4029 ; VFP2-NEXT: vcmp.f32 s2, s0
4031 ; VFP2-NEXT: movvs r2, #0
4032 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
4034 ; VFP2-NEXT: movlt.w r3, #-2147483648
4035 ; VFP2-NEXT: vcmp.f32 s2, s4
4036 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
4038 ; VFP2-NEXT: mvngt r3, #-2147483648
4039 ; VFP2-NEXT: vcmp.f32 s2, s2
4040 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
4042 ; VFP2-NEXT: movvs r3, #0
4043 ; VFP2-NEXT: pop {r4, pc}
4044 ; VFP2-NEXT: .p2align 2
4045 ; VFP2-NEXT: @ %bb.1:
4046 ; VFP2-NEXT: .LCPI29_0:
4047 ; VFP2-NEXT: .long 0xff000000 @ float -1.70141183E+38
4048 ; VFP2-NEXT: .LCPI29_1:
4049 ; VFP2-NEXT: .long 0x7effffff @ float 1.70141173E+38
4051 ; FP16-LABEL: test_signed_i128_f16:
4053 ; FP16-NEXT: .save {r7, lr}
4054 ; FP16-NEXT: push {r7, lr}
4055 ; FP16-NEXT: .vsave {d8}
4056 ; FP16-NEXT: vpush {d8}
4057 ; FP16-NEXT: vmov.f16 s0, r0
4058 ; FP16-NEXT: vcvtb.f32.f16 s16, s0
4059 ; FP16-NEXT: vmov r0, s16
4060 ; FP16-NEXT: bl __fixsfti
4061 ; FP16-NEXT: vldr s0, .LCPI29_0
4062 ; FP16-NEXT: vldr s2, .LCPI29_1
4063 ; FP16-NEXT: vcmp.f32 s16, s0
4064 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
4065 ; FP16-NEXT: vcmp.f32 s16, s2
4067 ; FP16-NEXT: movlt r0, #0
4068 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
4069 ; FP16-NEXT: vcmp.f32 s16, s16
4071 ; FP16-NEXT: movgt.w r0, #-1
4072 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
4073 ; FP16-NEXT: vcmp.f32 s16, s0
4075 ; FP16-NEXT: movvs r0, #0
4076 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
4077 ; FP16-NEXT: vcmp.f32 s16, s2
4079 ; FP16-NEXT: movlt r1, #0
4080 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
4081 ; FP16-NEXT: vcmp.f32 s16, s16
4083 ; FP16-NEXT: movgt.w r1, #-1
4084 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
4085 ; FP16-NEXT: vcmp.f32 s16, s0
4087 ; FP16-NEXT: movvs r1, #0
4088 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
4089 ; FP16-NEXT: vcmp.f32 s16, s2
4091 ; FP16-NEXT: movlt r2, #0
4092 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
4093 ; FP16-NEXT: vcmp.f32 s16, s16
4095 ; FP16-NEXT: movgt.w r2, #-1
4096 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
4097 ; FP16-NEXT: vcmp.f32 s16, s0
4099 ; FP16-NEXT: movvs r2, #0
4100 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
4102 ; FP16-NEXT: movlt.w r3, #-2147483648
4103 ; FP16-NEXT: vcmp.f32 s16, s2
4104 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
4106 ; FP16-NEXT: mvngt r3, #-2147483648
4107 ; FP16-NEXT: vcmp.f32 s16, s16
4108 ; FP16-NEXT: vmrs APSR_nzcv, fpscr
4110 ; FP16-NEXT: movvs r3, #0
4111 ; FP16-NEXT: vpop {d8}
4112 ; FP16-NEXT: pop {r7, pc}
4113 ; FP16-NEXT: .p2align 2
4114 ; FP16-NEXT: @ %bb.1:
4115 ; FP16-NEXT: .LCPI29_0:
4116 ; FP16-NEXT: .long 0xff000000 @ float -1.70141183E+38
4117 ; FP16-NEXT: .LCPI29_1:
4118 ; FP16-NEXT: .long 0x7effffff @ float 1.70141173E+38
4119 %x = call i128 @llvm.fptosi.sat.i128.f16(half %f)