1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=arm-eabi -float-abi=soft %s -o - | FileCheck %s --check-prefixes=SOFT
3 ; RUN: llc -mtriple=arm-eabi -mattr=+vfp2 %s -o - | FileCheck %s --check-prefixes=VFP2
6 ; 32-bit float to signed integer
9 declare i1 @llvm.fptosi.sat.i1.f32 (float)
10 declare i8 @llvm.fptosi.sat.i8.f32 (float)
11 declare i13 @llvm.fptosi.sat.i13.f32 (float)
12 declare i16 @llvm.fptosi.sat.i16.f32 (float)
13 declare i19 @llvm.fptosi.sat.i19.f32 (float)
14 declare i32 @llvm.fptosi.sat.i32.f32 (float)
15 declare i50 @llvm.fptosi.sat.i50.f32 (float)
16 declare i64 @llvm.fptosi.sat.i64.f32 (float)
17 declare i100 @llvm.fptosi.sat.i100.f32(float)
18 declare i128 @llvm.fptosi.sat.i128.f32(float)
20 define i1 @test_signed_i1_f32(float %f) nounwind {
21 ; SOFT-LABEL: test_signed_i1_f32:
23 ; SOFT-NEXT: .save {r4, r5, r6, r7, r11, lr}
24 ; SOFT-NEXT: push {r4, r5, r6, r7, r11, lr}
25 ; SOFT-NEXT: mov r1, #0
26 ; SOFT-NEXT: mov r4, r0
27 ; SOFT-NEXT: bl __aeabi_fcmpgt
28 ; SOFT-NEXT: mov r1, #1065353216
29 ; SOFT-NEXT: mov r5, r0
30 ; SOFT-NEXT: orr r1, r1, #-2147483648
31 ; SOFT-NEXT: mov r0, r4
32 ; SOFT-NEXT: bl __aeabi_fcmpge
33 ; SOFT-NEXT: mov r6, r0
34 ; SOFT-NEXT: mov r0, r4
35 ; SOFT-NEXT: bl __aeabi_f2iz
36 ; SOFT-NEXT: mov r7, r0
37 ; SOFT-NEXT: cmp r6, #0
38 ; SOFT-NEXT: mvneq r7, #0
39 ; SOFT-NEXT: cmp r5, #0
40 ; SOFT-NEXT: mov r0, r4
41 ; SOFT-NEXT: mov r1, r4
42 ; SOFT-NEXT: movne r7, #0
43 ; SOFT-NEXT: bl __aeabi_fcmpun
44 ; SOFT-NEXT: cmp r0, #0
45 ; SOFT-NEXT: movne r7, #0
46 ; SOFT-NEXT: mov r0, r7
47 ; SOFT-NEXT: pop {r4, r5, r6, r7, r11, lr}
48 ; SOFT-NEXT: mov pc, lr
50 ; VFP2-LABEL: test_signed_i1_f32:
52 ; VFP2-NEXT: vmov s0, r0
53 ; VFP2-NEXT: vldr s2, .LCPI0_0
54 ; VFP2-NEXT: vcmp.f32 s0, s2
55 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
56 ; VFP2-NEXT: vcvt.s32.f32 s4, s0
57 ; VFP2-NEXT: vcmp.f32 s0, #0
58 ; VFP2-NEXT: vmov r0, s4
59 ; VFP2-NEXT: mvnlt r0, #0
60 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
61 ; VFP2-NEXT: vcmp.f32 s0, s0
62 ; VFP2-NEXT: movgt r0, #0
63 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
64 ; VFP2-NEXT: movvs r0, #0
65 ; VFP2-NEXT: mov pc, lr
66 ; VFP2-NEXT: .p2align 2
68 ; VFP2-NEXT: .LCPI0_0:
69 ; VFP2-NEXT: .long 0xbf800000 @ float -1
70 %x = call i1 @llvm.fptosi.sat.i1.f32(float %f)
74 define i8 @test_signed_i8_f32(float %f) nounwind {
75 ; SOFT-LABEL: test_signed_i8_f32:
77 ; SOFT-NEXT: .save {r4, r5, r6, r7, r11, lr}
78 ; SOFT-NEXT: push {r4, r5, r6, r7, r11, lr}
79 ; SOFT-NEXT: mov r1, #16646144
80 ; SOFT-NEXT: mov r4, r0
81 ; SOFT-NEXT: orr r1, r1, #1107296256
82 ; SOFT-NEXT: bl __aeabi_fcmpgt
83 ; SOFT-NEXT: mov r5, r0
84 ; SOFT-NEXT: mov r0, r4
85 ; SOFT-NEXT: mov r1, #-1023410176
86 ; SOFT-NEXT: bl __aeabi_fcmpge
87 ; SOFT-NEXT: mov r6, r0
88 ; SOFT-NEXT: mov r0, r4
89 ; SOFT-NEXT: bl __aeabi_f2iz
90 ; SOFT-NEXT: mov r7, r0
91 ; SOFT-NEXT: cmp r6, #0
92 ; SOFT-NEXT: mvneq r7, #127
93 ; SOFT-NEXT: cmp r5, #0
94 ; SOFT-NEXT: mov r0, r4
95 ; SOFT-NEXT: mov r1, r4
96 ; SOFT-NEXT: movne r7, #127
97 ; SOFT-NEXT: bl __aeabi_fcmpun
98 ; SOFT-NEXT: cmp r0, #0
99 ; SOFT-NEXT: movne r7, #0
100 ; SOFT-NEXT: mov r0, r7
101 ; SOFT-NEXT: pop {r4, r5, r6, r7, r11, lr}
102 ; SOFT-NEXT: mov pc, lr
104 ; VFP2-LABEL: test_signed_i8_f32:
106 ; VFP2-NEXT: vmov s0, r0
107 ; VFP2-NEXT: vldr s2, .LCPI1_0
108 ; VFP2-NEXT: vldr s6, .LCPI1_1
109 ; VFP2-NEXT: vcmp.f32 s0, s2
110 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
111 ; VFP2-NEXT: vcvt.s32.f32 s4, s0
112 ; VFP2-NEXT: vcmp.f32 s0, s6
113 ; VFP2-NEXT: vmov r0, s4
114 ; VFP2-NEXT: mvnlt r0, #127
115 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
116 ; VFP2-NEXT: vcmp.f32 s0, s0
117 ; VFP2-NEXT: movgt r0, #127
118 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
119 ; VFP2-NEXT: movvs r0, #0
120 ; VFP2-NEXT: mov pc, lr
121 ; VFP2-NEXT: .p2align 2
122 ; VFP2-NEXT: @ %bb.1:
123 ; VFP2-NEXT: .LCPI1_0:
124 ; VFP2-NEXT: .long 0xc3000000 @ float -128
125 ; VFP2-NEXT: .LCPI1_1:
126 ; VFP2-NEXT: .long 0x42fe0000 @ float 127
127 %x = call i8 @llvm.fptosi.sat.i8.f32(float %f)
131 define i13 @test_signed_i13_f32(float %f) nounwind {
132 ; SOFT-LABEL: test_signed_i13_f32:
134 ; SOFT-NEXT: .save {r4, r5, r6, lr}
135 ; SOFT-NEXT: push {r4, r5, r6, lr}
136 ; SOFT-NEXT: mov r1, #92274688
137 ; SOFT-NEXT: mov r4, r0
138 ; SOFT-NEXT: orr r1, r1, #-1073741824
139 ; SOFT-NEXT: bl __aeabi_fcmpge
140 ; SOFT-NEXT: mov r5, r0
141 ; SOFT-NEXT: mov r0, r4
142 ; SOFT-NEXT: bl __aeabi_f2iz
143 ; SOFT-NEXT: mov r6, r0
144 ; SOFT-NEXT: ldr r0, .LCPI2_0
145 ; SOFT-NEXT: ldr r1, .LCPI2_1
146 ; SOFT-NEXT: cmp r5, #0
147 ; SOFT-NEXT: moveq r6, r0
148 ; SOFT-NEXT: mov r0, r4
149 ; SOFT-NEXT: bl __aeabi_fcmpgt
150 ; SOFT-NEXT: mov r1, #255
151 ; SOFT-NEXT: cmp r0, #0
152 ; SOFT-NEXT: orr r1, r1, #3840
153 ; SOFT-NEXT: mov r0, r4
154 ; SOFT-NEXT: movne r6, r1
155 ; SOFT-NEXT: mov r1, r4
156 ; SOFT-NEXT: bl __aeabi_fcmpun
157 ; SOFT-NEXT: cmp r0, #0
158 ; SOFT-NEXT: movne r6, #0
159 ; SOFT-NEXT: mov r0, r6
160 ; SOFT-NEXT: pop {r4, r5, r6, lr}
161 ; SOFT-NEXT: mov pc, lr
162 ; SOFT-NEXT: .p2align 2
163 ; SOFT-NEXT: @ %bb.1:
164 ; SOFT-NEXT: .LCPI2_0:
165 ; SOFT-NEXT: .long 4294963200 @ 0xfffff000
166 ; SOFT-NEXT: .LCPI2_1:
167 ; SOFT-NEXT: .long 1166012416 @ 0x457ff000
169 ; VFP2-LABEL: test_signed_i13_f32:
171 ; VFP2-NEXT: vmov s0, r0
172 ; VFP2-NEXT: vldr s2, .LCPI2_0
173 ; VFP2-NEXT: vldr s6, .LCPI2_1
174 ; VFP2-NEXT: vcmp.f32 s0, s2
175 ; VFP2-NEXT: ldr r0, .LCPI2_2
176 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
177 ; VFP2-NEXT: vcvt.s32.f32 s4, s0
178 ; VFP2-NEXT: vcmp.f32 s0, s6
179 ; VFP2-NEXT: vmov r1, s4
180 ; VFP2-NEXT: movlt r1, r0
181 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
182 ; VFP2-NEXT: mov r0, #255
183 ; VFP2-NEXT: vcmp.f32 s0, s0
184 ; VFP2-NEXT: orr r0, r0, #3840
185 ; VFP2-NEXT: movle r0, r1
186 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
187 ; VFP2-NEXT: movvs r0, #0
188 ; VFP2-NEXT: mov pc, lr
189 ; VFP2-NEXT: .p2align 2
190 ; VFP2-NEXT: @ %bb.1:
191 ; VFP2-NEXT: .LCPI2_0:
192 ; VFP2-NEXT: .long 0xc5800000 @ float -4096
193 ; VFP2-NEXT: .LCPI2_1:
194 ; VFP2-NEXT: .long 0x457ff000 @ float 4095
195 ; VFP2-NEXT: .LCPI2_2:
196 ; VFP2-NEXT: .long 4294963200 @ 0xfffff000
197 %x = call i13 @llvm.fptosi.sat.i13.f32(float %f)
201 define i16 @test_signed_i16_f32(float %f) nounwind {
202 ; SOFT-LABEL: test_signed_i16_f32:
204 ; SOFT-NEXT: .save {r4, r5, r6, lr}
205 ; SOFT-NEXT: push {r4, r5, r6, lr}
206 ; SOFT-NEXT: mov r1, #-956301312
207 ; SOFT-NEXT: mov r4, r0
208 ; SOFT-NEXT: bl __aeabi_fcmpge
209 ; SOFT-NEXT: mov r5, r0
210 ; SOFT-NEXT: mov r0, r4
211 ; SOFT-NEXT: bl __aeabi_f2iz
212 ; SOFT-NEXT: mov r6, r0
213 ; SOFT-NEXT: ldr r0, .LCPI3_0
214 ; SOFT-NEXT: ldr r1, .LCPI3_1
215 ; SOFT-NEXT: cmp r5, #0
216 ; SOFT-NEXT: moveq r6, r0
217 ; SOFT-NEXT: mov r0, r4
218 ; SOFT-NEXT: bl __aeabi_fcmpgt
219 ; SOFT-NEXT: mov r1, #255
220 ; SOFT-NEXT: cmp r0, #0
221 ; SOFT-NEXT: orr r1, r1, #32512
222 ; SOFT-NEXT: mov r0, r4
223 ; SOFT-NEXT: movne r6, r1
224 ; SOFT-NEXT: mov r1, r4
225 ; SOFT-NEXT: bl __aeabi_fcmpun
226 ; SOFT-NEXT: cmp r0, #0
227 ; SOFT-NEXT: movne r6, #0
228 ; SOFT-NEXT: mov r0, r6
229 ; SOFT-NEXT: pop {r4, r5, r6, lr}
230 ; SOFT-NEXT: mov pc, lr
231 ; SOFT-NEXT: .p2align 2
232 ; SOFT-NEXT: @ %bb.1:
233 ; SOFT-NEXT: .LCPI3_0:
234 ; SOFT-NEXT: .long 4294934528 @ 0xffff8000
235 ; SOFT-NEXT: .LCPI3_1:
236 ; SOFT-NEXT: .long 1191181824 @ 0x46fffe00
238 ; VFP2-LABEL: test_signed_i16_f32:
240 ; VFP2-NEXT: vmov s0, r0
241 ; VFP2-NEXT: vldr s2, .LCPI3_0
242 ; VFP2-NEXT: vldr s6, .LCPI3_1
243 ; VFP2-NEXT: vcmp.f32 s0, s2
244 ; VFP2-NEXT: ldr r0, .LCPI3_2
245 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
246 ; VFP2-NEXT: vcvt.s32.f32 s4, s0
247 ; VFP2-NEXT: vcmp.f32 s0, s6
248 ; VFP2-NEXT: vmov r1, s4
249 ; VFP2-NEXT: movlt r1, r0
250 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
251 ; VFP2-NEXT: mov r0, #255
252 ; VFP2-NEXT: vcmp.f32 s0, s0
253 ; VFP2-NEXT: orr r0, r0, #32512
254 ; VFP2-NEXT: movle r0, r1
255 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
256 ; VFP2-NEXT: movvs r0, #0
257 ; VFP2-NEXT: mov pc, lr
258 ; VFP2-NEXT: .p2align 2
259 ; VFP2-NEXT: @ %bb.1:
260 ; VFP2-NEXT: .LCPI3_0:
261 ; VFP2-NEXT: .long 0xc7000000 @ float -32768
262 ; VFP2-NEXT: .LCPI3_1:
263 ; VFP2-NEXT: .long 0x46fffe00 @ float 32767
264 ; VFP2-NEXT: .LCPI3_2:
265 ; VFP2-NEXT: .long 4294934528 @ 0xffff8000
266 %x = call i16 @llvm.fptosi.sat.i16.f32(float %f)
270 define i19 @test_signed_i19_f32(float %f) nounwind {
271 ; SOFT-LABEL: test_signed_i19_f32:
273 ; SOFT-NEXT: .save {r4, r5, r6, lr}
274 ; SOFT-NEXT: push {r4, r5, r6, lr}
275 ; SOFT-NEXT: mov r1, #142606336
276 ; SOFT-NEXT: mov r4, r0
277 ; SOFT-NEXT: orr r1, r1, #-1073741824
278 ; SOFT-NEXT: bl __aeabi_fcmpge
279 ; SOFT-NEXT: mov r5, r0
280 ; SOFT-NEXT: mov r0, r4
281 ; SOFT-NEXT: bl __aeabi_f2iz
282 ; SOFT-NEXT: mov r6, r0
283 ; SOFT-NEXT: mov r0, #66846720
284 ; SOFT-NEXT: orr r0, r0, #-67108864
285 ; SOFT-NEXT: ldr r1, .LCPI4_0
286 ; SOFT-NEXT: cmp r5, #0
287 ; SOFT-NEXT: moveq r6, r0
288 ; SOFT-NEXT: mov r0, r4
289 ; SOFT-NEXT: bl __aeabi_fcmpgt
290 ; SOFT-NEXT: ldr r1, .LCPI4_1
291 ; SOFT-NEXT: cmp r0, #0
292 ; SOFT-NEXT: mov r0, r4
293 ; SOFT-NEXT: movne r6, r1
294 ; SOFT-NEXT: mov r1, r4
295 ; SOFT-NEXT: bl __aeabi_fcmpun
296 ; SOFT-NEXT: cmp r0, #0
297 ; SOFT-NEXT: movne r6, #0
298 ; SOFT-NEXT: mov r0, r6
299 ; SOFT-NEXT: pop {r4, r5, r6, lr}
300 ; SOFT-NEXT: mov pc, lr
301 ; SOFT-NEXT: .p2align 2
302 ; SOFT-NEXT: @ %bb.1:
303 ; SOFT-NEXT: .LCPI4_0:
304 ; SOFT-NEXT: .long 1216348096 @ 0x487fffc0
305 ; SOFT-NEXT: .LCPI4_1:
306 ; SOFT-NEXT: .long 262143 @ 0x3ffff
308 ; VFP2-LABEL: test_signed_i19_f32:
310 ; VFP2-NEXT: vmov s0, r0
311 ; VFP2-NEXT: vldr s6, .LCPI4_2
312 ; VFP2-NEXT: vldr s2, .LCPI4_0
313 ; VFP2-NEXT: mov r0, #66846720
314 ; VFP2-NEXT: vcvt.s32.f32 s4, s0
315 ; VFP2-NEXT: orr r0, r0, #-67108864
316 ; VFP2-NEXT: vcmp.f32 s0, s6
317 ; VFP2-NEXT: ldr r1, .LCPI4_1
318 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
319 ; VFP2-NEXT: vcmp.f32 s0, s2
320 ; VFP2-NEXT: vmov r2, s4
321 ; VFP2-NEXT: movge r0, r2
322 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
323 ; VFP2-NEXT: vcmp.f32 s0, s0
324 ; VFP2-NEXT: movgt r0, r1
325 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
326 ; VFP2-NEXT: movvs r0, #0
327 ; VFP2-NEXT: mov pc, lr
328 ; VFP2-NEXT: .p2align 2
329 ; VFP2-NEXT: @ %bb.1:
330 ; VFP2-NEXT: .LCPI4_0:
331 ; VFP2-NEXT: .long 0x487fffc0 @ float 262143
332 ; VFP2-NEXT: .LCPI4_1:
333 ; VFP2-NEXT: .long 262143 @ 0x3ffff
334 ; VFP2-NEXT: .LCPI4_2:
335 ; VFP2-NEXT: .long 0xc8800000 @ float -262144
336 %x = call i19 @llvm.fptosi.sat.i19.f32(float %f)
340 define i32 @test_signed_i32_f32(float %f) nounwind {
341 ; SOFT-LABEL: test_signed_i32_f32:
343 ; SOFT-NEXT: .save {r4, r5, r6, r7, r11, lr}
344 ; SOFT-NEXT: push {r4, r5, r6, r7, r11, lr}
345 ; SOFT-NEXT: mvn r1, #-1325400064
346 ; SOFT-NEXT: mov r4, r0
347 ; SOFT-NEXT: bl __aeabi_fcmpgt
348 ; SOFT-NEXT: mov r5, r0
349 ; SOFT-NEXT: mov r0, r4
350 ; SOFT-NEXT: mov r1, #-822083584
351 ; SOFT-NEXT: bl __aeabi_fcmpge
352 ; SOFT-NEXT: mov r6, r0
353 ; SOFT-NEXT: mov r0, r4
354 ; SOFT-NEXT: bl __aeabi_f2iz
355 ; SOFT-NEXT: mov r7, r0
356 ; SOFT-NEXT: cmp r6, #0
357 ; SOFT-NEXT: moveq r7, #-2147483648
358 ; SOFT-NEXT: cmp r5, #0
359 ; SOFT-NEXT: mov r0, r4
360 ; SOFT-NEXT: mov r1, r4
361 ; SOFT-NEXT: mvnne r7, #-2147483648
362 ; SOFT-NEXT: bl __aeabi_fcmpun
363 ; SOFT-NEXT: cmp r0, #0
364 ; SOFT-NEXT: movne r7, #0
365 ; SOFT-NEXT: mov r0, r7
366 ; SOFT-NEXT: pop {r4, r5, r6, r7, r11, lr}
367 ; SOFT-NEXT: mov pc, lr
369 ; VFP2-LABEL: test_signed_i32_f32:
371 ; VFP2-NEXT: vmov s0, r0
372 ; VFP2-NEXT: vldr s2, .LCPI5_0
373 ; VFP2-NEXT: vldr s6, .LCPI5_1
374 ; VFP2-NEXT: vcmp.f32 s0, s2
375 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
376 ; VFP2-NEXT: vcvt.s32.f32 s4, s0
377 ; VFP2-NEXT: vcmp.f32 s0, s6
378 ; VFP2-NEXT: vmov r0, s4
379 ; VFP2-NEXT: movlt r0, #-2147483648
380 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
381 ; VFP2-NEXT: vcmp.f32 s0, s0
382 ; VFP2-NEXT: mvngt r0, #-2147483648
383 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
384 ; VFP2-NEXT: movvs r0, #0
385 ; VFP2-NEXT: mov pc, lr
386 ; VFP2-NEXT: .p2align 2
387 ; VFP2-NEXT: @ %bb.1:
388 ; VFP2-NEXT: .LCPI5_0:
389 ; VFP2-NEXT: .long 0xcf000000 @ float -2.14748365E+9
390 ; VFP2-NEXT: .LCPI5_1:
391 ; VFP2-NEXT: .long 0x4effffff @ float 2.14748352E+9
392 %x = call i32 @llvm.fptosi.sat.i32.f32(float %f)
396 define i50 @test_signed_i50_f32(float %f) nounwind {
397 ; SOFT-LABEL: test_signed_i50_f32:
399 ; SOFT-NEXT: .save {r4, r5, r6, r7, r8, lr}
400 ; SOFT-NEXT: push {r4, r5, r6, r7, r8, lr}
401 ; SOFT-NEXT: mvn r1, #-1476395008
402 ; SOFT-NEXT: mov r4, r0
403 ; SOFT-NEXT: bl __aeabi_fcmpgt
404 ; SOFT-NEXT: mov r8, r0
405 ; SOFT-NEXT: mov r0, r4
406 ; SOFT-NEXT: mov r1, #-671088640
407 ; SOFT-NEXT: bl __aeabi_fcmpge
408 ; SOFT-NEXT: mov r7, r0
409 ; SOFT-NEXT: mov r0, r4
410 ; SOFT-NEXT: bl __aeabi_f2lz
411 ; SOFT-NEXT: mov r5, r0
412 ; SOFT-NEXT: cmp r7, #0
413 ; SOFT-NEXT: mov r6, r1
414 ; SOFT-NEXT: moveq r5, r7
415 ; SOFT-NEXT: cmp r8, #0
416 ; SOFT-NEXT: mov r0, r4
417 ; SOFT-NEXT: mov r1, r4
418 ; SOFT-NEXT: mvnne r5, #0
419 ; SOFT-NEXT: bl __aeabi_fcmpun
420 ; SOFT-NEXT: cmp r0, #0
421 ; SOFT-NEXT: mov r0, r4
422 ; SOFT-NEXT: mov r1, #-671088640
423 ; SOFT-NEXT: movne r5, #0
424 ; SOFT-NEXT: bl __aeabi_fcmpge
425 ; SOFT-NEXT: mov r1, #16646144
426 ; SOFT-NEXT: cmp r0, #0
427 ; SOFT-NEXT: orr r1, r1, #-16777216
428 ; SOFT-NEXT: mov r0, r4
429 ; SOFT-NEXT: moveq r6, r1
430 ; SOFT-NEXT: mvn r1, #-1476395008
431 ; SOFT-NEXT: bl __aeabi_fcmpgt
432 ; SOFT-NEXT: ldr r1, .LCPI6_0
433 ; SOFT-NEXT: cmp r0, #0
434 ; SOFT-NEXT: mov r0, r4
435 ; SOFT-NEXT: movne r6, r1
436 ; SOFT-NEXT: mov r1, r4
437 ; SOFT-NEXT: bl __aeabi_fcmpun
438 ; SOFT-NEXT: cmp r0, #0
439 ; SOFT-NEXT: mov r0, r5
440 ; SOFT-NEXT: movne r6, #0
441 ; SOFT-NEXT: mov r1, r6
442 ; SOFT-NEXT: pop {r4, r5, r6, r7, r8, lr}
443 ; SOFT-NEXT: mov pc, lr
444 ; SOFT-NEXT: .p2align 2
445 ; SOFT-NEXT: @ %bb.1:
446 ; SOFT-NEXT: .LCPI6_0:
447 ; SOFT-NEXT: .long 131071 @ 0x1ffff
449 ; VFP2-LABEL: test_signed_i50_f32:
451 ; VFP2-NEXT: .save {r11, lr}
452 ; VFP2-NEXT: push {r11, lr}
453 ; VFP2-NEXT: .vsave {d8, d9}
454 ; VFP2-NEXT: vpush {d8, d9}
455 ; VFP2-NEXT: vldr s16, .LCPI6_0
456 ; VFP2-NEXT: vmov s18, r0
457 ; VFP2-NEXT: bl __aeabi_f2lz
458 ; VFP2-NEXT: vcmp.f32 s18, s16
459 ; VFP2-NEXT: mov r2, #16646144
460 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
461 ; VFP2-NEXT: orr r2, r2, #-16777216
462 ; VFP2-NEXT: vldr s0, .LCPI6_1
463 ; VFP2-NEXT: ldr r3, .LCPI6_2
464 ; VFP2-NEXT: vcmp.f32 s18, s0
465 ; VFP2-NEXT: movlt r1, r2
466 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
467 ; VFP2-NEXT: vcmp.f32 s18, s18
468 ; VFP2-NEXT: movgt r1, r3
469 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
470 ; VFP2-NEXT: vcmp.f32 s18, s16
471 ; VFP2-NEXT: movvs r1, #0
472 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
473 ; VFP2-NEXT: vcmp.f32 s18, s0
474 ; VFP2-NEXT: movlt r0, #0
475 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
476 ; VFP2-NEXT: vcmp.f32 s18, s18
477 ; VFP2-NEXT: mvngt r0, #0
478 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
479 ; VFP2-NEXT: movvs r0, #0
480 ; VFP2-NEXT: vpop {d8, d9}
481 ; VFP2-NEXT: pop {r11, lr}
482 ; VFP2-NEXT: mov pc, lr
483 ; VFP2-NEXT: .p2align 2
484 ; VFP2-NEXT: @ %bb.1:
485 ; VFP2-NEXT: .LCPI6_0:
486 ; VFP2-NEXT: .long 0xd8000000 @ float -5.62949953E+14
487 ; VFP2-NEXT: .LCPI6_1:
488 ; VFP2-NEXT: .long 0x57ffffff @ float 5.6294992E+14
489 ; VFP2-NEXT: .LCPI6_2:
490 ; VFP2-NEXT: .long 131071 @ 0x1ffff
491 %x = call i50 @llvm.fptosi.sat.i50.f32(float %f)
495 define i64 @test_signed_i64_f32(float %f) nounwind {
496 ; SOFT-LABEL: test_signed_i64_f32:
498 ; SOFT-NEXT: .save {r4, r5, r6, r7, r8, lr}
499 ; SOFT-NEXT: push {r4, r5, r6, r7, r8, lr}
500 ; SOFT-NEXT: mvn r1, #-1593835520
501 ; SOFT-NEXT: mov r4, r0
502 ; SOFT-NEXT: bl __aeabi_fcmpgt
503 ; SOFT-NEXT: mov r8, r0
504 ; SOFT-NEXT: mov r0, r4
505 ; SOFT-NEXT: mov r1, #-553648128
506 ; SOFT-NEXT: bl __aeabi_fcmpge
507 ; SOFT-NEXT: mov r7, r0
508 ; SOFT-NEXT: mov r0, r4
509 ; SOFT-NEXT: bl __aeabi_f2lz
510 ; SOFT-NEXT: mov r5, r0
511 ; SOFT-NEXT: cmp r7, #0
512 ; SOFT-NEXT: mov r6, r1
513 ; SOFT-NEXT: moveq r5, r7
514 ; SOFT-NEXT: cmp r8, #0
515 ; SOFT-NEXT: mov r0, r4
516 ; SOFT-NEXT: mov r1, r4
517 ; SOFT-NEXT: mvnne r5, #0
518 ; SOFT-NEXT: bl __aeabi_fcmpun
519 ; SOFT-NEXT: cmp r0, #0
520 ; SOFT-NEXT: mov r0, r4
521 ; SOFT-NEXT: mvn r1, #-1593835520
522 ; SOFT-NEXT: movne r5, #0
523 ; SOFT-NEXT: bl __aeabi_fcmpgt
524 ; SOFT-NEXT: mov r7, r0
525 ; SOFT-NEXT: mov r0, r4
526 ; SOFT-NEXT: mov r1, #-553648128
527 ; SOFT-NEXT: bl __aeabi_fcmpge
528 ; SOFT-NEXT: cmp r0, #0
529 ; SOFT-NEXT: mov r0, r4
530 ; SOFT-NEXT: moveq r6, #-2147483648
531 ; SOFT-NEXT: cmp r7, #0
532 ; SOFT-NEXT: mov r1, r4
533 ; SOFT-NEXT: mvnne r6, #-2147483648
534 ; SOFT-NEXT: bl __aeabi_fcmpun
535 ; SOFT-NEXT: cmp r0, #0
536 ; SOFT-NEXT: mov r0, r5
537 ; SOFT-NEXT: movne r6, #0
538 ; SOFT-NEXT: mov r1, r6
539 ; SOFT-NEXT: pop {r4, r5, r6, r7, r8, lr}
540 ; SOFT-NEXT: mov pc, lr
542 ; VFP2-LABEL: test_signed_i64_f32:
544 ; VFP2-NEXT: .save {r4, lr}
545 ; VFP2-NEXT: push {r4, lr}
546 ; VFP2-NEXT: mov r4, r0
547 ; VFP2-NEXT: bl __aeabi_f2lz
548 ; VFP2-NEXT: vldr s0, .LCPI7_0
549 ; VFP2-NEXT: vmov s2, r4
550 ; VFP2-NEXT: vldr s4, .LCPI7_1
551 ; VFP2-NEXT: vcmp.f32 s2, s0
552 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
553 ; VFP2-NEXT: vcmp.f32 s2, s4
554 ; VFP2-NEXT: movlt r0, #0
555 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
556 ; VFP2-NEXT: vcmp.f32 s2, s2
557 ; VFP2-NEXT: mvngt r0, #0
558 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
559 ; VFP2-NEXT: vcmp.f32 s2, s0
560 ; VFP2-NEXT: movvs r0, #0
561 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
562 ; VFP2-NEXT: vcmp.f32 s2, s4
563 ; VFP2-NEXT: movlt r1, #-2147483648
564 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
565 ; VFP2-NEXT: vcmp.f32 s2, s2
566 ; VFP2-NEXT: mvngt r1, #-2147483648
567 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
568 ; VFP2-NEXT: movvs r1, #0
569 ; VFP2-NEXT: pop {r4, lr}
570 ; VFP2-NEXT: mov pc, lr
571 ; VFP2-NEXT: .p2align 2
572 ; VFP2-NEXT: @ %bb.1:
573 ; VFP2-NEXT: .LCPI7_0:
574 ; VFP2-NEXT: .long 0xdf000000 @ float -9.22337203E+18
575 ; VFP2-NEXT: .LCPI7_1:
576 ; VFP2-NEXT: .long 0x5effffff @ float 9.22337149E+18
577 %x = call i64 @llvm.fptosi.sat.i64.f32(float %f)
581 define i100 @test_signed_i100_f32(float %f) nounwind {
582 ; SOFT-LABEL: test_signed_i100_f32:
584 ; SOFT-NEXT: .save {r4, r5, r6, r7, r8, r9, r10, lr}
585 ; SOFT-NEXT: push {r4, r5, r6, r7, r8, r9, r10, lr}
586 ; SOFT-NEXT: mvn r1, #-1895825408
587 ; SOFT-NEXT: mov r4, r0
588 ; SOFT-NEXT: bl __aeabi_fcmpgt
589 ; SOFT-NEXT: mov r9, r0
590 ; SOFT-NEXT: mov r0, r4
591 ; SOFT-NEXT: mov r1, #-251658240
592 ; SOFT-NEXT: bl __aeabi_fcmpge
593 ; SOFT-NEXT: mov r5, r0
594 ; SOFT-NEXT: mov r0, r4
595 ; SOFT-NEXT: bl __fixsfti
596 ; SOFT-NEXT: mov r10, r0
597 ; SOFT-NEXT: cmp r5, #0
598 ; SOFT-NEXT: mov r6, r1
599 ; SOFT-NEXT: moveq r10, r5
600 ; SOFT-NEXT: cmp r9, #0
601 ; SOFT-NEXT: mov r0, r4
602 ; SOFT-NEXT: mov r1, r4
603 ; SOFT-NEXT: mov r7, r2
604 ; SOFT-NEXT: mov r8, r3
605 ; SOFT-NEXT: mvnne r10, #0
606 ; SOFT-NEXT: bl __aeabi_fcmpun
607 ; SOFT-NEXT: cmp r0, #0
608 ; SOFT-NEXT: mov r0, r4
609 ; SOFT-NEXT: mvn r1, #-1895825408
610 ; SOFT-NEXT: movne r10, #0
611 ; SOFT-NEXT: bl __aeabi_fcmpgt
612 ; SOFT-NEXT: mov r5, r0
613 ; SOFT-NEXT: mov r0, r4
614 ; SOFT-NEXT: mov r1, #-251658240
615 ; SOFT-NEXT: bl __aeabi_fcmpge
616 ; SOFT-NEXT: cmp r0, #0
617 ; SOFT-NEXT: mov r1, r4
618 ; SOFT-NEXT: moveq r6, r0
619 ; SOFT-NEXT: cmp r5, #0
620 ; SOFT-NEXT: mov r0, r4
621 ; SOFT-NEXT: mvnne r6, #0
622 ; SOFT-NEXT: bl __aeabi_fcmpun
623 ; SOFT-NEXT: cmp r0, #0
624 ; SOFT-NEXT: mov r0, r4
625 ; SOFT-NEXT: mvn r1, #-1895825408
626 ; SOFT-NEXT: movne r6, #0
627 ; SOFT-NEXT: bl __aeabi_fcmpgt
628 ; SOFT-NEXT: mov r5, r0
629 ; SOFT-NEXT: mov r0, r4
630 ; SOFT-NEXT: mov r1, #-251658240
631 ; SOFT-NEXT: bl __aeabi_fcmpge
632 ; SOFT-NEXT: cmp r0, #0
633 ; SOFT-NEXT: mov r1, r4
634 ; SOFT-NEXT: moveq r7, r0
635 ; SOFT-NEXT: cmp r5, #0
636 ; SOFT-NEXT: mov r0, r4
637 ; SOFT-NEXT: mvnne r7, #0
638 ; SOFT-NEXT: bl __aeabi_fcmpun
639 ; SOFT-NEXT: cmp r0, #0
640 ; SOFT-NEXT: mov r0, r4
641 ; SOFT-NEXT: mvn r1, #-1895825408
642 ; SOFT-NEXT: movne r7, #0
643 ; SOFT-NEXT: bl __aeabi_fcmpgt
644 ; SOFT-NEXT: mov r5, r0
645 ; SOFT-NEXT: mov r0, r4
646 ; SOFT-NEXT: mov r1, #-251658240
647 ; SOFT-NEXT: bl __aeabi_fcmpge
648 ; SOFT-NEXT: cmp r0, #0
649 ; SOFT-NEXT: mov r0, r4
650 ; SOFT-NEXT: mvneq r8, #7
651 ; SOFT-NEXT: cmp r5, #0
652 ; SOFT-NEXT: mov r1, r4
653 ; SOFT-NEXT: movne r8, #7
654 ; SOFT-NEXT: bl __aeabi_fcmpun
655 ; SOFT-NEXT: cmp r0, #0
656 ; SOFT-NEXT: mov r0, r10
657 ; SOFT-NEXT: movne r8, #0
658 ; SOFT-NEXT: mov r1, r6
659 ; SOFT-NEXT: mov r2, r7
660 ; SOFT-NEXT: mov r3, r8
661 ; SOFT-NEXT: pop {r4, r5, r6, r7, r8, r9, r10, lr}
662 ; SOFT-NEXT: mov pc, lr
664 ; VFP2-LABEL: test_signed_i100_f32:
666 ; VFP2-NEXT: .save {r4, lr}
667 ; VFP2-NEXT: push {r4, lr}
668 ; VFP2-NEXT: mov r4, r0
669 ; VFP2-NEXT: bl __fixsfti
670 ; VFP2-NEXT: vldr s0, .LCPI8_0
671 ; VFP2-NEXT: vmov s2, r4
672 ; VFP2-NEXT: vldr s4, .LCPI8_1
673 ; VFP2-NEXT: vcmp.f32 s2, s0
674 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
675 ; VFP2-NEXT: vcmp.f32 s2, s4
676 ; VFP2-NEXT: movlt r0, #0
677 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
678 ; VFP2-NEXT: vcmp.f32 s2, s2
679 ; VFP2-NEXT: mvngt r0, #0
680 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
681 ; VFP2-NEXT: vcmp.f32 s2, s0
682 ; VFP2-NEXT: movvs r0, #0
683 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
684 ; VFP2-NEXT: vcmp.f32 s2, s4
685 ; VFP2-NEXT: movlt r1, #0
686 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
687 ; VFP2-NEXT: vcmp.f32 s2, s2
688 ; VFP2-NEXT: mvngt r1, #0
689 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
690 ; VFP2-NEXT: vcmp.f32 s2, s0
691 ; VFP2-NEXT: movvs r1, #0
692 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
693 ; VFP2-NEXT: vcmp.f32 s2, s4
694 ; VFP2-NEXT: movlt r2, #0
695 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
696 ; VFP2-NEXT: vcmp.f32 s2, s2
697 ; VFP2-NEXT: mvngt r2, #0
698 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
699 ; VFP2-NEXT: vcmp.f32 s2, s0
700 ; VFP2-NEXT: movvs r2, #0
701 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
702 ; VFP2-NEXT: vcmp.f32 s2, s4
703 ; VFP2-NEXT: mvnlt r3, #7
704 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
705 ; VFP2-NEXT: vcmp.f32 s2, s2
706 ; VFP2-NEXT: movgt r3, #7
707 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
708 ; VFP2-NEXT: movvs r3, #0
709 ; VFP2-NEXT: pop {r4, lr}
710 ; VFP2-NEXT: mov pc, lr
711 ; VFP2-NEXT: .p2align 2
712 ; VFP2-NEXT: @ %bb.1:
713 ; VFP2-NEXT: .LCPI8_0:
714 ; VFP2-NEXT: .long 0xf1000000 @ float -6.338253E+29
715 ; VFP2-NEXT: .LCPI8_1:
716 ; VFP2-NEXT: .long 0x70ffffff @ float 6.33825262E+29
717 %x = call i100 @llvm.fptosi.sat.i100.f32(float %f)
721 define i128 @test_signed_i128_f32(float %f) nounwind {
722 ; SOFT-LABEL: test_signed_i128_f32:
724 ; SOFT-NEXT: .save {r4, r5, r6, r7, r8, r9, r10, lr}
725 ; SOFT-NEXT: push {r4, r5, r6, r7, r8, r9, r10, lr}
726 ; SOFT-NEXT: mvn r1, #-2130706432
727 ; SOFT-NEXT: mov r4, r0
728 ; SOFT-NEXT: bl __aeabi_fcmpgt
729 ; SOFT-NEXT: mov r9, r0
730 ; SOFT-NEXT: mov r0, r4
731 ; SOFT-NEXT: mov r1, #-16777216
732 ; SOFT-NEXT: bl __aeabi_fcmpge
733 ; SOFT-NEXT: mov r5, r0
734 ; SOFT-NEXT: mov r0, r4
735 ; SOFT-NEXT: bl __fixsfti
736 ; SOFT-NEXT: mov r10, r0
737 ; SOFT-NEXT: cmp r5, #0
738 ; SOFT-NEXT: mov r6, r1
739 ; SOFT-NEXT: moveq r10, r5
740 ; SOFT-NEXT: cmp r9, #0
741 ; SOFT-NEXT: mov r0, r4
742 ; SOFT-NEXT: mov r1, r4
743 ; SOFT-NEXT: mov r7, r2
744 ; SOFT-NEXT: mov r8, r3
745 ; SOFT-NEXT: mvnne r10, #0
746 ; SOFT-NEXT: bl __aeabi_fcmpun
747 ; SOFT-NEXT: cmp r0, #0
748 ; SOFT-NEXT: mov r0, r4
749 ; SOFT-NEXT: mvn r1, #-2130706432
750 ; SOFT-NEXT: movne r10, #0
751 ; SOFT-NEXT: bl __aeabi_fcmpgt
752 ; SOFT-NEXT: mov r5, r0
753 ; SOFT-NEXT: mov r0, r4
754 ; SOFT-NEXT: mov r1, #-16777216
755 ; SOFT-NEXT: bl __aeabi_fcmpge
756 ; SOFT-NEXT: cmp r0, #0
757 ; SOFT-NEXT: mov r1, r4
758 ; SOFT-NEXT: moveq r6, r0
759 ; SOFT-NEXT: cmp r5, #0
760 ; SOFT-NEXT: mov r0, r4
761 ; SOFT-NEXT: mvnne r6, #0
762 ; SOFT-NEXT: bl __aeabi_fcmpun
763 ; SOFT-NEXT: cmp r0, #0
764 ; SOFT-NEXT: mov r0, r4
765 ; SOFT-NEXT: mvn r1, #-2130706432
766 ; SOFT-NEXT: movne r6, #0
767 ; SOFT-NEXT: bl __aeabi_fcmpgt
768 ; SOFT-NEXT: mov r5, r0
769 ; SOFT-NEXT: mov r0, r4
770 ; SOFT-NEXT: mov r1, #-16777216
771 ; SOFT-NEXT: bl __aeabi_fcmpge
772 ; SOFT-NEXT: cmp r0, #0
773 ; SOFT-NEXT: mov r1, r4
774 ; SOFT-NEXT: moveq r7, r0
775 ; SOFT-NEXT: cmp r5, #0
776 ; SOFT-NEXT: mov r0, r4
777 ; SOFT-NEXT: mvnne r7, #0
778 ; SOFT-NEXT: bl __aeabi_fcmpun
779 ; SOFT-NEXT: cmp r0, #0
780 ; SOFT-NEXT: mov r0, r4
781 ; SOFT-NEXT: mvn r1, #-2130706432
782 ; SOFT-NEXT: movne r7, #0
783 ; SOFT-NEXT: bl __aeabi_fcmpgt
784 ; SOFT-NEXT: mov r5, r0
785 ; SOFT-NEXT: mov r0, r4
786 ; SOFT-NEXT: mov r1, #-16777216
787 ; SOFT-NEXT: bl __aeabi_fcmpge
788 ; SOFT-NEXT: cmp r0, #0
789 ; SOFT-NEXT: mov r0, r4
790 ; SOFT-NEXT: moveq r8, #-2147483648
791 ; SOFT-NEXT: cmp r5, #0
792 ; SOFT-NEXT: mov r1, r4
793 ; SOFT-NEXT: mvnne r8, #-2147483648
794 ; SOFT-NEXT: bl __aeabi_fcmpun
795 ; SOFT-NEXT: cmp r0, #0
796 ; SOFT-NEXT: mov r0, r10
797 ; SOFT-NEXT: movne r8, #0
798 ; SOFT-NEXT: mov r1, r6
799 ; SOFT-NEXT: mov r2, r7
800 ; SOFT-NEXT: mov r3, r8
801 ; SOFT-NEXT: pop {r4, r5, r6, r7, r8, r9, r10, lr}
802 ; SOFT-NEXT: mov pc, lr
804 ; VFP2-LABEL: test_signed_i128_f32:
806 ; VFP2-NEXT: .save {r4, lr}
807 ; VFP2-NEXT: push {r4, lr}
808 ; VFP2-NEXT: mov r4, r0
809 ; VFP2-NEXT: bl __fixsfti
810 ; VFP2-NEXT: vldr s0, .LCPI9_0
811 ; VFP2-NEXT: vmov s2, r4
812 ; VFP2-NEXT: vldr s4, .LCPI9_1
813 ; VFP2-NEXT: vcmp.f32 s2, s0
814 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
815 ; VFP2-NEXT: vcmp.f32 s2, s4
816 ; VFP2-NEXT: movlt r0, #0
817 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
818 ; VFP2-NEXT: vcmp.f32 s2, s2
819 ; VFP2-NEXT: mvngt r0, #0
820 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
821 ; VFP2-NEXT: vcmp.f32 s2, s0
822 ; VFP2-NEXT: movvs r0, #0
823 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
824 ; VFP2-NEXT: vcmp.f32 s2, s4
825 ; VFP2-NEXT: movlt r1, #0
826 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
827 ; VFP2-NEXT: vcmp.f32 s2, s2
828 ; VFP2-NEXT: mvngt r1, #0
829 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
830 ; VFP2-NEXT: vcmp.f32 s2, s0
831 ; VFP2-NEXT: movvs r1, #0
832 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
833 ; VFP2-NEXT: vcmp.f32 s2, s4
834 ; VFP2-NEXT: movlt r2, #0
835 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
836 ; VFP2-NEXT: vcmp.f32 s2, s2
837 ; VFP2-NEXT: mvngt r2, #0
838 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
839 ; VFP2-NEXT: vcmp.f32 s2, s0
840 ; VFP2-NEXT: movvs r2, #0
841 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
842 ; VFP2-NEXT: vcmp.f32 s2, s4
843 ; VFP2-NEXT: movlt r3, #-2147483648
844 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
845 ; VFP2-NEXT: vcmp.f32 s2, s2
846 ; VFP2-NEXT: mvngt r3, #-2147483648
847 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
848 ; VFP2-NEXT: movvs r3, #0
849 ; VFP2-NEXT: pop {r4, lr}
850 ; VFP2-NEXT: mov pc, lr
851 ; VFP2-NEXT: .p2align 2
852 ; VFP2-NEXT: @ %bb.1:
853 ; VFP2-NEXT: .LCPI9_0:
854 ; VFP2-NEXT: .long 0xff000000 @ float -1.70141183E+38
855 ; VFP2-NEXT: .LCPI9_1:
856 ; VFP2-NEXT: .long 0x7effffff @ float 1.70141173E+38
857 %x = call i128 @llvm.fptosi.sat.i128.f32(float %f)
862 ; 64-bit float to signed integer
865 declare i1 @llvm.fptosi.sat.i1.f64 (double)
866 declare i8 @llvm.fptosi.sat.i8.f64 (double)
867 declare i13 @llvm.fptosi.sat.i13.f64 (double)
868 declare i16 @llvm.fptosi.sat.i16.f64 (double)
869 declare i19 @llvm.fptosi.sat.i19.f64 (double)
870 declare i32 @llvm.fptosi.sat.i32.f64 (double)
871 declare i50 @llvm.fptosi.sat.i50.f64 (double)
872 declare i64 @llvm.fptosi.sat.i64.f64 (double)
873 declare i100 @llvm.fptosi.sat.i100.f64(double)
874 declare i128 @llvm.fptosi.sat.i128.f64(double)
876 define i1 @test_signed_i1_f64(double %f) nounwind {
877 ; SOFT-LABEL: test_signed_i1_f64:
879 ; SOFT-NEXT: .save {r4, r5, r6, r7, r11, lr}
880 ; SOFT-NEXT: push {r4, r5, r6, r7, r11, lr}
881 ; SOFT-NEXT: mov r3, #267386880
882 ; SOFT-NEXT: mov r2, #0
883 ; SOFT-NEXT: orr r3, r3, #-1342177280
884 ; SOFT-NEXT: mov r4, r1
885 ; SOFT-NEXT: mov r5, r0
886 ; SOFT-NEXT: bl __aeabi_dcmpge
887 ; SOFT-NEXT: mov r6, r0
888 ; SOFT-NEXT: mov r0, r5
889 ; SOFT-NEXT: mov r1, r4
890 ; SOFT-NEXT: bl __aeabi_d2iz
891 ; SOFT-NEXT: mov r7, r0
892 ; SOFT-NEXT: cmp r6, #0
893 ; SOFT-NEXT: mov r0, r5
894 ; SOFT-NEXT: mov r1, r4
895 ; SOFT-NEXT: mov r2, #0
896 ; SOFT-NEXT: mov r3, #0
897 ; SOFT-NEXT: mvneq r7, #0
898 ; SOFT-NEXT: bl __aeabi_dcmpgt
899 ; SOFT-NEXT: cmp r0, #0
900 ; SOFT-NEXT: mov r0, r5
901 ; SOFT-NEXT: mov r1, r4
902 ; SOFT-NEXT: mov r2, r5
903 ; SOFT-NEXT: mov r3, r4
904 ; SOFT-NEXT: movne r7, #0
905 ; SOFT-NEXT: bl __aeabi_dcmpun
906 ; SOFT-NEXT: cmp r0, #0
907 ; SOFT-NEXT: movne r7, #0
908 ; SOFT-NEXT: mov r0, r7
909 ; SOFT-NEXT: pop {r4, r5, r6, r7, r11, lr}
910 ; SOFT-NEXT: mov pc, lr
912 ; VFP2-LABEL: test_signed_i1_f64:
914 ; VFP2-NEXT: vldr d2, .LCPI10_0
915 ; VFP2-NEXT: vmov d0, r0, r1
916 ; VFP2-NEXT: vcmp.f64 d0, d2
917 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
918 ; VFP2-NEXT: vcvt.s32.f64 s2, d0
919 ; VFP2-NEXT: vcmp.f64 d0, #0
920 ; VFP2-NEXT: vmov r0, s2
921 ; VFP2-NEXT: mvnlt r0, #0
922 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
923 ; VFP2-NEXT: vcmp.f64 d0, d0
924 ; VFP2-NEXT: movgt r0, #0
925 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
926 ; VFP2-NEXT: movvs r0, #0
927 ; VFP2-NEXT: mov pc, lr
928 ; VFP2-NEXT: .p2align 3
929 ; VFP2-NEXT: @ %bb.1:
930 ; VFP2-NEXT: .LCPI10_0:
931 ; VFP2-NEXT: .long 0 @ double -1
932 ; VFP2-NEXT: .long 3220176896
933 %x = call i1 @llvm.fptosi.sat.i1.f64(double %f)
937 define i8 @test_signed_i8_f64(double %f) nounwind {
938 ; SOFT-LABEL: test_signed_i8_f64:
940 ; SOFT-NEXT: .save {r4, r5, r6, r7, r8, lr}
941 ; SOFT-NEXT: push {r4, r5, r6, r7, r8, lr}
942 ; SOFT-NEXT: ldr r3, .LCPI11_0
943 ; SOFT-NEXT: mov r2, #0
944 ; SOFT-NEXT: mov r4, r1
945 ; SOFT-NEXT: mov r5, r0
946 ; SOFT-NEXT: bl __aeabi_dcmpgt
947 ; SOFT-NEXT: mov r3, #6291456
948 ; SOFT-NEXT: mov r8, r0
949 ; SOFT-NEXT: orr r3, r3, #-1073741824
950 ; SOFT-NEXT: mov r0, r5
951 ; SOFT-NEXT: mov r1, r4
952 ; SOFT-NEXT: mov r2, #0
953 ; SOFT-NEXT: bl __aeabi_dcmpge
954 ; SOFT-NEXT: mov r7, r0
955 ; SOFT-NEXT: mov r0, r5
956 ; SOFT-NEXT: mov r1, r4
957 ; SOFT-NEXT: bl __aeabi_d2iz
958 ; SOFT-NEXT: mov r6, r0
959 ; SOFT-NEXT: cmp r7, #0
960 ; SOFT-NEXT: mvneq r6, #127
961 ; SOFT-NEXT: cmp r8, #0
962 ; SOFT-NEXT: mov r0, r5
963 ; SOFT-NEXT: mov r1, r4
964 ; SOFT-NEXT: mov r2, r5
965 ; SOFT-NEXT: mov r3, r4
966 ; SOFT-NEXT: movne r6, #127
967 ; SOFT-NEXT: bl __aeabi_dcmpun
968 ; SOFT-NEXT: cmp r0, #0
969 ; SOFT-NEXT: movne r6, #0
970 ; SOFT-NEXT: mov r0, r6
971 ; SOFT-NEXT: pop {r4, r5, r6, r7, r8, lr}
972 ; SOFT-NEXT: mov pc, lr
973 ; SOFT-NEXT: .p2align 2
974 ; SOFT-NEXT: @ %bb.1:
975 ; SOFT-NEXT: .LCPI11_0:
976 ; SOFT-NEXT: .long 1080016896 @ 0x405fc000
978 ; VFP2-LABEL: test_signed_i8_f64:
980 ; VFP2-NEXT: vldr d2, .LCPI11_0
981 ; VFP2-NEXT: vmov d0, r0, r1
982 ; VFP2-NEXT: vldr d3, .LCPI11_1
983 ; VFP2-NEXT: vcmp.f64 d0, d2
984 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
985 ; VFP2-NEXT: vcvt.s32.f64 s2, d0
986 ; VFP2-NEXT: vcmp.f64 d0, d3
987 ; VFP2-NEXT: vmov r0, s2
988 ; VFP2-NEXT: mvnlt r0, #127
989 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
990 ; VFP2-NEXT: vcmp.f64 d0, d0
991 ; VFP2-NEXT: movgt r0, #127
992 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
993 ; VFP2-NEXT: movvs r0, #0
994 ; VFP2-NEXT: mov pc, lr
995 ; VFP2-NEXT: .p2align 3
996 ; VFP2-NEXT: @ %bb.1:
997 ; VFP2-NEXT: .LCPI11_0:
998 ; VFP2-NEXT: .long 0 @ double -128
999 ; VFP2-NEXT: .long 3227516928
1000 ; VFP2-NEXT: .LCPI11_1:
1001 ; VFP2-NEXT: .long 0 @ double 127
1002 ; VFP2-NEXT: .long 1080016896
1003 %x = call i8 @llvm.fptosi.sat.i8.f64(double %f)
1007 define i13 @test_signed_i13_f64(double %f) nounwind {
1008 ; SOFT-LABEL: test_signed_i13_f64:
1010 ; SOFT-NEXT: .save {r4, r5, r6, r7, r8, lr}
1011 ; SOFT-NEXT: push {r4, r5, r6, r7, r8, lr}
1012 ; SOFT-NEXT: ldr r3, .LCPI12_0
1013 ; SOFT-NEXT: mov r2, #0
1014 ; SOFT-NEXT: mov r4, r1
1015 ; SOFT-NEXT: mov r5, r0
1016 ; SOFT-NEXT: bl __aeabi_dcmpgt
1017 ; SOFT-NEXT: mov r3, #11534336
1018 ; SOFT-NEXT: mov r8, r0
1019 ; SOFT-NEXT: orr r3, r3, #-1073741824
1020 ; SOFT-NEXT: mov r0, r5
1021 ; SOFT-NEXT: mov r1, r4
1022 ; SOFT-NEXT: mov r2, #0
1023 ; SOFT-NEXT: bl __aeabi_dcmpge
1024 ; SOFT-NEXT: mov r7, r0
1025 ; SOFT-NEXT: mov r0, r5
1026 ; SOFT-NEXT: mov r1, r4
1027 ; SOFT-NEXT: bl __aeabi_d2iz
1028 ; SOFT-NEXT: mov r6, r0
1029 ; SOFT-NEXT: ldr r0, .LCPI12_1
1030 ; SOFT-NEXT: cmp r7, #0
1031 ; SOFT-NEXT: mov r1, r4
1032 ; SOFT-NEXT: mov r2, r5
1033 ; SOFT-NEXT: mov r3, r4
1034 ; SOFT-NEXT: moveq r6, r0
1035 ; SOFT-NEXT: mov r0, #255
1036 ; SOFT-NEXT: orr r0, r0, #3840
1037 ; SOFT-NEXT: cmp r8, #0
1038 ; SOFT-NEXT: movne r6, r0
1039 ; SOFT-NEXT: mov r0, r5
1040 ; SOFT-NEXT: bl __aeabi_dcmpun
1041 ; SOFT-NEXT: cmp r0, #0
1042 ; SOFT-NEXT: movne r6, #0
1043 ; SOFT-NEXT: mov r0, r6
1044 ; SOFT-NEXT: pop {r4, r5, r6, r7, r8, lr}
1045 ; SOFT-NEXT: mov pc, lr
1046 ; SOFT-NEXT: .p2align 2
1047 ; SOFT-NEXT: @ %bb.1:
1048 ; SOFT-NEXT: .LCPI12_0:
1049 ; SOFT-NEXT: .long 1085275648 @ 0x40affe00
1050 ; SOFT-NEXT: .LCPI12_1:
1051 ; SOFT-NEXT: .long 4294963200 @ 0xfffff000
1053 ; VFP2-LABEL: test_signed_i13_f64:
1055 ; VFP2-NEXT: vldr d2, .LCPI12_0
1056 ; VFP2-NEXT: vmov d0, r0, r1
1057 ; VFP2-NEXT: vldr d3, .LCPI12_1
1058 ; VFP2-NEXT: vcmp.f64 d0, d2
1059 ; VFP2-NEXT: ldr r0, .LCPI12_2
1060 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1061 ; VFP2-NEXT: vcvt.s32.f64 s2, d0
1062 ; VFP2-NEXT: vcmp.f64 d0, d3
1063 ; VFP2-NEXT: vmov r1, s2
1064 ; VFP2-NEXT: movlt r1, r0
1065 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1066 ; VFP2-NEXT: vcmp.f64 d0, d0
1067 ; VFP2-NEXT: mov r0, #255
1068 ; VFP2-NEXT: orr r0, r0, #3840
1069 ; VFP2-NEXT: movle r0, r1
1070 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1071 ; VFP2-NEXT: movvs r0, #0
1072 ; VFP2-NEXT: mov pc, lr
1073 ; VFP2-NEXT: .p2align 3
1074 ; VFP2-NEXT: @ %bb.1:
1075 ; VFP2-NEXT: .LCPI12_0:
1076 ; VFP2-NEXT: .long 0 @ double -4096
1077 ; VFP2-NEXT: .long 3232759808
1078 ; VFP2-NEXT: .LCPI12_1:
1079 ; VFP2-NEXT: .long 0 @ double 4095
1080 ; VFP2-NEXT: .long 1085275648
1081 ; VFP2-NEXT: .LCPI12_2:
1082 ; VFP2-NEXT: .long 4294963200 @ 0xfffff000
1083 %x = call i13 @llvm.fptosi.sat.i13.f64(double %f)
1087 define i16 @test_signed_i16_f64(double %f) nounwind {
1088 ; SOFT-LABEL: test_signed_i16_f64:
1090 ; SOFT-NEXT: .save {r4, r5, r6, r7, r8, lr}
1091 ; SOFT-NEXT: push {r4, r5, r6, r7, r8, lr}
1092 ; SOFT-NEXT: ldr r3, .LCPI13_0
1093 ; SOFT-NEXT: mov r2, #0
1094 ; SOFT-NEXT: mov r4, r1
1095 ; SOFT-NEXT: mov r5, r0
1096 ; SOFT-NEXT: bl __aeabi_dcmpgt
1097 ; SOFT-NEXT: mov r3, #14680064
1098 ; SOFT-NEXT: mov r8, r0
1099 ; SOFT-NEXT: orr r3, r3, #-1073741824
1100 ; SOFT-NEXT: mov r0, r5
1101 ; SOFT-NEXT: mov r1, r4
1102 ; SOFT-NEXT: mov r2, #0
1103 ; SOFT-NEXT: bl __aeabi_dcmpge
1104 ; SOFT-NEXT: mov r7, r0
1105 ; SOFT-NEXT: mov r0, r5
1106 ; SOFT-NEXT: mov r1, r4
1107 ; SOFT-NEXT: bl __aeabi_d2iz
1108 ; SOFT-NEXT: mov r6, r0
1109 ; SOFT-NEXT: ldr r0, .LCPI13_1
1110 ; SOFT-NEXT: cmp r7, #0
1111 ; SOFT-NEXT: mov r1, r4
1112 ; SOFT-NEXT: mov r2, r5
1113 ; SOFT-NEXT: mov r3, r4
1114 ; SOFT-NEXT: moveq r6, r0
1115 ; SOFT-NEXT: mov r0, #255
1116 ; SOFT-NEXT: orr r0, r0, #32512
1117 ; SOFT-NEXT: cmp r8, #0
1118 ; SOFT-NEXT: movne r6, r0
1119 ; SOFT-NEXT: mov r0, r5
1120 ; SOFT-NEXT: bl __aeabi_dcmpun
1121 ; SOFT-NEXT: cmp r0, #0
1122 ; SOFT-NEXT: movne r6, #0
1123 ; SOFT-NEXT: mov r0, r6
1124 ; SOFT-NEXT: pop {r4, r5, r6, r7, r8, lr}
1125 ; SOFT-NEXT: mov pc, lr
1126 ; SOFT-NEXT: .p2align 2
1127 ; SOFT-NEXT: @ %bb.1:
1128 ; SOFT-NEXT: .LCPI13_0:
1129 ; SOFT-NEXT: .long 1088421824 @ 0x40dfffc0
1130 ; SOFT-NEXT: .LCPI13_1:
1131 ; SOFT-NEXT: .long 4294934528 @ 0xffff8000
1133 ; VFP2-LABEL: test_signed_i16_f64:
1135 ; VFP2-NEXT: vldr d2, .LCPI13_0
1136 ; VFP2-NEXT: vmov d0, r0, r1
1137 ; VFP2-NEXT: vldr d3, .LCPI13_1
1138 ; VFP2-NEXT: vcmp.f64 d0, d2
1139 ; VFP2-NEXT: ldr r0, .LCPI13_2
1140 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1141 ; VFP2-NEXT: vcvt.s32.f64 s2, d0
1142 ; VFP2-NEXT: vcmp.f64 d0, d3
1143 ; VFP2-NEXT: vmov r1, s2
1144 ; VFP2-NEXT: movlt r1, r0
1145 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1146 ; VFP2-NEXT: vcmp.f64 d0, d0
1147 ; VFP2-NEXT: mov r0, #255
1148 ; VFP2-NEXT: orr r0, r0, #32512
1149 ; VFP2-NEXT: movle r0, r1
1150 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1151 ; VFP2-NEXT: movvs r0, #0
1152 ; VFP2-NEXT: mov pc, lr
1153 ; VFP2-NEXT: .p2align 3
1154 ; VFP2-NEXT: @ %bb.1:
1155 ; VFP2-NEXT: .LCPI13_0:
1156 ; VFP2-NEXT: .long 0 @ double -32768
1157 ; VFP2-NEXT: .long 3235905536
1158 ; VFP2-NEXT: .LCPI13_1:
1159 ; VFP2-NEXT: .long 0 @ double 32767
1160 ; VFP2-NEXT: .long 1088421824
1161 ; VFP2-NEXT: .LCPI13_2:
1162 ; VFP2-NEXT: .long 4294934528 @ 0xffff8000
1163 %x = call i16 @llvm.fptosi.sat.i16.f64(double %f)
1167 define i19 @test_signed_i19_f64(double %f) nounwind {
1168 ; SOFT-LABEL: test_signed_i19_f64:
1170 ; SOFT-NEXT: .save {r4, r5, r6, r7, r8, lr}
1171 ; SOFT-NEXT: push {r4, r5, r6, r7, r8, lr}
1172 ; SOFT-NEXT: ldr r3, .LCPI14_0
1173 ; SOFT-NEXT: mov r2, #0
1174 ; SOFT-NEXT: mov r4, r1
1175 ; SOFT-NEXT: mov r5, r0
1176 ; SOFT-NEXT: bl __aeabi_dcmpgt
1177 ; SOFT-NEXT: mov r3, #17825792
1178 ; SOFT-NEXT: mov r8, r0
1179 ; SOFT-NEXT: orr r3, r3, #-1073741824
1180 ; SOFT-NEXT: mov r0, r5
1181 ; SOFT-NEXT: mov r1, r4
1182 ; SOFT-NEXT: mov r2, #0
1183 ; SOFT-NEXT: bl __aeabi_dcmpge
1184 ; SOFT-NEXT: mov r7, r0
1185 ; SOFT-NEXT: mov r0, r5
1186 ; SOFT-NEXT: mov r1, r4
1187 ; SOFT-NEXT: bl __aeabi_d2iz
1188 ; SOFT-NEXT: mov r6, r0
1189 ; SOFT-NEXT: mov r0, #66846720
1190 ; SOFT-NEXT: orr r0, r0, #-67108864
1191 ; SOFT-NEXT: cmp r7, #0
1192 ; SOFT-NEXT: mov r1, r4
1193 ; SOFT-NEXT: mov r2, r5
1194 ; SOFT-NEXT: moveq r6, r0
1195 ; SOFT-NEXT: ldr r0, .LCPI14_1
1196 ; SOFT-NEXT: cmp r8, #0
1197 ; SOFT-NEXT: mov r3, r4
1198 ; SOFT-NEXT: movne r6, r0
1199 ; SOFT-NEXT: mov r0, r5
1200 ; SOFT-NEXT: bl __aeabi_dcmpun
1201 ; SOFT-NEXT: cmp r0, #0
1202 ; SOFT-NEXT: movne r6, #0
1203 ; SOFT-NEXT: mov r0, r6
1204 ; SOFT-NEXT: pop {r4, r5, r6, r7, r8, lr}
1205 ; SOFT-NEXT: mov pc, lr
1206 ; SOFT-NEXT: .p2align 2
1207 ; SOFT-NEXT: @ %bb.1:
1208 ; SOFT-NEXT: .LCPI14_0:
1209 ; SOFT-NEXT: .long 1091567608 @ 0x410ffff8
1210 ; SOFT-NEXT: .LCPI14_1:
1211 ; SOFT-NEXT: .long 262143 @ 0x3ffff
1213 ; VFP2-LABEL: test_signed_i19_f64:
1215 ; VFP2-NEXT: vmov d0, r0, r1
1216 ; VFP2-NEXT: vldr d3, .LCPI14_2
1217 ; VFP2-NEXT: vldr d2, .LCPI14_0
1218 ; VFP2-NEXT: mov r0, #66846720
1219 ; VFP2-NEXT: vcvt.s32.f64 s2, d0
1220 ; VFP2-NEXT: orr r0, r0, #-67108864
1221 ; VFP2-NEXT: ldr r1, .LCPI14_1
1222 ; VFP2-NEXT: vcmp.f64 d0, d3
1223 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1224 ; VFP2-NEXT: vmov r2, s2
1225 ; VFP2-NEXT: vcmp.f64 d0, d2
1226 ; VFP2-NEXT: movge r0, r2
1227 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1228 ; VFP2-NEXT: vcmp.f64 d0, d0
1229 ; VFP2-NEXT: movgt r0, r1
1230 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1231 ; VFP2-NEXT: movvs r0, #0
1232 ; VFP2-NEXT: mov pc, lr
1233 ; VFP2-NEXT: .p2align 3
1234 ; VFP2-NEXT: @ %bb.1:
1235 ; VFP2-NEXT: .LCPI14_0:
1236 ; VFP2-NEXT: .long 0 @ double 262143
1237 ; VFP2-NEXT: .long 1091567608
1238 ; VFP2-NEXT: .LCPI14_2:
1239 ; VFP2-NEXT: .long 0 @ double -262144
1240 ; VFP2-NEXT: .long 3239051264
1241 ; VFP2-NEXT: .LCPI14_1:
1242 ; VFP2-NEXT: .long 262143 @ 0x3ffff
1243 %x = call i19 @llvm.fptosi.sat.i19.f64(double %f)
1247 define i32 @test_signed_i32_f64(double %f) nounwind {
1248 ; SOFT-LABEL: test_signed_i32_f64:
1250 ; SOFT-NEXT: .save {r4, r5, r6, r7, r8, lr}
1251 ; SOFT-NEXT: push {r4, r5, r6, r7, r8, lr}
1252 ; SOFT-NEXT: mov r2, #1069547520
1253 ; SOFT-NEXT: ldr r3, .LCPI15_0
1254 ; SOFT-NEXT: orr r2, r2, #-1073741824
1255 ; SOFT-NEXT: mov r4, r1
1256 ; SOFT-NEXT: mov r5, r0
1257 ; SOFT-NEXT: bl __aeabi_dcmpgt
1258 ; SOFT-NEXT: mov r3, #31457280
1259 ; SOFT-NEXT: mov r8, r0
1260 ; SOFT-NEXT: orr r3, r3, #-1073741824
1261 ; SOFT-NEXT: mov r0, r5
1262 ; SOFT-NEXT: mov r1, r4
1263 ; SOFT-NEXT: mov r2, #0
1264 ; SOFT-NEXT: bl __aeabi_dcmpge
1265 ; SOFT-NEXT: mov r7, r0
1266 ; SOFT-NEXT: mov r0, r5
1267 ; SOFT-NEXT: mov r1, r4
1268 ; SOFT-NEXT: bl __aeabi_d2iz
1269 ; SOFT-NEXT: mov r6, r0
1270 ; SOFT-NEXT: cmp r7, #0
1271 ; SOFT-NEXT: moveq r6, #-2147483648
1272 ; SOFT-NEXT: cmp r8, #0
1273 ; SOFT-NEXT: mov r0, r5
1274 ; SOFT-NEXT: mov r1, r4
1275 ; SOFT-NEXT: mov r2, r5
1276 ; SOFT-NEXT: mov r3, r4
1277 ; SOFT-NEXT: mvnne r6, #-2147483648
1278 ; SOFT-NEXT: bl __aeabi_dcmpun
1279 ; SOFT-NEXT: cmp r0, #0
1280 ; SOFT-NEXT: movne r6, #0
1281 ; SOFT-NEXT: mov r0, r6
1282 ; SOFT-NEXT: pop {r4, r5, r6, r7, r8, lr}
1283 ; SOFT-NEXT: mov pc, lr
1284 ; SOFT-NEXT: .p2align 2
1285 ; SOFT-NEXT: @ %bb.1:
1286 ; SOFT-NEXT: .LCPI15_0:
1287 ; SOFT-NEXT: .long 1105199103 @ 0x41dfffff
1289 ; VFP2-LABEL: test_signed_i32_f64:
1291 ; VFP2-NEXT: vldr d2, .LCPI15_0
1292 ; VFP2-NEXT: vmov d0, r0, r1
1293 ; VFP2-NEXT: vldr d3, .LCPI15_1
1294 ; VFP2-NEXT: vcmp.f64 d0, d2
1295 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1296 ; VFP2-NEXT: vcvt.s32.f64 s2, d0
1297 ; VFP2-NEXT: vcmp.f64 d0, d3
1298 ; VFP2-NEXT: vmov r0, s2
1299 ; VFP2-NEXT: movlt r0, #-2147483648
1300 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1301 ; VFP2-NEXT: vcmp.f64 d0, d0
1302 ; VFP2-NEXT: mvngt r0, #-2147483648
1303 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1304 ; VFP2-NEXT: movvs r0, #0
1305 ; VFP2-NEXT: mov pc, lr
1306 ; VFP2-NEXT: .p2align 3
1307 ; VFP2-NEXT: @ %bb.1:
1308 ; VFP2-NEXT: .LCPI15_0:
1309 ; VFP2-NEXT: .long 0 @ double -2147483648
1310 ; VFP2-NEXT: .long 3252682752
1311 ; VFP2-NEXT: .LCPI15_1:
1312 ; VFP2-NEXT: .long 4290772992 @ double 2147483647
1313 ; VFP2-NEXT: .long 1105199103
1314 %x = call i32 @llvm.fptosi.sat.i32.f64(double %f)
1318 define i50 @test_signed_i50_f64(double %f) nounwind {
1319 ; SOFT-LABEL: test_signed_i50_f64:
1321 ; SOFT-NEXT: .save {r4, r5, r6, r7, r8, r9, r11, lr}
1322 ; SOFT-NEXT: push {r4, r5, r6, r7, r8, r9, r11, lr}
1323 ; SOFT-NEXT: mvn r2, #15
1324 ; SOFT-NEXT: mvn r3, #-1124073472
1325 ; SOFT-NEXT: mov r4, r1
1326 ; SOFT-NEXT: mov r5, r0
1327 ; SOFT-NEXT: bl __aeabi_dcmpgt
1328 ; SOFT-NEXT: mov r8, r0
1329 ; SOFT-NEXT: mov r0, r5
1330 ; SOFT-NEXT: mov r1, r4
1331 ; SOFT-NEXT: mov r2, #0
1332 ; SOFT-NEXT: mov r3, #-1023410176
1333 ; SOFT-NEXT: bl __aeabi_dcmpge
1334 ; SOFT-NEXT: mov r9, r0
1335 ; SOFT-NEXT: mov r0, r5
1336 ; SOFT-NEXT: mov r1, r4
1337 ; SOFT-NEXT: bl __aeabi_d2lz
1338 ; SOFT-NEXT: mov r6, r0
1339 ; SOFT-NEXT: cmp r9, #0
1340 ; SOFT-NEXT: mov r7, r1
1341 ; SOFT-NEXT: moveq r6, r9
1342 ; SOFT-NEXT: cmp r8, #0
1343 ; SOFT-NEXT: mov r0, r5
1344 ; SOFT-NEXT: mov r1, r4
1345 ; SOFT-NEXT: mov r2, r5
1346 ; SOFT-NEXT: mov r3, r4
1347 ; SOFT-NEXT: mvnne r6, #0
1348 ; SOFT-NEXT: bl __aeabi_dcmpun
1349 ; SOFT-NEXT: cmp r0, #0
1350 ; SOFT-NEXT: mov r0, r5
1351 ; SOFT-NEXT: mov r1, r4
1352 ; SOFT-NEXT: mvn r2, #15
1353 ; SOFT-NEXT: mvn r3, #-1124073472
1354 ; SOFT-NEXT: movne r6, #0
1355 ; SOFT-NEXT: bl __aeabi_dcmpgt
1356 ; SOFT-NEXT: mov r8, r0
1357 ; SOFT-NEXT: mov r0, r5
1358 ; SOFT-NEXT: mov r1, r4
1359 ; SOFT-NEXT: mov r2, #0
1360 ; SOFT-NEXT: mov r3, #-1023410176
1361 ; SOFT-NEXT: bl __aeabi_dcmpge
1362 ; SOFT-NEXT: mov r1, #16646144
1363 ; SOFT-NEXT: cmp r0, #0
1364 ; SOFT-NEXT: orr r1, r1, #-16777216
1365 ; SOFT-NEXT: ldr r0, .LCPI16_0
1366 ; SOFT-NEXT: mov r2, r5
1367 ; SOFT-NEXT: mov r3, r4
1368 ; SOFT-NEXT: moveq r7, r1
1369 ; SOFT-NEXT: cmp r8, #0
1370 ; SOFT-NEXT: movne r7, r0
1371 ; SOFT-NEXT: mov r0, r5
1372 ; SOFT-NEXT: mov r1, r4
1373 ; SOFT-NEXT: bl __aeabi_dcmpun
1374 ; SOFT-NEXT: cmp r0, #0
1375 ; SOFT-NEXT: mov r0, r6
1376 ; SOFT-NEXT: movne r7, #0
1377 ; SOFT-NEXT: mov r1, r7
1378 ; SOFT-NEXT: pop {r4, r5, r6, r7, r8, r9, r11, lr}
1379 ; SOFT-NEXT: mov pc, lr
1380 ; SOFT-NEXT: .p2align 2
1381 ; SOFT-NEXT: @ %bb.1:
1382 ; SOFT-NEXT: .LCPI16_0:
1383 ; SOFT-NEXT: .long 131071 @ 0x1ffff
1385 ; VFP2-LABEL: test_signed_i50_f64:
1387 ; VFP2-NEXT: .save {r4, r5, r11, lr}
1388 ; VFP2-NEXT: push {r4, r5, r11, lr}
1389 ; VFP2-NEXT: mov r4, r1
1390 ; VFP2-NEXT: mov r5, r0
1391 ; VFP2-NEXT: bl __aeabi_d2lz
1392 ; VFP2-NEXT: vldr d0, .LCPI16_0
1393 ; VFP2-NEXT: vmov d2, r5, r4
1394 ; VFP2-NEXT: vldr d1, .LCPI16_1
1395 ; VFP2-NEXT: mov r2, #16646144
1396 ; VFP2-NEXT: vcmp.f64 d2, d0
1397 ; VFP2-NEXT: orr r2, r2, #-16777216
1398 ; VFP2-NEXT: ldr r3, .LCPI16_2
1399 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1400 ; VFP2-NEXT: vcmp.f64 d2, d1
1401 ; VFP2-NEXT: movlt r1, r2
1402 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1403 ; VFP2-NEXT: vcmp.f64 d2, d2
1404 ; VFP2-NEXT: movgt r1, r3
1405 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1406 ; VFP2-NEXT: vcmp.f64 d2, d0
1407 ; VFP2-NEXT: movvs r1, #0
1408 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1409 ; VFP2-NEXT: vcmp.f64 d2, d1
1410 ; VFP2-NEXT: movlt r0, #0
1411 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1412 ; VFP2-NEXT: vcmp.f64 d2, d2
1413 ; VFP2-NEXT: mvngt r0, #0
1414 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1415 ; VFP2-NEXT: movvs r0, #0
1416 ; VFP2-NEXT: pop {r4, r5, r11, lr}
1417 ; VFP2-NEXT: mov pc, lr
1418 ; VFP2-NEXT: .p2align 3
1419 ; VFP2-NEXT: @ %bb.1:
1420 ; VFP2-NEXT: .LCPI16_0:
1421 ; VFP2-NEXT: .long 0 @ double -562949953421312
1422 ; VFP2-NEXT: .long 3271557120
1423 ; VFP2-NEXT: .LCPI16_1:
1424 ; VFP2-NEXT: .long 4294967280 @ double 562949953421311
1425 ; VFP2-NEXT: .long 1124073471
1426 ; VFP2-NEXT: .LCPI16_2:
1427 ; VFP2-NEXT: .long 131071 @ 0x1ffff
1428 %x = call i50 @llvm.fptosi.sat.i50.f64(double %f)
1432 define i64 @test_signed_i64_f64(double %f) nounwind {
1433 ; SOFT-LABEL: test_signed_i64_f64:
1435 ; SOFT-NEXT: .save {r4, r5, r6, r7, r8, r9, r10, r11, lr}
1436 ; SOFT-NEXT: push {r4, r5, r6, r7, r8, r9, r10, r11, lr}
1437 ; SOFT-NEXT: .pad #4
1438 ; SOFT-NEXT: sub sp, sp, #4
1439 ; SOFT-NEXT: ldr r8, .LCPI17_0
1440 ; SOFT-NEXT: mvn r2, #0
1441 ; SOFT-NEXT: mov r4, r1
1442 ; SOFT-NEXT: mov r5, r0
1443 ; SOFT-NEXT: mov r3, r8
1444 ; SOFT-NEXT: bl __aeabi_dcmpgt
1445 ; SOFT-NEXT: mov r9, #65011712
1446 ; SOFT-NEXT: mov r10, r0
1447 ; SOFT-NEXT: orr r9, r9, #-1073741824
1448 ; SOFT-NEXT: mov r0, r5
1449 ; SOFT-NEXT: mov r1, r4
1450 ; SOFT-NEXT: mov r2, #0
1451 ; SOFT-NEXT: mov r3, r9
1452 ; SOFT-NEXT: bl __aeabi_dcmpge
1453 ; SOFT-NEXT: mov r11, r0
1454 ; SOFT-NEXT: mov r0, r5
1455 ; SOFT-NEXT: mov r1, r4
1456 ; SOFT-NEXT: bl __aeabi_d2lz
1457 ; SOFT-NEXT: mov r6, r0
1458 ; SOFT-NEXT: cmp r11, #0
1459 ; SOFT-NEXT: mov r7, r1
1460 ; SOFT-NEXT: moveq r6, r11
1461 ; SOFT-NEXT: cmp r10, #0
1462 ; SOFT-NEXT: mov r0, r5
1463 ; SOFT-NEXT: mov r1, r4
1464 ; SOFT-NEXT: mov r2, r5
1465 ; SOFT-NEXT: mov r3, r4
1466 ; SOFT-NEXT: mvnne r6, #0
1467 ; SOFT-NEXT: bl __aeabi_dcmpun
1468 ; SOFT-NEXT: cmp r0, #0
1469 ; SOFT-NEXT: mov r0, r5
1470 ; SOFT-NEXT: mov r1, r4
1471 ; SOFT-NEXT: mvn r2, #0
1472 ; SOFT-NEXT: mov r3, r8
1473 ; SOFT-NEXT: movne r6, #0
1474 ; SOFT-NEXT: bl __aeabi_dcmpgt
1475 ; SOFT-NEXT: mov r8, r0
1476 ; SOFT-NEXT: mov r0, r5
1477 ; SOFT-NEXT: mov r1, r4
1478 ; SOFT-NEXT: mov r2, #0
1479 ; SOFT-NEXT: mov r3, r9
1480 ; SOFT-NEXT: bl __aeabi_dcmpge
1481 ; SOFT-NEXT: cmp r0, #0
1482 ; SOFT-NEXT: mov r0, r5
1483 ; SOFT-NEXT: moveq r7, #-2147483648
1484 ; SOFT-NEXT: cmp r8, #0
1485 ; SOFT-NEXT: mov r1, r4
1486 ; SOFT-NEXT: mov r2, r5
1487 ; SOFT-NEXT: mov r3, r4
1488 ; SOFT-NEXT: mvnne r7, #-2147483648
1489 ; SOFT-NEXT: bl __aeabi_dcmpun
1490 ; SOFT-NEXT: cmp r0, #0
1491 ; SOFT-NEXT: mov r0, r6
1492 ; SOFT-NEXT: movne r7, #0
1493 ; SOFT-NEXT: mov r1, r7
1494 ; SOFT-NEXT: add sp, sp, #4
1495 ; SOFT-NEXT: pop {r4, r5, r6, r7, r8, r9, r10, r11, lr}
1496 ; SOFT-NEXT: mov pc, lr
1497 ; SOFT-NEXT: .p2align 2
1498 ; SOFT-NEXT: @ %bb.1:
1499 ; SOFT-NEXT: .LCPI17_0:
1500 ; SOFT-NEXT: .long 1138753535 @ 0x43dfffff
1502 ; VFP2-LABEL: test_signed_i64_f64:
1504 ; VFP2-NEXT: .save {r4, r5, r11, lr}
1505 ; VFP2-NEXT: push {r4, r5, r11, lr}
1506 ; VFP2-NEXT: mov r4, r1
1507 ; VFP2-NEXT: mov r5, r0
1508 ; VFP2-NEXT: bl __aeabi_d2lz
1509 ; VFP2-NEXT: vldr d0, .LCPI17_0
1510 ; VFP2-NEXT: vmov d1, r5, r4
1511 ; VFP2-NEXT: vldr d2, .LCPI17_1
1512 ; VFP2-NEXT: vcmp.f64 d1, d0
1513 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1514 ; VFP2-NEXT: vcmp.f64 d1, d2
1515 ; VFP2-NEXT: movlt r0, #0
1516 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1517 ; VFP2-NEXT: vcmp.f64 d1, d1
1518 ; VFP2-NEXT: mvngt r0, #0
1519 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1520 ; VFP2-NEXT: vcmp.f64 d1, d0
1521 ; VFP2-NEXT: movvs r0, #0
1522 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1523 ; VFP2-NEXT: vcmp.f64 d1, d2
1524 ; VFP2-NEXT: movlt r1, #-2147483648
1525 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1526 ; VFP2-NEXT: vcmp.f64 d1, d1
1527 ; VFP2-NEXT: mvngt r1, #-2147483648
1528 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1529 ; VFP2-NEXT: movvs r1, #0
1530 ; VFP2-NEXT: pop {r4, r5, r11, lr}
1531 ; VFP2-NEXT: mov pc, lr
1532 ; VFP2-NEXT: .p2align 3
1533 ; VFP2-NEXT: @ %bb.1:
1534 ; VFP2-NEXT: .LCPI17_0:
1535 ; VFP2-NEXT: .long 0 @ double -9.2233720368547758E+18
1536 ; VFP2-NEXT: .long 3286237184
1537 ; VFP2-NEXT: .LCPI17_1:
1538 ; VFP2-NEXT: .long 4294967295 @ double 9.2233720368547748E+18
1539 ; VFP2-NEXT: .long 1138753535
1540 %x = call i64 @llvm.fptosi.sat.i64.f64(double %f)
1544 define i100 @test_signed_i100_f64(double %f) nounwind {
1545 ; SOFT-LABEL: test_signed_i100_f64:
1547 ; SOFT-NEXT: .save {r4, r5, r6, r7, r8, r9, r10, r11, lr}
1548 ; SOFT-NEXT: push {r4, r5, r6, r7, r8, r9, r10, r11, lr}
1549 ; SOFT-NEXT: .pad #4
1550 ; SOFT-NEXT: sub sp, sp, #4
1551 ; SOFT-NEXT: ldr r3, .LCPI18_0
1552 ; SOFT-NEXT: mvn r2, #0
1553 ; SOFT-NEXT: mov r4, r1
1554 ; SOFT-NEXT: mov r5, r0
1555 ; SOFT-NEXT: bl __aeabi_dcmpgt
1556 ; SOFT-NEXT: mov r3, #102760448
1557 ; SOFT-NEXT: mov r10, r0
1558 ; SOFT-NEXT: orr r3, r3, #-1073741824
1559 ; SOFT-NEXT: mov r0, r5
1560 ; SOFT-NEXT: mov r1, r4
1561 ; SOFT-NEXT: mov r2, #0
1562 ; SOFT-NEXT: bl __aeabi_dcmpge
1563 ; SOFT-NEXT: mov r11, r0
1564 ; SOFT-NEXT: mov r0, r5
1565 ; SOFT-NEXT: mov r1, r4
1566 ; SOFT-NEXT: bl __fixdfti
1567 ; SOFT-NEXT: mov r6, r0
1568 ; SOFT-NEXT: cmp r11, #0
1569 ; SOFT-NEXT: mov r7, r1
1570 ; SOFT-NEXT: mov r8, r2
1571 ; SOFT-NEXT: mov r9, r3
1572 ; SOFT-NEXT: moveq r6, r11
1573 ; SOFT-NEXT: cmp r10, #0
1574 ; SOFT-NEXT: mov r0, r5
1575 ; SOFT-NEXT: mov r1, r4
1576 ; SOFT-NEXT: mov r2, r5
1577 ; SOFT-NEXT: mov r3, r4
1578 ; SOFT-NEXT: mvnne r6, #0
1579 ; SOFT-NEXT: bl __aeabi_dcmpun
1580 ; SOFT-NEXT: ldr r11, .LCPI18_0
1581 ; SOFT-NEXT: cmp r0, #0
1582 ; SOFT-NEXT: mov r0, r5
1583 ; SOFT-NEXT: mov r1, r4
1584 ; SOFT-NEXT: mvn r2, #0
1585 ; SOFT-NEXT: movne r6, #0
1586 ; SOFT-NEXT: mov r3, r11
1587 ; SOFT-NEXT: bl __aeabi_dcmpgt
1588 ; SOFT-NEXT: mov r3, #102760448
1589 ; SOFT-NEXT: mov r10, r0
1590 ; SOFT-NEXT: orr r3, r3, #-1073741824
1591 ; SOFT-NEXT: mov r0, r5
1592 ; SOFT-NEXT: mov r1, r4
1593 ; SOFT-NEXT: mov r2, #0
1594 ; SOFT-NEXT: bl __aeabi_dcmpge
1595 ; SOFT-NEXT: cmp r0, #0
1596 ; SOFT-NEXT: mov r1, r4
1597 ; SOFT-NEXT: moveq r7, r0
1598 ; SOFT-NEXT: cmp r10, #0
1599 ; SOFT-NEXT: mov r0, r5
1600 ; SOFT-NEXT: mov r2, r5
1601 ; SOFT-NEXT: mov r3, r4
1602 ; SOFT-NEXT: mvnne r7, #0
1603 ; SOFT-NEXT: bl __aeabi_dcmpun
1604 ; SOFT-NEXT: cmp r0, #0
1605 ; SOFT-NEXT: mov r0, r5
1606 ; SOFT-NEXT: mov r1, r4
1607 ; SOFT-NEXT: mvn r2, #0
1608 ; SOFT-NEXT: mov r3, r11
1609 ; SOFT-NEXT: movne r7, #0
1610 ; SOFT-NEXT: bl __aeabi_dcmpgt
1611 ; SOFT-NEXT: mov r3, #102760448
1612 ; SOFT-NEXT: mov r10, r0
1613 ; SOFT-NEXT: orr r3, r3, #-1073741824
1614 ; SOFT-NEXT: mov r0, r5
1615 ; SOFT-NEXT: mov r1, r4
1616 ; SOFT-NEXT: mov r2, #0
1617 ; SOFT-NEXT: bl __aeabi_dcmpge
1618 ; SOFT-NEXT: cmp r0, #0
1619 ; SOFT-NEXT: mov r1, r4
1620 ; SOFT-NEXT: moveq r8, r0
1621 ; SOFT-NEXT: cmp r10, #0
1622 ; SOFT-NEXT: mov r0, r5
1623 ; SOFT-NEXT: mov r2, r5
1624 ; SOFT-NEXT: mov r3, r4
1625 ; SOFT-NEXT: mvnne r8, #0
1626 ; SOFT-NEXT: bl __aeabi_dcmpun
1627 ; SOFT-NEXT: cmp r0, #0
1628 ; SOFT-NEXT: mov r0, r5
1629 ; SOFT-NEXT: mov r1, r4
1630 ; SOFT-NEXT: mvn r2, #0
1631 ; SOFT-NEXT: mov r3, r11
1632 ; SOFT-NEXT: movne r8, #0
1633 ; SOFT-NEXT: bl __aeabi_dcmpgt
1634 ; SOFT-NEXT: mov r3, #102760448
1635 ; SOFT-NEXT: mov r10, r0
1636 ; SOFT-NEXT: orr r3, r3, #-1073741824
1637 ; SOFT-NEXT: mov r0, r5
1638 ; SOFT-NEXT: mov r1, r4
1639 ; SOFT-NEXT: mov r2, #0
1640 ; SOFT-NEXT: bl __aeabi_dcmpge
1641 ; SOFT-NEXT: cmp r0, #0
1642 ; SOFT-NEXT: mov r0, r5
1643 ; SOFT-NEXT: mvneq r9, #7
1644 ; SOFT-NEXT: cmp r10, #0
1645 ; SOFT-NEXT: mov r1, r4
1646 ; SOFT-NEXT: mov r2, r5
1647 ; SOFT-NEXT: mov r3, r4
1648 ; SOFT-NEXT: movne r9, #7
1649 ; SOFT-NEXT: bl __aeabi_dcmpun
1650 ; SOFT-NEXT: cmp r0, #0
1651 ; SOFT-NEXT: mov r0, r6
1652 ; SOFT-NEXT: movne r9, #0
1653 ; SOFT-NEXT: mov r1, r7
1654 ; SOFT-NEXT: mov r2, r8
1655 ; SOFT-NEXT: mov r3, r9
1656 ; SOFT-NEXT: add sp, sp, #4
1657 ; SOFT-NEXT: pop {r4, r5, r6, r7, r8, r9, r10, r11, lr}
1658 ; SOFT-NEXT: mov pc, lr
1659 ; SOFT-NEXT: .p2align 2
1660 ; SOFT-NEXT: @ %bb.1:
1661 ; SOFT-NEXT: .LCPI18_0:
1662 ; SOFT-NEXT: .long 1176502271 @ 0x461fffff
1664 ; VFP2-LABEL: test_signed_i100_f64:
1666 ; VFP2-NEXT: .save {r4, r5, r11, lr}
1667 ; VFP2-NEXT: push {r4, r5, r11, lr}
1668 ; VFP2-NEXT: mov r4, r1
1669 ; VFP2-NEXT: mov r5, r0
1670 ; VFP2-NEXT: bl __fixdfti
1671 ; VFP2-NEXT: vldr d0, .LCPI18_0
1672 ; VFP2-NEXT: vmov d1, r5, r4
1673 ; VFP2-NEXT: vldr d2, .LCPI18_1
1674 ; VFP2-NEXT: vcmp.f64 d1, d0
1675 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1676 ; VFP2-NEXT: vcmp.f64 d1, d2
1677 ; VFP2-NEXT: movlt r0, #0
1678 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1679 ; VFP2-NEXT: vcmp.f64 d1, d1
1680 ; VFP2-NEXT: mvngt r0, #0
1681 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1682 ; VFP2-NEXT: vcmp.f64 d1, d0
1683 ; VFP2-NEXT: movvs r0, #0
1684 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1685 ; VFP2-NEXT: vcmp.f64 d1, d2
1686 ; VFP2-NEXT: movlt r1, #0
1687 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1688 ; VFP2-NEXT: vcmp.f64 d1, d1
1689 ; VFP2-NEXT: mvngt r1, #0
1690 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1691 ; VFP2-NEXT: vcmp.f64 d1, d0
1692 ; VFP2-NEXT: movvs r1, #0
1693 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1694 ; VFP2-NEXT: vcmp.f64 d1, d2
1695 ; VFP2-NEXT: movlt r2, #0
1696 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1697 ; VFP2-NEXT: vcmp.f64 d1, d1
1698 ; VFP2-NEXT: mvngt r2, #0
1699 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1700 ; VFP2-NEXT: vcmp.f64 d1, d0
1701 ; VFP2-NEXT: movvs r2, #0
1702 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1703 ; VFP2-NEXT: vcmp.f64 d1, d2
1704 ; VFP2-NEXT: mvnlt r3, #7
1705 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1706 ; VFP2-NEXT: vcmp.f64 d1, d1
1707 ; VFP2-NEXT: movgt r3, #7
1708 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1709 ; VFP2-NEXT: movvs r3, #0
1710 ; VFP2-NEXT: pop {r4, r5, r11, lr}
1711 ; VFP2-NEXT: mov pc, lr
1712 ; VFP2-NEXT: .p2align 3
1713 ; VFP2-NEXT: @ %bb.1:
1714 ; VFP2-NEXT: .LCPI18_0:
1715 ; VFP2-NEXT: .long 0 @ double -6.338253001141147E+29
1716 ; VFP2-NEXT: .long 3323985920
1717 ; VFP2-NEXT: .LCPI18_1:
1718 ; VFP2-NEXT: .long 4294967295 @ double 6.3382530011411463E+29
1719 ; VFP2-NEXT: .long 1176502271
1720 %x = call i100 @llvm.fptosi.sat.i100.f64(double %f)
1724 define i128 @test_signed_i128_f64(double %f) nounwind {
1725 ; SOFT-LABEL: test_signed_i128_f64:
1727 ; SOFT-NEXT: .save {r4, r5, r6, r7, r8, r9, r10, r11, lr}
1728 ; SOFT-NEXT: push {r4, r5, r6, r7, r8, r9, r10, r11, lr}
1729 ; SOFT-NEXT: .pad #4
1730 ; SOFT-NEXT: sub sp, sp, #4
1731 ; SOFT-NEXT: ldr r3, .LCPI19_0
1732 ; SOFT-NEXT: mvn r2, #0
1733 ; SOFT-NEXT: mov r4, r1
1734 ; SOFT-NEXT: mov r5, r0
1735 ; SOFT-NEXT: bl __aeabi_dcmpgt
1736 ; SOFT-NEXT: mov r3, #132120576
1737 ; SOFT-NEXT: mov r10, r0
1738 ; SOFT-NEXT: orr r3, r3, #-1073741824
1739 ; SOFT-NEXT: mov r0, r5
1740 ; SOFT-NEXT: mov r1, r4
1741 ; SOFT-NEXT: mov r2, #0
1742 ; SOFT-NEXT: bl __aeabi_dcmpge
1743 ; SOFT-NEXT: mov r11, r0
1744 ; SOFT-NEXT: mov r0, r5
1745 ; SOFT-NEXT: mov r1, r4
1746 ; SOFT-NEXT: bl __fixdfti
1747 ; SOFT-NEXT: mov r6, r0
1748 ; SOFT-NEXT: cmp r11, #0
1749 ; SOFT-NEXT: mov r7, r1
1750 ; SOFT-NEXT: mov r8, r2
1751 ; SOFT-NEXT: mov r9, r3
1752 ; SOFT-NEXT: moveq r6, r11
1753 ; SOFT-NEXT: cmp r10, #0
1754 ; SOFT-NEXT: mov r0, r5
1755 ; SOFT-NEXT: mov r1, r4
1756 ; SOFT-NEXT: mov r2, r5
1757 ; SOFT-NEXT: mov r3, r4
1758 ; SOFT-NEXT: mvnne r6, #0
1759 ; SOFT-NEXT: bl __aeabi_dcmpun
1760 ; SOFT-NEXT: ldr r11, .LCPI19_0
1761 ; SOFT-NEXT: cmp r0, #0
1762 ; SOFT-NEXT: mov r0, r5
1763 ; SOFT-NEXT: mov r1, r4
1764 ; SOFT-NEXT: mvn r2, #0
1765 ; SOFT-NEXT: movne r6, #0
1766 ; SOFT-NEXT: mov r3, r11
1767 ; SOFT-NEXT: bl __aeabi_dcmpgt
1768 ; SOFT-NEXT: mov r3, #132120576
1769 ; SOFT-NEXT: mov r10, r0
1770 ; SOFT-NEXT: orr r3, r3, #-1073741824
1771 ; SOFT-NEXT: mov r0, r5
1772 ; SOFT-NEXT: mov r1, r4
1773 ; SOFT-NEXT: mov r2, #0
1774 ; SOFT-NEXT: bl __aeabi_dcmpge
1775 ; SOFT-NEXT: cmp r0, #0
1776 ; SOFT-NEXT: mov r1, r4
1777 ; SOFT-NEXT: moveq r7, r0
1778 ; SOFT-NEXT: cmp r10, #0
1779 ; SOFT-NEXT: mov r0, r5
1780 ; SOFT-NEXT: mov r2, r5
1781 ; SOFT-NEXT: mov r3, r4
1782 ; SOFT-NEXT: mvnne r7, #0
1783 ; SOFT-NEXT: bl __aeabi_dcmpun
1784 ; SOFT-NEXT: cmp r0, #0
1785 ; SOFT-NEXT: mov r0, r5
1786 ; SOFT-NEXT: mov r1, r4
1787 ; SOFT-NEXT: mvn r2, #0
1788 ; SOFT-NEXT: mov r3, r11
1789 ; SOFT-NEXT: movne r7, #0
1790 ; SOFT-NEXT: bl __aeabi_dcmpgt
1791 ; SOFT-NEXT: mov r3, #132120576
1792 ; SOFT-NEXT: mov r10, r0
1793 ; SOFT-NEXT: orr r3, r3, #-1073741824
1794 ; SOFT-NEXT: mov r0, r5
1795 ; SOFT-NEXT: mov r1, r4
1796 ; SOFT-NEXT: mov r2, #0
1797 ; SOFT-NEXT: bl __aeabi_dcmpge
1798 ; SOFT-NEXT: cmp r0, #0
1799 ; SOFT-NEXT: mov r1, r4
1800 ; SOFT-NEXT: moveq r8, r0
1801 ; SOFT-NEXT: cmp r10, #0
1802 ; SOFT-NEXT: mov r0, r5
1803 ; SOFT-NEXT: mov r2, r5
1804 ; SOFT-NEXT: mov r3, r4
1805 ; SOFT-NEXT: mvnne r8, #0
1806 ; SOFT-NEXT: bl __aeabi_dcmpun
1807 ; SOFT-NEXT: cmp r0, #0
1808 ; SOFT-NEXT: mov r0, r5
1809 ; SOFT-NEXT: mov r1, r4
1810 ; SOFT-NEXT: mvn r2, #0
1811 ; SOFT-NEXT: mov r3, r11
1812 ; SOFT-NEXT: movne r8, #0
1813 ; SOFT-NEXT: bl __aeabi_dcmpgt
1814 ; SOFT-NEXT: mov r3, #132120576
1815 ; SOFT-NEXT: mov r10, r0
1816 ; SOFT-NEXT: orr r3, r3, #-1073741824
1817 ; SOFT-NEXT: mov r0, r5
1818 ; SOFT-NEXT: mov r1, r4
1819 ; SOFT-NEXT: mov r2, #0
1820 ; SOFT-NEXT: bl __aeabi_dcmpge
1821 ; SOFT-NEXT: cmp r0, #0
1822 ; SOFT-NEXT: mov r0, r5
1823 ; SOFT-NEXT: moveq r9, #-2147483648
1824 ; SOFT-NEXT: cmp r10, #0
1825 ; SOFT-NEXT: mov r1, r4
1826 ; SOFT-NEXT: mov r2, r5
1827 ; SOFT-NEXT: mov r3, r4
1828 ; SOFT-NEXT: mvnne r9, #-2147483648
1829 ; SOFT-NEXT: bl __aeabi_dcmpun
1830 ; SOFT-NEXT: cmp r0, #0
1831 ; SOFT-NEXT: mov r0, r6
1832 ; SOFT-NEXT: movne r9, #0
1833 ; SOFT-NEXT: mov r1, r7
1834 ; SOFT-NEXT: mov r2, r8
1835 ; SOFT-NEXT: mov r3, r9
1836 ; SOFT-NEXT: add sp, sp, #4
1837 ; SOFT-NEXT: pop {r4, r5, r6, r7, r8, r9, r10, r11, lr}
1838 ; SOFT-NEXT: mov pc, lr
1839 ; SOFT-NEXT: .p2align 2
1840 ; SOFT-NEXT: @ %bb.1:
1841 ; SOFT-NEXT: .LCPI19_0:
1842 ; SOFT-NEXT: .long 1205862399 @ 0x47dfffff
1844 ; VFP2-LABEL: test_signed_i128_f64:
1846 ; VFP2-NEXT: .save {r4, r5, r11, lr}
1847 ; VFP2-NEXT: push {r4, r5, r11, lr}
1848 ; VFP2-NEXT: mov r4, r1
1849 ; VFP2-NEXT: mov r5, r0
1850 ; VFP2-NEXT: bl __fixdfti
1851 ; VFP2-NEXT: vldr d0, .LCPI19_0
1852 ; VFP2-NEXT: vmov d1, r5, r4
1853 ; VFP2-NEXT: vldr d2, .LCPI19_1
1854 ; VFP2-NEXT: vcmp.f64 d1, d0
1855 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1856 ; VFP2-NEXT: vcmp.f64 d1, d2
1857 ; VFP2-NEXT: movlt r0, #0
1858 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1859 ; VFP2-NEXT: vcmp.f64 d1, d1
1860 ; VFP2-NEXT: mvngt r0, #0
1861 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1862 ; VFP2-NEXT: vcmp.f64 d1, d0
1863 ; VFP2-NEXT: movvs r0, #0
1864 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1865 ; VFP2-NEXT: vcmp.f64 d1, d2
1866 ; VFP2-NEXT: movlt r1, #0
1867 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1868 ; VFP2-NEXT: vcmp.f64 d1, d1
1869 ; VFP2-NEXT: mvngt r1, #0
1870 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1871 ; VFP2-NEXT: vcmp.f64 d1, d0
1872 ; VFP2-NEXT: movvs r1, #0
1873 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1874 ; VFP2-NEXT: vcmp.f64 d1, d2
1875 ; VFP2-NEXT: movlt r2, #0
1876 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1877 ; VFP2-NEXT: vcmp.f64 d1, d1
1878 ; VFP2-NEXT: mvngt r2, #0
1879 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1880 ; VFP2-NEXT: vcmp.f64 d1, d0
1881 ; VFP2-NEXT: movvs r2, #0
1882 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1883 ; VFP2-NEXT: vcmp.f64 d1, d2
1884 ; VFP2-NEXT: movlt r3, #-2147483648
1885 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1886 ; VFP2-NEXT: vcmp.f64 d1, d1
1887 ; VFP2-NEXT: mvngt r3, #-2147483648
1888 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1889 ; VFP2-NEXT: movvs r3, #0
1890 ; VFP2-NEXT: pop {r4, r5, r11, lr}
1891 ; VFP2-NEXT: mov pc, lr
1892 ; VFP2-NEXT: .p2align 3
1893 ; VFP2-NEXT: @ %bb.1:
1894 ; VFP2-NEXT: .LCPI19_0:
1895 ; VFP2-NEXT: .long 0 @ double -1.7014118346046923E+38
1896 ; VFP2-NEXT: .long 3353346048
1897 ; VFP2-NEXT: .LCPI19_1:
1898 ; VFP2-NEXT: .long 4294967295 @ double 1.7014118346046921E+38
1899 ; VFP2-NEXT: .long 1205862399
1900 %x = call i128 @llvm.fptosi.sat.i128.f64(double %f)
1905 ; 16-bit float to signed integer
1908 declare i1 @llvm.fptosi.sat.i1.f16 (half)
1909 declare i8 @llvm.fptosi.sat.i8.f16 (half)
1910 declare i13 @llvm.fptosi.sat.i13.f16 (half)
1911 declare i16 @llvm.fptosi.sat.i16.f16 (half)
1912 declare i19 @llvm.fptosi.sat.i19.f16 (half)
1913 declare i32 @llvm.fptosi.sat.i32.f16 (half)
1914 declare i50 @llvm.fptosi.sat.i50.f16 (half)
1915 declare i64 @llvm.fptosi.sat.i64.f16 (half)
1916 declare i100 @llvm.fptosi.sat.i100.f16(half)
1917 declare i128 @llvm.fptosi.sat.i128.f16(half)
1919 define i1 @test_signed_i1_f16(half %f) nounwind {
1920 ; SOFT-LABEL: test_signed_i1_f16:
1922 ; SOFT-NEXT: .save {r4, r5, r6, lr}
1923 ; SOFT-NEXT: push {r4, r5, r6, lr}
1924 ; SOFT-NEXT: mov r1, #255
1925 ; SOFT-NEXT: orr r1, r1, #65280
1926 ; SOFT-NEXT: and r0, r0, r1
1927 ; SOFT-NEXT: bl __aeabi_h2f
1928 ; SOFT-NEXT: mov r1, #1065353216
1929 ; SOFT-NEXT: mov r4, r0
1930 ; SOFT-NEXT: orr r1, r1, #-2147483648
1931 ; SOFT-NEXT: bl __aeabi_fcmpge
1932 ; SOFT-NEXT: mov r5, r0
1933 ; SOFT-NEXT: mov r0, r4
1934 ; SOFT-NEXT: bl __aeabi_f2iz
1935 ; SOFT-NEXT: mov r6, r0
1936 ; SOFT-NEXT: cmp r5, #0
1937 ; SOFT-NEXT: mov r0, r4
1938 ; SOFT-NEXT: mov r1, #0
1939 ; SOFT-NEXT: mvneq r6, #0
1940 ; SOFT-NEXT: bl __aeabi_fcmpgt
1941 ; SOFT-NEXT: cmp r0, #0
1942 ; SOFT-NEXT: mov r0, r4
1943 ; SOFT-NEXT: mov r1, r4
1944 ; SOFT-NEXT: movne r6, #0
1945 ; SOFT-NEXT: bl __aeabi_fcmpun
1946 ; SOFT-NEXT: cmp r0, #0
1947 ; SOFT-NEXT: movne r6, #0
1948 ; SOFT-NEXT: mov r0, r6
1949 ; SOFT-NEXT: pop {r4, r5, r6, lr}
1950 ; SOFT-NEXT: mov pc, lr
1952 ; VFP2-LABEL: test_signed_i1_f16:
1954 ; VFP2-NEXT: .save {r11, lr}
1955 ; VFP2-NEXT: push {r11, lr}
1956 ; VFP2-NEXT: bl __aeabi_h2f
1957 ; VFP2-NEXT: vmov s0, r0
1958 ; VFP2-NEXT: vldr s2, .LCPI20_0
1959 ; VFP2-NEXT: vcmp.f32 s0, s2
1960 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1961 ; VFP2-NEXT: vcvt.s32.f32 s4, s0
1962 ; VFP2-NEXT: vcmp.f32 s0, #0
1963 ; VFP2-NEXT: vmov r0, s4
1964 ; VFP2-NEXT: mvnlt r0, #0
1965 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1966 ; VFP2-NEXT: vcmp.f32 s0, s0
1967 ; VFP2-NEXT: movgt r0, #0
1968 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
1969 ; VFP2-NEXT: movvs r0, #0
1970 ; VFP2-NEXT: pop {r11, lr}
1971 ; VFP2-NEXT: mov pc, lr
1972 ; VFP2-NEXT: .p2align 2
1973 ; VFP2-NEXT: @ %bb.1:
1974 ; VFP2-NEXT: .LCPI20_0:
1975 ; VFP2-NEXT: .long 0xbf800000 @ float -1
1976 %x = call i1 @llvm.fptosi.sat.i1.f16(half %f)
1980 define i8 @test_signed_i8_f16(half %f) nounwind {
1981 ; SOFT-LABEL: test_signed_i8_f16:
1983 ; SOFT-NEXT: .save {r4, r5, r6, lr}
1984 ; SOFT-NEXT: push {r4, r5, r6, lr}
1985 ; SOFT-NEXT: mov r1, #255
1986 ; SOFT-NEXT: orr r1, r1, #65280
1987 ; SOFT-NEXT: and r0, r0, r1
1988 ; SOFT-NEXT: bl __aeabi_h2f
1989 ; SOFT-NEXT: mov r1, #-1023410176
1990 ; SOFT-NEXT: mov r4, r0
1991 ; SOFT-NEXT: bl __aeabi_fcmpge
1992 ; SOFT-NEXT: mov r5, r0
1993 ; SOFT-NEXT: mov r0, r4
1994 ; SOFT-NEXT: bl __aeabi_f2iz
1995 ; SOFT-NEXT: mov r1, #16646144
1996 ; SOFT-NEXT: mov r6, r0
1997 ; SOFT-NEXT: orr r1, r1, #1107296256
1998 ; SOFT-NEXT: cmp r5, #0
1999 ; SOFT-NEXT: mov r0, r4
2000 ; SOFT-NEXT: mvneq r6, #127
2001 ; SOFT-NEXT: bl __aeabi_fcmpgt
2002 ; SOFT-NEXT: cmp r0, #0
2003 ; SOFT-NEXT: mov r0, r4
2004 ; SOFT-NEXT: mov r1, r4
2005 ; SOFT-NEXT: movne r6, #127
2006 ; SOFT-NEXT: bl __aeabi_fcmpun
2007 ; SOFT-NEXT: cmp r0, #0
2008 ; SOFT-NEXT: movne r6, #0
2009 ; SOFT-NEXT: mov r0, r6
2010 ; SOFT-NEXT: pop {r4, r5, r6, lr}
2011 ; SOFT-NEXT: mov pc, lr
2013 ; VFP2-LABEL: test_signed_i8_f16:
2015 ; VFP2-NEXT: .save {r11, lr}
2016 ; VFP2-NEXT: push {r11, lr}
2017 ; VFP2-NEXT: bl __aeabi_h2f
2018 ; VFP2-NEXT: vmov s0, r0
2019 ; VFP2-NEXT: vldr s2, .LCPI21_0
2020 ; VFP2-NEXT: vldr s6, .LCPI21_1
2021 ; VFP2-NEXT: vcmp.f32 s0, s2
2022 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2023 ; VFP2-NEXT: vcvt.s32.f32 s4, s0
2024 ; VFP2-NEXT: vcmp.f32 s0, s6
2025 ; VFP2-NEXT: vmov r0, s4
2026 ; VFP2-NEXT: mvnlt r0, #127
2027 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2028 ; VFP2-NEXT: vcmp.f32 s0, s0
2029 ; VFP2-NEXT: movgt r0, #127
2030 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2031 ; VFP2-NEXT: movvs r0, #0
2032 ; VFP2-NEXT: pop {r11, lr}
2033 ; VFP2-NEXT: mov pc, lr
2034 ; VFP2-NEXT: .p2align 2
2035 ; VFP2-NEXT: @ %bb.1:
2036 ; VFP2-NEXT: .LCPI21_0:
2037 ; VFP2-NEXT: .long 0xc3000000 @ float -128
2038 ; VFP2-NEXT: .LCPI21_1:
2039 ; VFP2-NEXT: .long 0x42fe0000 @ float 127
2040 %x = call i8 @llvm.fptosi.sat.i8.f16(half %f)
2044 define i13 @test_signed_i13_f16(half %f) nounwind {
2045 ; SOFT-LABEL: test_signed_i13_f16:
2047 ; SOFT-NEXT: .save {r4, r5, r6, lr}
2048 ; SOFT-NEXT: push {r4, r5, r6, lr}
2049 ; SOFT-NEXT: mov r1, #255
2050 ; SOFT-NEXT: orr r1, r1, #65280
2051 ; SOFT-NEXT: and r0, r0, r1
2052 ; SOFT-NEXT: bl __aeabi_h2f
2053 ; SOFT-NEXT: mov r1, #92274688
2054 ; SOFT-NEXT: mov r4, r0
2055 ; SOFT-NEXT: orr r1, r1, #-1073741824
2056 ; SOFT-NEXT: bl __aeabi_fcmpge
2057 ; SOFT-NEXT: mov r5, r0
2058 ; SOFT-NEXT: mov r0, r4
2059 ; SOFT-NEXT: bl __aeabi_f2iz
2060 ; SOFT-NEXT: mov r6, r0
2061 ; SOFT-NEXT: ldr r0, .LCPI22_0
2062 ; SOFT-NEXT: ldr r1, .LCPI22_1
2063 ; SOFT-NEXT: cmp r5, #0
2064 ; SOFT-NEXT: moveq r6, r0
2065 ; SOFT-NEXT: mov r0, r4
2066 ; SOFT-NEXT: bl __aeabi_fcmpgt
2067 ; SOFT-NEXT: mov r1, #255
2068 ; SOFT-NEXT: cmp r0, #0
2069 ; SOFT-NEXT: orr r1, r1, #3840
2070 ; SOFT-NEXT: mov r0, r4
2071 ; SOFT-NEXT: movne r6, r1
2072 ; SOFT-NEXT: mov r1, r4
2073 ; SOFT-NEXT: bl __aeabi_fcmpun
2074 ; SOFT-NEXT: cmp r0, #0
2075 ; SOFT-NEXT: movne r6, #0
2076 ; SOFT-NEXT: mov r0, r6
2077 ; SOFT-NEXT: pop {r4, r5, r6, lr}
2078 ; SOFT-NEXT: mov pc, lr
2079 ; SOFT-NEXT: .p2align 2
2080 ; SOFT-NEXT: @ %bb.1:
2081 ; SOFT-NEXT: .LCPI22_0:
2082 ; SOFT-NEXT: .long 4294963200 @ 0xfffff000
2083 ; SOFT-NEXT: .LCPI22_1:
2084 ; SOFT-NEXT: .long 1166012416 @ 0x457ff000
2086 ; VFP2-LABEL: test_signed_i13_f16:
2088 ; VFP2-NEXT: .save {r11, lr}
2089 ; VFP2-NEXT: push {r11, lr}
2090 ; VFP2-NEXT: bl __aeabi_h2f
2091 ; VFP2-NEXT: vmov s0, r0
2092 ; VFP2-NEXT: vldr s2, .LCPI22_0
2093 ; VFP2-NEXT: vldr s6, .LCPI22_1
2094 ; VFP2-NEXT: vcmp.f32 s0, s2
2095 ; VFP2-NEXT: ldr r0, .LCPI22_2
2096 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2097 ; VFP2-NEXT: vcvt.s32.f32 s4, s0
2098 ; VFP2-NEXT: vcmp.f32 s0, s6
2099 ; VFP2-NEXT: vmov r1, s4
2100 ; VFP2-NEXT: movlt r1, r0
2101 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2102 ; VFP2-NEXT: mov r0, #255
2103 ; VFP2-NEXT: vcmp.f32 s0, s0
2104 ; VFP2-NEXT: orr r0, r0, #3840
2105 ; VFP2-NEXT: movle r0, r1
2106 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2107 ; VFP2-NEXT: movvs r0, #0
2108 ; VFP2-NEXT: pop {r11, lr}
2109 ; VFP2-NEXT: mov pc, lr
2110 ; VFP2-NEXT: .p2align 2
2111 ; VFP2-NEXT: @ %bb.1:
2112 ; VFP2-NEXT: .LCPI22_0:
2113 ; VFP2-NEXT: .long 0xc5800000 @ float -4096
2114 ; VFP2-NEXT: .LCPI22_1:
2115 ; VFP2-NEXT: .long 0x457ff000 @ float 4095
2116 ; VFP2-NEXT: .LCPI22_2:
2117 ; VFP2-NEXT: .long 4294963200 @ 0xfffff000
2118 %x = call i13 @llvm.fptosi.sat.i13.f16(half %f)
2122 define i16 @test_signed_i16_f16(half %f) nounwind {
2123 ; SOFT-LABEL: test_signed_i16_f16:
2125 ; SOFT-NEXT: .save {r4, r5, r6, lr}
2126 ; SOFT-NEXT: push {r4, r5, r6, lr}
2127 ; SOFT-NEXT: mov r1, #255
2128 ; SOFT-NEXT: orr r1, r1, #65280
2129 ; SOFT-NEXT: and r0, r0, r1
2130 ; SOFT-NEXT: bl __aeabi_h2f
2131 ; SOFT-NEXT: mov r1, #-956301312
2132 ; SOFT-NEXT: mov r4, r0
2133 ; SOFT-NEXT: bl __aeabi_fcmpge
2134 ; SOFT-NEXT: mov r5, r0
2135 ; SOFT-NEXT: mov r0, r4
2136 ; SOFT-NEXT: bl __aeabi_f2iz
2137 ; SOFT-NEXT: mov r6, r0
2138 ; SOFT-NEXT: ldr r0, .LCPI23_0
2139 ; SOFT-NEXT: ldr r1, .LCPI23_1
2140 ; SOFT-NEXT: cmp r5, #0
2141 ; SOFT-NEXT: moveq r6, r0
2142 ; SOFT-NEXT: mov r0, r4
2143 ; SOFT-NEXT: bl __aeabi_fcmpgt
2144 ; SOFT-NEXT: mov r1, #255
2145 ; SOFT-NEXT: cmp r0, #0
2146 ; SOFT-NEXT: orr r1, r1, #32512
2147 ; SOFT-NEXT: mov r0, r4
2148 ; SOFT-NEXT: movne r6, r1
2149 ; SOFT-NEXT: mov r1, r4
2150 ; SOFT-NEXT: bl __aeabi_fcmpun
2151 ; SOFT-NEXT: cmp r0, #0
2152 ; SOFT-NEXT: movne r6, #0
2153 ; SOFT-NEXT: mov r0, r6
2154 ; SOFT-NEXT: pop {r4, r5, r6, lr}
2155 ; SOFT-NEXT: mov pc, lr
2156 ; SOFT-NEXT: .p2align 2
2157 ; SOFT-NEXT: @ %bb.1:
2158 ; SOFT-NEXT: .LCPI23_0:
2159 ; SOFT-NEXT: .long 4294934528 @ 0xffff8000
2160 ; SOFT-NEXT: .LCPI23_1:
2161 ; SOFT-NEXT: .long 1191181824 @ 0x46fffe00
2163 ; VFP2-LABEL: test_signed_i16_f16:
2165 ; VFP2-NEXT: .save {r11, lr}
2166 ; VFP2-NEXT: push {r11, lr}
2167 ; VFP2-NEXT: bl __aeabi_h2f
2168 ; VFP2-NEXT: vmov s0, r0
2169 ; VFP2-NEXT: vldr s2, .LCPI23_0
2170 ; VFP2-NEXT: vldr s6, .LCPI23_1
2171 ; VFP2-NEXT: vcmp.f32 s0, s2
2172 ; VFP2-NEXT: ldr r0, .LCPI23_2
2173 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2174 ; VFP2-NEXT: vcvt.s32.f32 s4, s0
2175 ; VFP2-NEXT: vcmp.f32 s0, s6
2176 ; VFP2-NEXT: vmov r1, s4
2177 ; VFP2-NEXT: movlt r1, r0
2178 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2179 ; VFP2-NEXT: mov r0, #255
2180 ; VFP2-NEXT: vcmp.f32 s0, s0
2181 ; VFP2-NEXT: orr r0, r0, #32512
2182 ; VFP2-NEXT: movle r0, r1
2183 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2184 ; VFP2-NEXT: movvs r0, #0
2185 ; VFP2-NEXT: pop {r11, lr}
2186 ; VFP2-NEXT: mov pc, lr
2187 ; VFP2-NEXT: .p2align 2
2188 ; VFP2-NEXT: @ %bb.1:
2189 ; VFP2-NEXT: .LCPI23_0:
2190 ; VFP2-NEXT: .long 0xc7000000 @ float -32768
2191 ; VFP2-NEXT: .LCPI23_1:
2192 ; VFP2-NEXT: .long 0x46fffe00 @ float 32767
2193 ; VFP2-NEXT: .LCPI23_2:
2194 ; VFP2-NEXT: .long 4294934528 @ 0xffff8000
2195 %x = call i16 @llvm.fptosi.sat.i16.f16(half %f)
2199 define i19 @test_signed_i19_f16(half %f) nounwind {
2200 ; SOFT-LABEL: test_signed_i19_f16:
2202 ; SOFT-NEXT: .save {r4, r5, r6, lr}
2203 ; SOFT-NEXT: push {r4, r5, r6, lr}
2204 ; SOFT-NEXT: mov r1, #255
2205 ; SOFT-NEXT: orr r1, r1, #65280
2206 ; SOFT-NEXT: and r0, r0, r1
2207 ; SOFT-NEXT: bl __aeabi_h2f
2208 ; SOFT-NEXT: mov r1, #142606336
2209 ; SOFT-NEXT: mov r4, r0
2210 ; SOFT-NEXT: orr r1, r1, #-1073741824
2211 ; SOFT-NEXT: bl __aeabi_fcmpge
2212 ; SOFT-NEXT: mov r5, r0
2213 ; SOFT-NEXT: mov r0, r4
2214 ; SOFT-NEXT: bl __aeabi_f2iz
2215 ; SOFT-NEXT: mov r6, r0
2216 ; SOFT-NEXT: mov r0, #66846720
2217 ; SOFT-NEXT: orr r0, r0, #-67108864
2218 ; SOFT-NEXT: ldr r1, .LCPI24_0
2219 ; SOFT-NEXT: cmp r5, #0
2220 ; SOFT-NEXT: moveq r6, r0
2221 ; SOFT-NEXT: mov r0, r4
2222 ; SOFT-NEXT: bl __aeabi_fcmpgt
2223 ; SOFT-NEXT: ldr r1, .LCPI24_1
2224 ; SOFT-NEXT: cmp r0, #0
2225 ; SOFT-NEXT: mov r0, r4
2226 ; SOFT-NEXT: movne r6, r1
2227 ; SOFT-NEXT: mov r1, r4
2228 ; SOFT-NEXT: bl __aeabi_fcmpun
2229 ; SOFT-NEXT: cmp r0, #0
2230 ; SOFT-NEXT: movne r6, #0
2231 ; SOFT-NEXT: mov r0, r6
2232 ; SOFT-NEXT: pop {r4, r5, r6, lr}
2233 ; SOFT-NEXT: mov pc, lr
2234 ; SOFT-NEXT: .p2align 2
2235 ; SOFT-NEXT: @ %bb.1:
2236 ; SOFT-NEXT: .LCPI24_0:
2237 ; SOFT-NEXT: .long 1216348096 @ 0x487fffc0
2238 ; SOFT-NEXT: .LCPI24_1:
2239 ; SOFT-NEXT: .long 262143 @ 0x3ffff
2241 ; VFP2-LABEL: test_signed_i19_f16:
2243 ; VFP2-NEXT: .save {r11, lr}
2244 ; VFP2-NEXT: push {r11, lr}
2245 ; VFP2-NEXT: bl __aeabi_h2f
2246 ; VFP2-NEXT: vmov s0, r0
2247 ; VFP2-NEXT: vldr s6, .LCPI24_2
2248 ; VFP2-NEXT: vldr s2, .LCPI24_0
2249 ; VFP2-NEXT: mov r0, #66846720
2250 ; VFP2-NEXT: vcvt.s32.f32 s4, s0
2251 ; VFP2-NEXT: orr r0, r0, #-67108864
2252 ; VFP2-NEXT: vcmp.f32 s0, s6
2253 ; VFP2-NEXT: ldr r1, .LCPI24_1
2254 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2255 ; VFP2-NEXT: vcmp.f32 s0, s2
2256 ; VFP2-NEXT: vmov r2, s4
2257 ; VFP2-NEXT: movge r0, r2
2258 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2259 ; VFP2-NEXT: vcmp.f32 s0, s0
2260 ; VFP2-NEXT: movgt r0, r1
2261 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2262 ; VFP2-NEXT: movvs r0, #0
2263 ; VFP2-NEXT: pop {r11, lr}
2264 ; VFP2-NEXT: mov pc, lr
2265 ; VFP2-NEXT: .p2align 2
2266 ; VFP2-NEXT: @ %bb.1:
2267 ; VFP2-NEXT: .LCPI24_0:
2268 ; VFP2-NEXT: .long 0x487fffc0 @ float 262143
2269 ; VFP2-NEXT: .LCPI24_1:
2270 ; VFP2-NEXT: .long 262143 @ 0x3ffff
2271 ; VFP2-NEXT: .LCPI24_2:
2272 ; VFP2-NEXT: .long 0xc8800000 @ float -262144
2273 %x = call i19 @llvm.fptosi.sat.i19.f16(half %f)
2277 define i32 @test_signed_i32_f16(half %f) nounwind {
2278 ; SOFT-LABEL: test_signed_i32_f16:
2280 ; SOFT-NEXT: .save {r4, r5, r6, lr}
2281 ; SOFT-NEXT: push {r4, r5, r6, lr}
2282 ; SOFT-NEXT: mov r1, #255
2283 ; SOFT-NEXT: orr r1, r1, #65280
2284 ; SOFT-NEXT: and r0, r0, r1
2285 ; SOFT-NEXT: bl __aeabi_h2f
2286 ; SOFT-NEXT: mov r1, #-822083584
2287 ; SOFT-NEXT: mov r4, r0
2288 ; SOFT-NEXT: bl __aeabi_fcmpge
2289 ; SOFT-NEXT: mov r5, r0
2290 ; SOFT-NEXT: mov r0, r4
2291 ; SOFT-NEXT: bl __aeabi_f2iz
2292 ; SOFT-NEXT: mov r6, r0
2293 ; SOFT-NEXT: cmp r5, #0
2294 ; SOFT-NEXT: mov r0, r4
2295 ; SOFT-NEXT: mvn r1, #-1325400064
2296 ; SOFT-NEXT: moveq r6, #-2147483648
2297 ; SOFT-NEXT: bl __aeabi_fcmpgt
2298 ; SOFT-NEXT: cmp r0, #0
2299 ; SOFT-NEXT: mov r0, r4
2300 ; SOFT-NEXT: mov r1, r4
2301 ; SOFT-NEXT: mvnne r6, #-2147483648
2302 ; SOFT-NEXT: bl __aeabi_fcmpun
2303 ; SOFT-NEXT: cmp r0, #0
2304 ; SOFT-NEXT: movne r6, #0
2305 ; SOFT-NEXT: mov r0, r6
2306 ; SOFT-NEXT: pop {r4, r5, r6, lr}
2307 ; SOFT-NEXT: mov pc, lr
2309 ; VFP2-LABEL: test_signed_i32_f16:
2311 ; VFP2-NEXT: .save {r11, lr}
2312 ; VFP2-NEXT: push {r11, lr}
2313 ; VFP2-NEXT: bl __aeabi_h2f
2314 ; VFP2-NEXT: vmov s0, r0
2315 ; VFP2-NEXT: vldr s2, .LCPI25_0
2316 ; VFP2-NEXT: vldr s6, .LCPI25_1
2317 ; VFP2-NEXT: vcmp.f32 s0, s2
2318 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2319 ; VFP2-NEXT: vcvt.s32.f32 s4, s0
2320 ; VFP2-NEXT: vcmp.f32 s0, s6
2321 ; VFP2-NEXT: vmov r0, s4
2322 ; VFP2-NEXT: movlt r0, #-2147483648
2323 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2324 ; VFP2-NEXT: vcmp.f32 s0, s0
2325 ; VFP2-NEXT: mvngt r0, #-2147483648
2326 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2327 ; VFP2-NEXT: movvs r0, #0
2328 ; VFP2-NEXT: pop {r11, lr}
2329 ; VFP2-NEXT: mov pc, lr
2330 ; VFP2-NEXT: .p2align 2
2331 ; VFP2-NEXT: @ %bb.1:
2332 ; VFP2-NEXT: .LCPI25_0:
2333 ; VFP2-NEXT: .long 0xcf000000 @ float -2.14748365E+9
2334 ; VFP2-NEXT: .LCPI25_1:
2335 ; VFP2-NEXT: .long 0x4effffff @ float 2.14748352E+9
2336 %x = call i32 @llvm.fptosi.sat.i32.f16(half %f)
2340 define i50 @test_signed_i50_f16(half %f) nounwind {
2341 ; SOFT-LABEL: test_signed_i50_f16:
2343 ; SOFT-NEXT: .save {r4, r5, r6, r7, r11, lr}
2344 ; SOFT-NEXT: push {r4, r5, r6, r7, r11, lr}
2345 ; SOFT-NEXT: mov r1, #255
2346 ; SOFT-NEXT: orr r1, r1, #65280
2347 ; SOFT-NEXT: and r0, r0, r1
2348 ; SOFT-NEXT: bl __aeabi_h2f
2349 ; SOFT-NEXT: mov r1, #-671088640
2350 ; SOFT-NEXT: mov r4, r0
2351 ; SOFT-NEXT: bl __aeabi_fcmpge
2352 ; SOFT-NEXT: mov r7, r0
2353 ; SOFT-NEXT: mov r0, r4
2354 ; SOFT-NEXT: bl __aeabi_f2lz
2355 ; SOFT-NEXT: mov r5, r0
2356 ; SOFT-NEXT: mov r6, r1
2357 ; SOFT-NEXT: cmp r7, #0
2358 ; SOFT-NEXT: mov r0, r4
2359 ; SOFT-NEXT: mvn r1, #-1476395008
2360 ; SOFT-NEXT: moveq r5, r7
2361 ; SOFT-NEXT: bl __aeabi_fcmpgt
2362 ; SOFT-NEXT: cmp r0, #0
2363 ; SOFT-NEXT: mov r0, r4
2364 ; SOFT-NEXT: mov r1, r4
2365 ; SOFT-NEXT: mvnne r5, #0
2366 ; SOFT-NEXT: bl __aeabi_fcmpun
2367 ; SOFT-NEXT: cmp r0, #0
2368 ; SOFT-NEXT: mov r0, r4
2369 ; SOFT-NEXT: mov r1, #-671088640
2370 ; SOFT-NEXT: movne r5, #0
2371 ; SOFT-NEXT: bl __aeabi_fcmpge
2372 ; SOFT-NEXT: mov r1, #16646144
2373 ; SOFT-NEXT: cmp r0, #0
2374 ; SOFT-NEXT: orr r1, r1, #-16777216
2375 ; SOFT-NEXT: mov r0, r4
2376 ; SOFT-NEXT: moveq r6, r1
2377 ; SOFT-NEXT: mvn r1, #-1476395008
2378 ; SOFT-NEXT: bl __aeabi_fcmpgt
2379 ; SOFT-NEXT: ldr r1, .LCPI26_0
2380 ; SOFT-NEXT: cmp r0, #0
2381 ; SOFT-NEXT: mov r0, r4
2382 ; SOFT-NEXT: movne r6, r1
2383 ; SOFT-NEXT: mov r1, r4
2384 ; SOFT-NEXT: bl __aeabi_fcmpun
2385 ; SOFT-NEXT: cmp r0, #0
2386 ; SOFT-NEXT: mov r0, r5
2387 ; SOFT-NEXT: movne r6, #0
2388 ; SOFT-NEXT: mov r1, r6
2389 ; SOFT-NEXT: pop {r4, r5, r6, r7, r11, lr}
2390 ; SOFT-NEXT: mov pc, lr
2391 ; SOFT-NEXT: .p2align 2
2392 ; SOFT-NEXT: @ %bb.1:
2393 ; SOFT-NEXT: .LCPI26_0:
2394 ; SOFT-NEXT: .long 131071 @ 0x1ffff
2396 ; VFP2-LABEL: test_signed_i50_f16:
2398 ; VFP2-NEXT: .save {r11, lr}
2399 ; VFP2-NEXT: push {r11, lr}
2400 ; VFP2-NEXT: .vsave {d8, d9}
2401 ; VFP2-NEXT: vpush {d8, d9}
2402 ; VFP2-NEXT: bl __aeabi_h2f
2403 ; VFP2-NEXT: vldr s16, .LCPI26_0
2404 ; VFP2-NEXT: vmov s18, r0
2405 ; VFP2-NEXT: bl __aeabi_f2lz
2406 ; VFP2-NEXT: vcmp.f32 s18, s16
2407 ; VFP2-NEXT: mov r2, #16646144
2408 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2409 ; VFP2-NEXT: orr r2, r2, #-16777216
2410 ; VFP2-NEXT: vldr s0, .LCPI26_1
2411 ; VFP2-NEXT: ldr r3, .LCPI26_2
2412 ; VFP2-NEXT: vcmp.f32 s18, s0
2413 ; VFP2-NEXT: movlt r1, r2
2414 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2415 ; VFP2-NEXT: vcmp.f32 s18, s18
2416 ; VFP2-NEXT: movgt r1, r3
2417 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2418 ; VFP2-NEXT: vcmp.f32 s18, s16
2419 ; VFP2-NEXT: movvs r1, #0
2420 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2421 ; VFP2-NEXT: vcmp.f32 s18, s0
2422 ; VFP2-NEXT: movlt r0, #0
2423 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2424 ; VFP2-NEXT: vcmp.f32 s18, s18
2425 ; VFP2-NEXT: mvngt r0, #0
2426 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2427 ; VFP2-NEXT: movvs r0, #0
2428 ; VFP2-NEXT: vpop {d8, d9}
2429 ; VFP2-NEXT: pop {r11, lr}
2430 ; VFP2-NEXT: mov pc, lr
2431 ; VFP2-NEXT: .p2align 2
2432 ; VFP2-NEXT: @ %bb.1:
2433 ; VFP2-NEXT: .LCPI26_0:
2434 ; VFP2-NEXT: .long 0xd8000000 @ float -5.62949953E+14
2435 ; VFP2-NEXT: .LCPI26_1:
2436 ; VFP2-NEXT: .long 0x57ffffff @ float 5.6294992E+14
2437 ; VFP2-NEXT: .LCPI26_2:
2438 ; VFP2-NEXT: .long 131071 @ 0x1ffff
2439 %x = call i50 @llvm.fptosi.sat.i50.f16(half %f)
2443 define i64 @test_signed_i64_f16(half %f) nounwind {
2444 ; SOFT-LABEL: test_signed_i64_f16:
2446 ; SOFT-NEXT: .save {r4, r5, r6, r7, r11, lr}
2447 ; SOFT-NEXT: push {r4, r5, r6, r7, r11, lr}
2448 ; SOFT-NEXT: mov r1, #255
2449 ; SOFT-NEXT: orr r1, r1, #65280
2450 ; SOFT-NEXT: and r0, r0, r1
2451 ; SOFT-NEXT: bl __aeabi_h2f
2452 ; SOFT-NEXT: mov r1, #-553648128
2453 ; SOFT-NEXT: mov r4, r0
2454 ; SOFT-NEXT: bl __aeabi_fcmpge
2455 ; SOFT-NEXT: mov r7, r0
2456 ; SOFT-NEXT: mov r0, r4
2457 ; SOFT-NEXT: bl __aeabi_f2lz
2458 ; SOFT-NEXT: mov r5, r0
2459 ; SOFT-NEXT: mov r6, r1
2460 ; SOFT-NEXT: cmp r7, #0
2461 ; SOFT-NEXT: mov r0, r4
2462 ; SOFT-NEXT: mvn r1, #-1593835520
2463 ; SOFT-NEXT: moveq r5, r7
2464 ; SOFT-NEXT: bl __aeabi_fcmpgt
2465 ; SOFT-NEXT: cmp r0, #0
2466 ; SOFT-NEXT: mov r0, r4
2467 ; SOFT-NEXT: mov r1, r4
2468 ; SOFT-NEXT: mvnne r5, #0
2469 ; SOFT-NEXT: bl __aeabi_fcmpun
2470 ; SOFT-NEXT: cmp r0, #0
2471 ; SOFT-NEXT: mov r0, r4
2472 ; SOFT-NEXT: mov r1, #-553648128
2473 ; SOFT-NEXT: movne r5, #0
2474 ; SOFT-NEXT: bl __aeabi_fcmpge
2475 ; SOFT-NEXT: cmp r0, #0
2476 ; SOFT-NEXT: mov r0, r4
2477 ; SOFT-NEXT: mvn r1, #-1593835520
2478 ; SOFT-NEXT: moveq r6, #-2147483648
2479 ; SOFT-NEXT: bl __aeabi_fcmpgt
2480 ; SOFT-NEXT: cmp r0, #0
2481 ; SOFT-NEXT: mov r0, r4
2482 ; SOFT-NEXT: mov r1, r4
2483 ; SOFT-NEXT: mvnne r6, #-2147483648
2484 ; SOFT-NEXT: bl __aeabi_fcmpun
2485 ; SOFT-NEXT: cmp r0, #0
2486 ; SOFT-NEXT: mov r0, r5
2487 ; SOFT-NEXT: movne r6, #0
2488 ; SOFT-NEXT: mov r1, r6
2489 ; SOFT-NEXT: pop {r4, r5, r6, r7, r11, lr}
2490 ; SOFT-NEXT: mov pc, lr
2492 ; VFP2-LABEL: test_signed_i64_f16:
2494 ; VFP2-NEXT: .save {r4, lr}
2495 ; VFP2-NEXT: push {r4, lr}
2496 ; VFP2-NEXT: bl __aeabi_h2f
2497 ; VFP2-NEXT: mov r4, r0
2498 ; VFP2-NEXT: bl __aeabi_f2lz
2499 ; VFP2-NEXT: vldr s0, .LCPI27_0
2500 ; VFP2-NEXT: vmov s2, r4
2501 ; VFP2-NEXT: vldr s4, .LCPI27_1
2502 ; VFP2-NEXT: vcmp.f32 s2, s0
2503 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2504 ; VFP2-NEXT: vcmp.f32 s2, s4
2505 ; VFP2-NEXT: movlt r0, #0
2506 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2507 ; VFP2-NEXT: vcmp.f32 s2, s2
2508 ; VFP2-NEXT: mvngt r0, #0
2509 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2510 ; VFP2-NEXT: vcmp.f32 s2, s0
2511 ; VFP2-NEXT: movvs r0, #0
2512 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2513 ; VFP2-NEXT: vcmp.f32 s2, s4
2514 ; VFP2-NEXT: movlt r1, #-2147483648
2515 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2516 ; VFP2-NEXT: vcmp.f32 s2, s2
2517 ; VFP2-NEXT: mvngt r1, #-2147483648
2518 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2519 ; VFP2-NEXT: movvs r1, #0
2520 ; VFP2-NEXT: pop {r4, lr}
2521 ; VFP2-NEXT: mov pc, lr
2522 ; VFP2-NEXT: .p2align 2
2523 ; VFP2-NEXT: @ %bb.1:
2524 ; VFP2-NEXT: .LCPI27_0:
2525 ; VFP2-NEXT: .long 0xdf000000 @ float -9.22337203E+18
2526 ; VFP2-NEXT: .LCPI27_1:
2527 ; VFP2-NEXT: .long 0x5effffff @ float 9.22337149E+18
2528 %x = call i64 @llvm.fptosi.sat.i64.f16(half %f)
2532 define i100 @test_signed_i100_f16(half %f) nounwind {
2533 ; SOFT-LABEL: test_signed_i100_f16:
2535 ; SOFT-NEXT: .save {r4, r5, r6, r7, r8, r9, r11, lr}
2536 ; SOFT-NEXT: push {r4, r5, r6, r7, r8, r9, r11, lr}
2537 ; SOFT-NEXT: mov r1, #255
2538 ; SOFT-NEXT: orr r1, r1, #65280
2539 ; SOFT-NEXT: and r0, r0, r1
2540 ; SOFT-NEXT: bl __aeabi_h2f
2541 ; SOFT-NEXT: mov r1, #-251658240
2542 ; SOFT-NEXT: mov r4, r0
2543 ; SOFT-NEXT: bl __aeabi_fcmpge
2544 ; SOFT-NEXT: mov r5, r0
2545 ; SOFT-NEXT: mov r0, r4
2546 ; SOFT-NEXT: bl __fixsfti
2547 ; SOFT-NEXT: mov r9, r0
2548 ; SOFT-NEXT: mov r6, r1
2549 ; SOFT-NEXT: cmp r5, #0
2550 ; SOFT-NEXT: mov r0, r4
2551 ; SOFT-NEXT: mvn r1, #-1895825408
2552 ; SOFT-NEXT: mov r7, r2
2553 ; SOFT-NEXT: mov r8, r3
2554 ; SOFT-NEXT: moveq r9, r5
2555 ; SOFT-NEXT: bl __aeabi_fcmpgt
2556 ; SOFT-NEXT: cmp r0, #0
2557 ; SOFT-NEXT: mov r0, r4
2558 ; SOFT-NEXT: mov r1, r4
2559 ; SOFT-NEXT: mvnne r9, #0
2560 ; SOFT-NEXT: bl __aeabi_fcmpun
2561 ; SOFT-NEXT: cmp r0, #0
2562 ; SOFT-NEXT: mov r0, r4
2563 ; SOFT-NEXT: mov r1, #-251658240
2564 ; SOFT-NEXT: movne r9, #0
2565 ; SOFT-NEXT: bl __aeabi_fcmpge
2566 ; SOFT-NEXT: cmp r0, #0
2567 ; SOFT-NEXT: mvn r1, #-1895825408
2568 ; SOFT-NEXT: moveq r6, r0
2569 ; SOFT-NEXT: mov r0, r4
2570 ; SOFT-NEXT: bl __aeabi_fcmpgt
2571 ; SOFT-NEXT: cmp r0, #0
2572 ; SOFT-NEXT: mov r0, r4
2573 ; SOFT-NEXT: mov r1, r4
2574 ; SOFT-NEXT: mvnne r6, #0
2575 ; SOFT-NEXT: bl __aeabi_fcmpun
2576 ; SOFT-NEXT: cmp r0, #0
2577 ; SOFT-NEXT: mov r0, r4
2578 ; SOFT-NEXT: mov r1, #-251658240
2579 ; SOFT-NEXT: movne r6, #0
2580 ; SOFT-NEXT: bl __aeabi_fcmpge
2581 ; SOFT-NEXT: cmp r0, #0
2582 ; SOFT-NEXT: mvn r1, #-1895825408
2583 ; SOFT-NEXT: moveq r7, r0
2584 ; SOFT-NEXT: mov r0, r4
2585 ; SOFT-NEXT: bl __aeabi_fcmpgt
2586 ; SOFT-NEXT: cmp r0, #0
2587 ; SOFT-NEXT: mov r0, r4
2588 ; SOFT-NEXT: mov r1, r4
2589 ; SOFT-NEXT: mvnne r7, #0
2590 ; SOFT-NEXT: bl __aeabi_fcmpun
2591 ; SOFT-NEXT: cmp r0, #0
2592 ; SOFT-NEXT: mov r0, r4
2593 ; SOFT-NEXT: mov r1, #-251658240
2594 ; SOFT-NEXT: movne r7, #0
2595 ; SOFT-NEXT: bl __aeabi_fcmpge
2596 ; SOFT-NEXT: cmp r0, #0
2597 ; SOFT-NEXT: mov r0, r4
2598 ; SOFT-NEXT: mvn r1, #-1895825408
2599 ; SOFT-NEXT: mvneq r8, #7
2600 ; SOFT-NEXT: bl __aeabi_fcmpgt
2601 ; SOFT-NEXT: cmp r0, #0
2602 ; SOFT-NEXT: mov r0, r4
2603 ; SOFT-NEXT: mov r1, r4
2604 ; SOFT-NEXT: movne r8, #7
2605 ; SOFT-NEXT: bl __aeabi_fcmpun
2606 ; SOFT-NEXT: cmp r0, #0
2607 ; SOFT-NEXT: mov r0, r9
2608 ; SOFT-NEXT: movne r8, #0
2609 ; SOFT-NEXT: mov r1, r6
2610 ; SOFT-NEXT: mov r2, r7
2611 ; SOFT-NEXT: mov r3, r8
2612 ; SOFT-NEXT: pop {r4, r5, r6, r7, r8, r9, r11, lr}
2613 ; SOFT-NEXT: mov pc, lr
2615 ; VFP2-LABEL: test_signed_i100_f16:
2617 ; VFP2-NEXT: .save {r4, lr}
2618 ; VFP2-NEXT: push {r4, lr}
2619 ; VFP2-NEXT: bl __aeabi_h2f
2620 ; VFP2-NEXT: mov r4, r0
2621 ; VFP2-NEXT: bl __fixsfti
2622 ; VFP2-NEXT: vldr s0, .LCPI28_0
2623 ; VFP2-NEXT: vmov s2, r4
2624 ; VFP2-NEXT: vldr s4, .LCPI28_1
2625 ; VFP2-NEXT: vcmp.f32 s2, s0
2626 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2627 ; VFP2-NEXT: vcmp.f32 s2, s4
2628 ; VFP2-NEXT: movlt r0, #0
2629 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2630 ; VFP2-NEXT: vcmp.f32 s2, s2
2631 ; VFP2-NEXT: mvngt r0, #0
2632 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2633 ; VFP2-NEXT: vcmp.f32 s2, s0
2634 ; VFP2-NEXT: movvs r0, #0
2635 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2636 ; VFP2-NEXT: vcmp.f32 s2, s4
2637 ; VFP2-NEXT: movlt r1, #0
2638 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2639 ; VFP2-NEXT: vcmp.f32 s2, s2
2640 ; VFP2-NEXT: mvngt r1, #0
2641 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2642 ; VFP2-NEXT: vcmp.f32 s2, s0
2643 ; VFP2-NEXT: movvs r1, #0
2644 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2645 ; VFP2-NEXT: vcmp.f32 s2, s4
2646 ; VFP2-NEXT: movlt r2, #0
2647 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2648 ; VFP2-NEXT: vcmp.f32 s2, s2
2649 ; VFP2-NEXT: mvngt r2, #0
2650 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2651 ; VFP2-NEXT: vcmp.f32 s2, s0
2652 ; VFP2-NEXT: movvs r2, #0
2653 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2654 ; VFP2-NEXT: vcmp.f32 s2, s4
2655 ; VFP2-NEXT: mvnlt r3, #7
2656 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2657 ; VFP2-NEXT: vcmp.f32 s2, s2
2658 ; VFP2-NEXT: movgt r3, #7
2659 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2660 ; VFP2-NEXT: movvs r3, #0
2661 ; VFP2-NEXT: pop {r4, lr}
2662 ; VFP2-NEXT: mov pc, lr
2663 ; VFP2-NEXT: .p2align 2
2664 ; VFP2-NEXT: @ %bb.1:
2665 ; VFP2-NEXT: .LCPI28_0:
2666 ; VFP2-NEXT: .long 0xf1000000 @ float -6.338253E+29
2667 ; VFP2-NEXT: .LCPI28_1:
2668 ; VFP2-NEXT: .long 0x70ffffff @ float 6.33825262E+29
2669 %x = call i100 @llvm.fptosi.sat.i100.f16(half %f)
2673 define i128 @test_signed_i128_f16(half %f) nounwind {
2674 ; SOFT-LABEL: test_signed_i128_f16:
2676 ; SOFT-NEXT: .save {r4, r5, r6, r7, r8, r9, r11, lr}
2677 ; SOFT-NEXT: push {r4, r5, r6, r7, r8, r9, r11, lr}
2678 ; SOFT-NEXT: mov r1, #255
2679 ; SOFT-NEXT: orr r1, r1, #65280
2680 ; SOFT-NEXT: and r0, r0, r1
2681 ; SOFT-NEXT: bl __aeabi_h2f
2682 ; SOFT-NEXT: mov r1, #-16777216
2683 ; SOFT-NEXT: mov r4, r0
2684 ; SOFT-NEXT: bl __aeabi_fcmpge
2685 ; SOFT-NEXT: mov r5, r0
2686 ; SOFT-NEXT: mov r0, r4
2687 ; SOFT-NEXT: bl __fixsfti
2688 ; SOFT-NEXT: mov r9, r0
2689 ; SOFT-NEXT: mov r6, r1
2690 ; SOFT-NEXT: cmp r5, #0
2691 ; SOFT-NEXT: mov r0, r4
2692 ; SOFT-NEXT: mvn r1, #-2130706432
2693 ; SOFT-NEXT: mov r7, r2
2694 ; SOFT-NEXT: mov r8, r3
2695 ; SOFT-NEXT: moveq r9, r5
2696 ; SOFT-NEXT: bl __aeabi_fcmpgt
2697 ; SOFT-NEXT: cmp r0, #0
2698 ; SOFT-NEXT: mov r0, r4
2699 ; SOFT-NEXT: mov r1, r4
2700 ; SOFT-NEXT: mvnne r9, #0
2701 ; SOFT-NEXT: bl __aeabi_fcmpun
2702 ; SOFT-NEXT: cmp r0, #0
2703 ; SOFT-NEXT: mov r0, r4
2704 ; SOFT-NEXT: mov r1, #-16777216
2705 ; SOFT-NEXT: movne r9, #0
2706 ; SOFT-NEXT: bl __aeabi_fcmpge
2707 ; SOFT-NEXT: cmp r0, #0
2708 ; SOFT-NEXT: mvn r1, #-2130706432
2709 ; SOFT-NEXT: moveq r6, r0
2710 ; SOFT-NEXT: mov r0, r4
2711 ; SOFT-NEXT: bl __aeabi_fcmpgt
2712 ; SOFT-NEXT: cmp r0, #0
2713 ; SOFT-NEXT: mov r0, r4
2714 ; SOFT-NEXT: mov r1, r4
2715 ; SOFT-NEXT: mvnne r6, #0
2716 ; SOFT-NEXT: bl __aeabi_fcmpun
2717 ; SOFT-NEXT: cmp r0, #0
2718 ; SOFT-NEXT: mov r0, r4
2719 ; SOFT-NEXT: mov r1, #-16777216
2720 ; SOFT-NEXT: movne r6, #0
2721 ; SOFT-NEXT: bl __aeabi_fcmpge
2722 ; SOFT-NEXT: cmp r0, #0
2723 ; SOFT-NEXT: mvn r1, #-2130706432
2724 ; SOFT-NEXT: moveq r7, r0
2725 ; SOFT-NEXT: mov r0, r4
2726 ; SOFT-NEXT: bl __aeabi_fcmpgt
2727 ; SOFT-NEXT: cmp r0, #0
2728 ; SOFT-NEXT: mov r0, r4
2729 ; SOFT-NEXT: mov r1, r4
2730 ; SOFT-NEXT: mvnne r7, #0
2731 ; SOFT-NEXT: bl __aeabi_fcmpun
2732 ; SOFT-NEXT: cmp r0, #0
2733 ; SOFT-NEXT: mov r0, r4
2734 ; SOFT-NEXT: mov r1, #-16777216
2735 ; SOFT-NEXT: movne r7, #0
2736 ; SOFT-NEXT: bl __aeabi_fcmpge
2737 ; SOFT-NEXT: cmp r0, #0
2738 ; SOFT-NEXT: mov r0, r4
2739 ; SOFT-NEXT: mvn r1, #-2130706432
2740 ; SOFT-NEXT: moveq r8, #-2147483648
2741 ; SOFT-NEXT: bl __aeabi_fcmpgt
2742 ; SOFT-NEXT: cmp r0, #0
2743 ; SOFT-NEXT: mov r0, r4
2744 ; SOFT-NEXT: mov r1, r4
2745 ; SOFT-NEXT: mvnne r8, #-2147483648
2746 ; SOFT-NEXT: bl __aeabi_fcmpun
2747 ; SOFT-NEXT: cmp r0, #0
2748 ; SOFT-NEXT: mov r0, r9
2749 ; SOFT-NEXT: movne r8, #0
2750 ; SOFT-NEXT: mov r1, r6
2751 ; SOFT-NEXT: mov r2, r7
2752 ; SOFT-NEXT: mov r3, r8
2753 ; SOFT-NEXT: pop {r4, r5, r6, r7, r8, r9, r11, lr}
2754 ; SOFT-NEXT: mov pc, lr
2756 ; VFP2-LABEL: test_signed_i128_f16:
2758 ; VFP2-NEXT: .save {r4, lr}
2759 ; VFP2-NEXT: push {r4, lr}
2760 ; VFP2-NEXT: bl __aeabi_h2f
2761 ; VFP2-NEXT: mov r4, r0
2762 ; VFP2-NEXT: bl __fixsfti
2763 ; VFP2-NEXT: vldr s0, .LCPI29_0
2764 ; VFP2-NEXT: vmov s2, r4
2765 ; VFP2-NEXT: vldr s4, .LCPI29_1
2766 ; VFP2-NEXT: vcmp.f32 s2, s0
2767 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2768 ; VFP2-NEXT: vcmp.f32 s2, s4
2769 ; VFP2-NEXT: movlt r0, #0
2770 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2771 ; VFP2-NEXT: vcmp.f32 s2, s2
2772 ; VFP2-NEXT: mvngt r0, #0
2773 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2774 ; VFP2-NEXT: vcmp.f32 s2, s0
2775 ; VFP2-NEXT: movvs r0, #0
2776 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2777 ; VFP2-NEXT: vcmp.f32 s2, s4
2778 ; VFP2-NEXT: movlt r1, #0
2779 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2780 ; VFP2-NEXT: vcmp.f32 s2, s2
2781 ; VFP2-NEXT: mvngt r1, #0
2782 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2783 ; VFP2-NEXT: vcmp.f32 s2, s0
2784 ; VFP2-NEXT: movvs r1, #0
2785 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2786 ; VFP2-NEXT: vcmp.f32 s2, s4
2787 ; VFP2-NEXT: movlt r2, #0
2788 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2789 ; VFP2-NEXT: vcmp.f32 s2, s2
2790 ; VFP2-NEXT: mvngt r2, #0
2791 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2792 ; VFP2-NEXT: vcmp.f32 s2, s0
2793 ; VFP2-NEXT: movvs r2, #0
2794 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2795 ; VFP2-NEXT: vcmp.f32 s2, s4
2796 ; VFP2-NEXT: movlt r3, #-2147483648
2797 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2798 ; VFP2-NEXT: vcmp.f32 s2, s2
2799 ; VFP2-NEXT: mvngt r3, #-2147483648
2800 ; VFP2-NEXT: vmrs APSR_nzcv, fpscr
2801 ; VFP2-NEXT: movvs r3, #0
2802 ; VFP2-NEXT: pop {r4, lr}
2803 ; VFP2-NEXT: mov pc, lr
2804 ; VFP2-NEXT: .p2align 2
2805 ; VFP2-NEXT: @ %bb.1:
2806 ; VFP2-NEXT: .LCPI29_0:
2807 ; VFP2-NEXT: .long 0xff000000 @ float -1.70141183E+38
2808 ; VFP2-NEXT: .LCPI29_1:
2809 ; VFP2-NEXT: .long 0x7effffff @ float 1.70141173E+38
2810 %x = call i128 @llvm.fptosi.sat.i128.f16(half %f)