1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+sse2 -O3 | FileCheck %s --check-prefixes=SSE-X86
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse2 -O3 | FileCheck %s --check-prefixes=SSE-X64
4 ; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+avx -O3 | FileCheck %s --check-prefixes=AVX-X86,AVX1-X86
5 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx -O3 | FileCheck %s --check-prefixes=AVX-X64,AVX1-X64
6 ; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+avx512f -mattr=+avx512vl -O3 | FileCheck %s --check-prefixes=AVX-X86,AVX512-X86
7 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f -mattr=+avx512vl -O3 | FileCheck %s --check-prefixes=AVX-X64,AVX512-X64
8 ; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=-sse -O3 | FileCheck %s --check-prefixes=X87
10 declare float @llvm.experimental.constrained.sitofp.f32.i1(i1, metadata, metadata)
11 declare float @llvm.experimental.constrained.sitofp.f32.i8(i8, metadata, metadata)
12 declare float @llvm.experimental.constrained.sitofp.f32.i16(i16, metadata, metadata)
13 declare float @llvm.experimental.constrained.sitofp.f32.i32(i32, metadata, metadata)
14 declare float @llvm.experimental.constrained.sitofp.f32.i64(i64, metadata, metadata)
15 declare float @llvm.experimental.constrained.uitofp.f32.i1(i1, metadata, metadata)
16 declare float @llvm.experimental.constrained.uitofp.f32.i8(i8, metadata, metadata)
17 declare float @llvm.experimental.constrained.uitofp.f32.i16(i16, metadata, metadata)
18 declare float @llvm.experimental.constrained.uitofp.f32.i32(i32, metadata, metadata)
19 declare float @llvm.experimental.constrained.uitofp.f32.i64(i64, metadata, metadata)
21 declare double @llvm.experimental.constrained.sitofp.f64.i1(i1, metadata, metadata)
22 declare double @llvm.experimental.constrained.sitofp.f64.i8(i8, metadata, metadata)
23 declare double @llvm.experimental.constrained.sitofp.f64.i16(i16, metadata, metadata)
24 declare double @llvm.experimental.constrained.sitofp.f64.i32(i32, metadata, metadata)
25 declare double @llvm.experimental.constrained.sitofp.f64.i64(i64, metadata, metadata)
26 declare double @llvm.experimental.constrained.uitofp.f64.i1(i1, metadata, metadata)
27 declare double @llvm.experimental.constrained.uitofp.f64.i8(i8, metadata, metadata)
28 declare double @llvm.experimental.constrained.uitofp.f64.i16(i16, metadata, metadata)
29 declare double @llvm.experimental.constrained.uitofp.f64.i32(i32, metadata, metadata)
30 declare double @llvm.experimental.constrained.uitofp.f64.i64(i64, metadata, metadata)
32 define float @sitofp_i1tof32(i1 %x) #0 {
33 ; SSE-X86-LABEL: sitofp_i1tof32:
35 ; SSE-X86-NEXT: pushl %eax
36 ; SSE-X86-NEXT: .cfi_def_cfa_offset 8
37 ; SSE-X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
38 ; SSE-X86-NEXT: andb $1, %al
39 ; SSE-X86-NEXT: negb %al
40 ; SSE-X86-NEXT: movsbl %al, %eax
41 ; SSE-X86-NEXT: cvtsi2ss %eax, %xmm0
42 ; SSE-X86-NEXT: movss %xmm0, (%esp)
43 ; SSE-X86-NEXT: flds (%esp)
45 ; SSE-X86-NEXT: popl %eax
46 ; SSE-X86-NEXT: .cfi_def_cfa_offset 4
49 ; SSE-X64-LABEL: sitofp_i1tof32:
51 ; SSE-X64-NEXT: andb $1, %dil
52 ; SSE-X64-NEXT: negb %dil
53 ; SSE-X64-NEXT: movsbl %dil, %eax
54 ; SSE-X64-NEXT: cvtsi2ss %eax, %xmm0
57 ; AVX-X86-LABEL: sitofp_i1tof32:
59 ; AVX-X86-NEXT: pushl %eax
60 ; AVX-X86-NEXT: .cfi_def_cfa_offset 8
61 ; AVX-X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
62 ; AVX-X86-NEXT: andb $1, %al
63 ; AVX-X86-NEXT: negb %al
64 ; AVX-X86-NEXT: movsbl %al, %eax
65 ; AVX-X86-NEXT: vcvtsi2ss %eax, %xmm0, %xmm0
66 ; AVX-X86-NEXT: vmovss %xmm0, (%esp)
67 ; AVX-X86-NEXT: flds (%esp)
69 ; AVX-X86-NEXT: popl %eax
70 ; AVX-X86-NEXT: .cfi_def_cfa_offset 4
73 ; AVX-X64-LABEL: sitofp_i1tof32:
75 ; AVX-X64-NEXT: andb $1, %dil
76 ; AVX-X64-NEXT: negb %dil
77 ; AVX-X64-NEXT: movsbl %dil, %eax
78 ; AVX-X64-NEXT: vcvtsi2ss %eax, %xmm0, %xmm0
81 ; X87-LABEL: sitofp_i1tof32:
83 ; X87-NEXT: pushl %eax
84 ; X87-NEXT: .cfi_def_cfa_offset 8
85 ; X87-NEXT: movzbl {{[0-9]+}}(%esp), %eax
86 ; X87-NEXT: andb $1, %al
88 ; X87-NEXT: movsbl %al, %eax
89 ; X87-NEXT: movw %ax, {{[0-9]+}}(%esp)
90 ; X87-NEXT: filds {{[0-9]+}}(%esp)
93 ; X87-NEXT: .cfi_def_cfa_offset 4
95 %result = call float @llvm.experimental.constrained.sitofp.f32.i1(i1 %x,
96 metadata !"round.dynamic",
97 metadata !"fpexcept.strict") #0
101 define float @sitofp_i8tof32(i8 %x) #0 {
102 ; SSE-X86-LABEL: sitofp_i8tof32:
104 ; SSE-X86-NEXT: pushl %eax
105 ; SSE-X86-NEXT: .cfi_def_cfa_offset 8
106 ; SSE-X86-NEXT: movsbl {{[0-9]+}}(%esp), %eax
107 ; SSE-X86-NEXT: cvtsi2ss %eax, %xmm0
108 ; SSE-X86-NEXT: movss %xmm0, (%esp)
109 ; SSE-X86-NEXT: flds (%esp)
111 ; SSE-X86-NEXT: popl %eax
112 ; SSE-X86-NEXT: .cfi_def_cfa_offset 4
115 ; SSE-X64-LABEL: sitofp_i8tof32:
117 ; SSE-X64-NEXT: movsbl %dil, %eax
118 ; SSE-X64-NEXT: cvtsi2ss %eax, %xmm0
121 ; AVX-X86-LABEL: sitofp_i8tof32:
123 ; AVX-X86-NEXT: pushl %eax
124 ; AVX-X86-NEXT: .cfi_def_cfa_offset 8
125 ; AVX-X86-NEXT: movsbl {{[0-9]+}}(%esp), %eax
126 ; AVX-X86-NEXT: vcvtsi2ss %eax, %xmm0, %xmm0
127 ; AVX-X86-NEXT: vmovss %xmm0, (%esp)
128 ; AVX-X86-NEXT: flds (%esp)
130 ; AVX-X86-NEXT: popl %eax
131 ; AVX-X86-NEXT: .cfi_def_cfa_offset 4
134 ; AVX-X64-LABEL: sitofp_i8tof32:
136 ; AVX-X64-NEXT: movsbl %dil, %eax
137 ; AVX-X64-NEXT: vcvtsi2ss %eax, %xmm0, %xmm0
140 ; X87-LABEL: sitofp_i8tof32:
142 ; X87-NEXT: pushl %eax
143 ; X87-NEXT: .cfi_def_cfa_offset 8
144 ; X87-NEXT: movsbl {{[0-9]+}}(%esp), %eax
145 ; X87-NEXT: movw %ax, {{[0-9]+}}(%esp)
146 ; X87-NEXT: filds {{[0-9]+}}(%esp)
148 ; X87-NEXT: popl %eax
149 ; X87-NEXT: .cfi_def_cfa_offset 4
151 %result = call float @llvm.experimental.constrained.sitofp.f32.i8(i8 %x,
152 metadata !"round.dynamic",
153 metadata !"fpexcept.strict") #0
157 define float @sitofp_i16tof32(i16 %x) #0 {
158 ; SSE-X86-LABEL: sitofp_i16tof32:
160 ; SSE-X86-NEXT: pushl %eax
161 ; SSE-X86-NEXT: .cfi_def_cfa_offset 8
162 ; SSE-X86-NEXT: movswl {{[0-9]+}}(%esp), %eax
163 ; SSE-X86-NEXT: cvtsi2ss %eax, %xmm0
164 ; SSE-X86-NEXT: movss %xmm0, (%esp)
165 ; SSE-X86-NEXT: flds (%esp)
167 ; SSE-X86-NEXT: popl %eax
168 ; SSE-X86-NEXT: .cfi_def_cfa_offset 4
171 ; SSE-X64-LABEL: sitofp_i16tof32:
173 ; SSE-X64-NEXT: movswl %di, %eax
174 ; SSE-X64-NEXT: cvtsi2ss %eax, %xmm0
177 ; AVX-X86-LABEL: sitofp_i16tof32:
179 ; AVX-X86-NEXT: pushl %eax
180 ; AVX-X86-NEXT: .cfi_def_cfa_offset 8
181 ; AVX-X86-NEXT: movswl {{[0-9]+}}(%esp), %eax
182 ; AVX-X86-NEXT: vcvtsi2ss %eax, %xmm0, %xmm0
183 ; AVX-X86-NEXT: vmovss %xmm0, (%esp)
184 ; AVX-X86-NEXT: flds (%esp)
186 ; AVX-X86-NEXT: popl %eax
187 ; AVX-X86-NEXT: .cfi_def_cfa_offset 4
190 ; AVX-X64-LABEL: sitofp_i16tof32:
192 ; AVX-X64-NEXT: movswl %di, %eax
193 ; AVX-X64-NEXT: vcvtsi2ss %eax, %xmm0, %xmm0
196 ; X87-LABEL: sitofp_i16tof32:
198 ; X87-NEXT: pushl %eax
199 ; X87-NEXT: .cfi_def_cfa_offset 8
200 ; X87-NEXT: movzwl {{[0-9]+}}(%esp), %eax
201 ; X87-NEXT: movw %ax, {{[0-9]+}}(%esp)
202 ; X87-NEXT: filds {{[0-9]+}}(%esp)
204 ; X87-NEXT: popl %eax
205 ; X87-NEXT: .cfi_def_cfa_offset 4
207 %result = call float @llvm.experimental.constrained.sitofp.f32.i16(i16 %x,
208 metadata !"round.dynamic",
209 metadata !"fpexcept.strict") #0
213 define float @sitofp_i32tof32(i32 %x) #0 {
214 ; SSE-X86-LABEL: sitofp_i32tof32:
216 ; SSE-X86-NEXT: pushl %eax
217 ; SSE-X86-NEXT: .cfi_def_cfa_offset 8
218 ; SSE-X86-NEXT: cvtsi2ssl {{[0-9]+}}(%esp), %xmm0
219 ; SSE-X86-NEXT: movss %xmm0, (%esp)
220 ; SSE-X86-NEXT: flds (%esp)
222 ; SSE-X86-NEXT: popl %eax
223 ; SSE-X86-NEXT: .cfi_def_cfa_offset 4
226 ; SSE-X64-LABEL: sitofp_i32tof32:
228 ; SSE-X64-NEXT: cvtsi2ss %edi, %xmm0
231 ; AVX-X86-LABEL: sitofp_i32tof32:
233 ; AVX-X86-NEXT: pushl %eax
234 ; AVX-X86-NEXT: .cfi_def_cfa_offset 8
235 ; AVX-X86-NEXT: vcvtsi2ssl {{[0-9]+}}(%esp), %xmm0, %xmm0
236 ; AVX-X86-NEXT: vmovss %xmm0, (%esp)
237 ; AVX-X86-NEXT: flds (%esp)
239 ; AVX-X86-NEXT: popl %eax
240 ; AVX-X86-NEXT: .cfi_def_cfa_offset 4
243 ; AVX-X64-LABEL: sitofp_i32tof32:
245 ; AVX-X64-NEXT: vcvtsi2ss %edi, %xmm0, %xmm0
248 ; X87-LABEL: sitofp_i32tof32:
250 ; X87-NEXT: pushl %eax
251 ; X87-NEXT: .cfi_def_cfa_offset 8
252 ; X87-NEXT: movl {{[0-9]+}}(%esp), %eax
253 ; X87-NEXT: movl %eax, (%esp)
254 ; X87-NEXT: fildl (%esp)
256 ; X87-NEXT: popl %eax
257 ; X87-NEXT: .cfi_def_cfa_offset 4
259 %result = call float @llvm.experimental.constrained.sitofp.f32.i32(i32 %x,
260 metadata !"round.dynamic",
261 metadata !"fpexcept.strict") #0
265 define float @sitofp_i64tof32(i64 %x) #0 {
266 ; SSE-X86-LABEL: sitofp_i64tof32:
268 ; SSE-X86-NEXT: pushl %eax
269 ; SSE-X86-NEXT: .cfi_def_cfa_offset 8
270 ; SSE-X86-NEXT: fildll {{[0-9]+}}(%esp)
271 ; SSE-X86-NEXT: fstps (%esp)
272 ; SSE-X86-NEXT: flds (%esp)
274 ; SSE-X86-NEXT: popl %eax
275 ; SSE-X86-NEXT: .cfi_def_cfa_offset 4
278 ; SSE-X64-LABEL: sitofp_i64tof32:
280 ; SSE-X64-NEXT: cvtsi2ss %rdi, %xmm0
283 ; AVX-X86-LABEL: sitofp_i64tof32:
285 ; AVX-X86-NEXT: pushl %eax
286 ; AVX-X86-NEXT: .cfi_def_cfa_offset 8
287 ; AVX-X86-NEXT: fildll {{[0-9]+}}(%esp)
288 ; AVX-X86-NEXT: fstps (%esp)
289 ; AVX-X86-NEXT: flds (%esp)
291 ; AVX-X86-NEXT: popl %eax
292 ; AVX-X86-NEXT: .cfi_def_cfa_offset 4
295 ; AVX-X64-LABEL: sitofp_i64tof32:
297 ; AVX-X64-NEXT: vcvtsi2ss %rdi, %xmm0, %xmm0
300 ; X87-LABEL: sitofp_i64tof32:
302 ; X87-NEXT: fildll {{[0-9]+}}(%esp)
305 %result = call float @llvm.experimental.constrained.sitofp.f32.i64(i64 %x,
306 metadata !"round.dynamic",
307 metadata !"fpexcept.strict") #0
311 define float @uitofp_i1tof32(i1 %x) #0 {
312 ; SSE-X86-LABEL: uitofp_i1tof32:
314 ; SSE-X86-NEXT: pushl %eax
315 ; SSE-X86-NEXT: .cfi_def_cfa_offset 8
316 ; SSE-X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
317 ; SSE-X86-NEXT: andb $1, %al
318 ; SSE-X86-NEXT: movzbl %al, %eax
319 ; SSE-X86-NEXT: cvtsi2ss %eax, %xmm0
320 ; SSE-X86-NEXT: movss %xmm0, (%esp)
321 ; SSE-X86-NEXT: flds (%esp)
323 ; SSE-X86-NEXT: popl %eax
324 ; SSE-X86-NEXT: .cfi_def_cfa_offset 4
327 ; SSE-X64-LABEL: uitofp_i1tof32:
329 ; SSE-X64-NEXT: andl $1, %edi
330 ; SSE-X64-NEXT: cvtsi2ss %edi, %xmm0
333 ; AVX-X86-LABEL: uitofp_i1tof32:
335 ; AVX-X86-NEXT: pushl %eax
336 ; AVX-X86-NEXT: .cfi_def_cfa_offset 8
337 ; AVX-X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
338 ; AVX-X86-NEXT: andb $1, %al
339 ; AVX-X86-NEXT: movzbl %al, %eax
340 ; AVX-X86-NEXT: vcvtsi2ss %eax, %xmm0, %xmm0
341 ; AVX-X86-NEXT: vmovss %xmm0, (%esp)
342 ; AVX-X86-NEXT: flds (%esp)
344 ; AVX-X86-NEXT: popl %eax
345 ; AVX-X86-NEXT: .cfi_def_cfa_offset 4
348 ; AVX-X64-LABEL: uitofp_i1tof32:
350 ; AVX-X64-NEXT: andl $1, %edi
351 ; AVX-X64-NEXT: vcvtsi2ss %edi, %xmm0, %xmm0
354 ; X87-LABEL: uitofp_i1tof32:
356 ; X87-NEXT: pushl %eax
357 ; X87-NEXT: .cfi_def_cfa_offset 8
358 ; X87-NEXT: movzbl {{[0-9]+}}(%esp), %eax
359 ; X87-NEXT: andb $1, %al
360 ; X87-NEXT: movzbl %al, %eax
361 ; X87-NEXT: movw %ax, {{[0-9]+}}(%esp)
362 ; X87-NEXT: filds {{[0-9]+}}(%esp)
364 ; X87-NEXT: popl %eax
365 ; X87-NEXT: .cfi_def_cfa_offset 4
367 %result = call float @llvm.experimental.constrained.uitofp.f32.i1(i1 %x,
368 metadata !"round.dynamic",
369 metadata !"fpexcept.strict") #0
373 define float @uitofp_i8tof32(i8 %x) #0 {
374 ; SSE-X86-LABEL: uitofp_i8tof32:
376 ; SSE-X86-NEXT: pushl %eax
377 ; SSE-X86-NEXT: .cfi_def_cfa_offset 8
378 ; SSE-X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
379 ; SSE-X86-NEXT: cvtsi2ss %eax, %xmm0
380 ; SSE-X86-NEXT: movss %xmm0, (%esp)
381 ; SSE-X86-NEXT: flds (%esp)
383 ; SSE-X86-NEXT: popl %eax
384 ; SSE-X86-NEXT: .cfi_def_cfa_offset 4
387 ; SSE-X64-LABEL: uitofp_i8tof32:
389 ; SSE-X64-NEXT: movzbl %dil, %eax
390 ; SSE-X64-NEXT: cvtsi2ss %eax, %xmm0
393 ; AVX-X86-LABEL: uitofp_i8tof32:
395 ; AVX-X86-NEXT: pushl %eax
396 ; AVX-X86-NEXT: .cfi_def_cfa_offset 8
397 ; AVX-X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
398 ; AVX-X86-NEXT: vcvtsi2ss %eax, %xmm0, %xmm0
399 ; AVX-X86-NEXT: vmovss %xmm0, (%esp)
400 ; AVX-X86-NEXT: flds (%esp)
402 ; AVX-X86-NEXT: popl %eax
403 ; AVX-X86-NEXT: .cfi_def_cfa_offset 4
406 ; AVX-X64-LABEL: uitofp_i8tof32:
408 ; AVX-X64-NEXT: movzbl %dil, %eax
409 ; AVX-X64-NEXT: vcvtsi2ss %eax, %xmm0, %xmm0
412 ; X87-LABEL: uitofp_i8tof32:
414 ; X87-NEXT: pushl %eax
415 ; X87-NEXT: .cfi_def_cfa_offset 8
416 ; X87-NEXT: movzbl {{[0-9]+}}(%esp), %eax
417 ; X87-NEXT: movw %ax, {{[0-9]+}}(%esp)
418 ; X87-NEXT: filds {{[0-9]+}}(%esp)
420 ; X87-NEXT: popl %eax
421 ; X87-NEXT: .cfi_def_cfa_offset 4
423 %result = call float @llvm.experimental.constrained.uitofp.f32.i8(i8 %x,
424 metadata !"round.dynamic",
425 metadata !"fpexcept.strict") #0
429 define float @uitofp_i16tof32(i16 %x) #0 {
430 ; SSE-X86-LABEL: uitofp_i16tof32:
432 ; SSE-X86-NEXT: pushl %eax
433 ; SSE-X86-NEXT: .cfi_def_cfa_offset 8
434 ; SSE-X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax
435 ; SSE-X86-NEXT: cvtsi2ss %eax, %xmm0
436 ; SSE-X86-NEXT: movss %xmm0, (%esp)
437 ; SSE-X86-NEXT: flds (%esp)
439 ; SSE-X86-NEXT: popl %eax
440 ; SSE-X86-NEXT: .cfi_def_cfa_offset 4
443 ; SSE-X64-LABEL: uitofp_i16tof32:
445 ; SSE-X64-NEXT: movzwl %di, %eax
446 ; SSE-X64-NEXT: cvtsi2ss %eax, %xmm0
449 ; AVX-X86-LABEL: uitofp_i16tof32:
451 ; AVX-X86-NEXT: pushl %eax
452 ; AVX-X86-NEXT: .cfi_def_cfa_offset 8
453 ; AVX-X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax
454 ; AVX-X86-NEXT: vcvtsi2ss %eax, %xmm0, %xmm0
455 ; AVX-X86-NEXT: vmovss %xmm0, (%esp)
456 ; AVX-X86-NEXT: flds (%esp)
458 ; AVX-X86-NEXT: popl %eax
459 ; AVX-X86-NEXT: .cfi_def_cfa_offset 4
462 ; AVX-X64-LABEL: uitofp_i16tof32:
464 ; AVX-X64-NEXT: movzwl %di, %eax
465 ; AVX-X64-NEXT: vcvtsi2ss %eax, %xmm0, %xmm0
468 ; X87-LABEL: uitofp_i16tof32:
470 ; X87-NEXT: pushl %eax
471 ; X87-NEXT: .cfi_def_cfa_offset 8
472 ; X87-NEXT: movzwl {{[0-9]+}}(%esp), %eax
473 ; X87-NEXT: movl %eax, (%esp)
474 ; X87-NEXT: fildl (%esp)
476 ; X87-NEXT: popl %eax
477 ; X87-NEXT: .cfi_def_cfa_offset 4
479 %result = call float @llvm.experimental.constrained.uitofp.f32.i16(i16 %x,
480 metadata !"round.dynamic",
481 metadata !"fpexcept.strict") #0
485 define float @uitofp_i32tof32(i32 %x) #0 {
486 ; SSE-X86-LABEL: uitofp_i32tof32:
488 ; SSE-X86-NEXT: pushl %ebp
489 ; SSE-X86-NEXT: .cfi_def_cfa_offset 8
490 ; SSE-X86-NEXT: .cfi_offset %ebp, -8
491 ; SSE-X86-NEXT: movl %esp, %ebp
492 ; SSE-X86-NEXT: .cfi_def_cfa_register %ebp
493 ; SSE-X86-NEXT: andl $-8, %esp
494 ; SSE-X86-NEXT: subl $16, %esp
495 ; SSE-X86-NEXT: movl 8(%ebp), %eax
496 ; SSE-X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
497 ; SSE-X86-NEXT: movl $0, {{[0-9]+}}(%esp)
498 ; SSE-X86-NEXT: fildll {{[0-9]+}}(%esp)
499 ; SSE-X86-NEXT: fstps {{[0-9]+}}(%esp)
500 ; SSE-X86-NEXT: flds {{[0-9]+}}(%esp)
502 ; SSE-X86-NEXT: movl %ebp, %esp
503 ; SSE-X86-NEXT: popl %ebp
504 ; SSE-X86-NEXT: .cfi_def_cfa %esp, 4
507 ; SSE-X64-LABEL: uitofp_i32tof32:
509 ; SSE-X64-NEXT: movl %edi, %eax
510 ; SSE-X64-NEXT: cvtsi2ss %rax, %xmm0
513 ; AVX1-X86-LABEL: uitofp_i32tof32:
515 ; AVX1-X86-NEXT: pushl %ebp
516 ; AVX1-X86-NEXT: .cfi_def_cfa_offset 8
517 ; AVX1-X86-NEXT: .cfi_offset %ebp, -8
518 ; AVX1-X86-NEXT: movl %esp, %ebp
519 ; AVX1-X86-NEXT: .cfi_def_cfa_register %ebp
520 ; AVX1-X86-NEXT: andl $-8, %esp
521 ; AVX1-X86-NEXT: subl $16, %esp
522 ; AVX1-X86-NEXT: movl 8(%ebp), %eax
523 ; AVX1-X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
524 ; AVX1-X86-NEXT: movl $0, {{[0-9]+}}(%esp)
525 ; AVX1-X86-NEXT: fildll {{[0-9]+}}(%esp)
526 ; AVX1-X86-NEXT: fstps {{[0-9]+}}(%esp)
527 ; AVX1-X86-NEXT: flds {{[0-9]+}}(%esp)
528 ; AVX1-X86-NEXT: wait
529 ; AVX1-X86-NEXT: movl %ebp, %esp
530 ; AVX1-X86-NEXT: popl %ebp
531 ; AVX1-X86-NEXT: .cfi_def_cfa %esp, 4
532 ; AVX1-X86-NEXT: retl
534 ; AVX1-X64-LABEL: uitofp_i32tof32:
536 ; AVX1-X64-NEXT: movl %edi, %eax
537 ; AVX1-X64-NEXT: vcvtsi2ss %rax, %xmm0, %xmm0
538 ; AVX1-X64-NEXT: retq
540 ; AVX512-X86-LABEL: uitofp_i32tof32:
541 ; AVX512-X86: # %bb.0:
542 ; AVX512-X86-NEXT: pushl %eax
543 ; AVX512-X86-NEXT: .cfi_def_cfa_offset 8
544 ; AVX512-X86-NEXT: vcvtusi2ssl {{[0-9]+}}(%esp), %xmm0, %xmm0
545 ; AVX512-X86-NEXT: vmovss %xmm0, (%esp)
546 ; AVX512-X86-NEXT: flds (%esp)
547 ; AVX512-X86-NEXT: wait
548 ; AVX512-X86-NEXT: popl %eax
549 ; AVX512-X86-NEXT: .cfi_def_cfa_offset 4
550 ; AVX512-X86-NEXT: retl
552 ; AVX512-X64-LABEL: uitofp_i32tof32:
553 ; AVX512-X64: # %bb.0:
554 ; AVX512-X64-NEXT: vcvtusi2ss %edi, %xmm0, %xmm0
555 ; AVX512-X64-NEXT: retq
557 ; X87-LABEL: uitofp_i32tof32:
559 ; X87-NEXT: pushl %ebp
560 ; X87-NEXT: .cfi_def_cfa_offset 8
561 ; X87-NEXT: .cfi_offset %ebp, -8
562 ; X87-NEXT: movl %esp, %ebp
563 ; X87-NEXT: .cfi_def_cfa_register %ebp
564 ; X87-NEXT: andl $-8, %esp
565 ; X87-NEXT: subl $8, %esp
566 ; X87-NEXT: movl 8(%ebp), %eax
567 ; X87-NEXT: movl %eax, (%esp)
568 ; X87-NEXT: movl $0, {{[0-9]+}}(%esp)
569 ; X87-NEXT: fildll (%esp)
571 ; X87-NEXT: movl %ebp, %esp
572 ; X87-NEXT: popl %ebp
573 ; X87-NEXT: .cfi_def_cfa %esp, 4
575 %result = call float @llvm.experimental.constrained.uitofp.f32.i32(i32 %x,
576 metadata !"round.dynamic",
577 metadata !"fpexcept.strict") #0
581 define float @uitofp_i64tof32(i64 %x) #0 {
582 ; SSE-X86-LABEL: uitofp_i64tof32:
584 ; SSE-X86-NEXT: pushl %ebp
585 ; SSE-X86-NEXT: .cfi_def_cfa_offset 8
586 ; SSE-X86-NEXT: .cfi_offset %ebp, -8
587 ; SSE-X86-NEXT: movl %esp, %ebp
588 ; SSE-X86-NEXT: .cfi_def_cfa_register %ebp
589 ; SSE-X86-NEXT: andl $-8, %esp
590 ; SSE-X86-NEXT: subl $16, %esp
591 ; SSE-X86-NEXT: movl 12(%ebp), %eax
592 ; SSE-X86-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
593 ; SSE-X86-NEXT: movlps %xmm0, {{[0-9]+}}(%esp)
594 ; SSE-X86-NEXT: shrl $31, %eax
595 ; SSE-X86-NEXT: fildll {{[0-9]+}}(%esp)
596 ; SSE-X86-NEXT: fadds {{\.?LCPI[0-9]+_[0-9]+}}(,%eax,4)
597 ; SSE-X86-NEXT: fstps {{[0-9]+}}(%esp)
599 ; SSE-X86-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
600 ; SSE-X86-NEXT: movss %xmm0, (%esp)
601 ; SSE-X86-NEXT: flds (%esp)
603 ; SSE-X86-NEXT: movl %ebp, %esp
604 ; SSE-X86-NEXT: popl %ebp
605 ; SSE-X86-NEXT: .cfi_def_cfa %esp, 4
608 ; SSE-X64-LABEL: uitofp_i64tof32:
610 ; SSE-X64-NEXT: movq %rdi, %rax
611 ; SSE-X64-NEXT: shrq %rax
612 ; SSE-X64-NEXT: movl %edi, %ecx
613 ; SSE-X64-NEXT: andl $1, %ecx
614 ; SSE-X64-NEXT: orq %rax, %rcx
615 ; SSE-X64-NEXT: testq %rdi, %rdi
616 ; SSE-X64-NEXT: cmovnsq %rdi, %rcx
617 ; SSE-X64-NEXT: cvtsi2ss %rcx, %xmm0
618 ; SSE-X64-NEXT: jns .LBB9_2
619 ; SSE-X64-NEXT: # %bb.1:
620 ; SSE-X64-NEXT: addss %xmm0, %xmm0
621 ; SSE-X64-NEXT: .LBB9_2:
624 ; AVX-X86-LABEL: uitofp_i64tof32:
626 ; AVX-X86-NEXT: pushl %ebp
627 ; AVX-X86-NEXT: .cfi_def_cfa_offset 8
628 ; AVX-X86-NEXT: .cfi_offset %ebp, -8
629 ; AVX-X86-NEXT: movl %esp, %ebp
630 ; AVX-X86-NEXT: .cfi_def_cfa_register %ebp
631 ; AVX-X86-NEXT: andl $-8, %esp
632 ; AVX-X86-NEXT: subl $16, %esp
633 ; AVX-X86-NEXT: movl 12(%ebp), %eax
634 ; AVX-X86-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
635 ; AVX-X86-NEXT: vmovlps %xmm0, {{[0-9]+}}(%esp)
636 ; AVX-X86-NEXT: shrl $31, %eax
637 ; AVX-X86-NEXT: fildll {{[0-9]+}}(%esp)
638 ; AVX-X86-NEXT: fadds {{\.?LCPI[0-9]+_[0-9]+}}(,%eax,4)
639 ; AVX-X86-NEXT: fstps {{[0-9]+}}(%esp)
641 ; AVX-X86-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero
642 ; AVX-X86-NEXT: vmovss %xmm0, (%esp)
643 ; AVX-X86-NEXT: flds (%esp)
645 ; AVX-X86-NEXT: movl %ebp, %esp
646 ; AVX-X86-NEXT: popl %ebp
647 ; AVX-X86-NEXT: .cfi_def_cfa %esp, 4
650 ; AVX1-X64-LABEL: uitofp_i64tof32:
652 ; AVX1-X64-NEXT: movq %rdi, %rax
653 ; AVX1-X64-NEXT: shrq %rax
654 ; AVX1-X64-NEXT: movl %edi, %ecx
655 ; AVX1-X64-NEXT: andl $1, %ecx
656 ; AVX1-X64-NEXT: orq %rax, %rcx
657 ; AVX1-X64-NEXT: testq %rdi, %rdi
658 ; AVX1-X64-NEXT: cmovnsq %rdi, %rcx
659 ; AVX1-X64-NEXT: vcvtsi2ss %rcx, %xmm0, %xmm0
660 ; AVX1-X64-NEXT: jns .LBB9_2
661 ; AVX1-X64-NEXT: # %bb.1:
662 ; AVX1-X64-NEXT: vaddss %xmm0, %xmm0, %xmm0
663 ; AVX1-X64-NEXT: .LBB9_2:
664 ; AVX1-X64-NEXT: retq
666 ; AVX512-X64-LABEL: uitofp_i64tof32:
667 ; AVX512-X64: # %bb.0:
668 ; AVX512-X64-NEXT: vcvtusi2ss %rdi, %xmm0, %xmm0
669 ; AVX512-X64-NEXT: retq
671 ; X87-LABEL: uitofp_i64tof32:
673 ; X87-NEXT: pushl %ebp
674 ; X87-NEXT: .cfi_def_cfa_offset 8
675 ; X87-NEXT: .cfi_offset %ebp, -8
676 ; X87-NEXT: movl %esp, %ebp
677 ; X87-NEXT: .cfi_def_cfa_register %ebp
678 ; X87-NEXT: andl $-8, %esp
679 ; X87-NEXT: subl $16, %esp
680 ; X87-NEXT: movl 8(%ebp), %eax
681 ; X87-NEXT: movl 12(%ebp), %ecx
682 ; X87-NEXT: movl %ecx, {{[0-9]+}}(%esp)
683 ; X87-NEXT: movl %eax, {{[0-9]+}}(%esp)
684 ; X87-NEXT: shrl $31, %ecx
685 ; X87-NEXT: fildll {{[0-9]+}}(%esp)
686 ; X87-NEXT: fadds {{\.?LCPI[0-9]+_[0-9]+}}(,%ecx,4)
687 ; X87-NEXT: fstps {{[0-9]+}}(%esp)
688 ; X87-NEXT: flds {{[0-9]+}}(%esp)
690 ; X87-NEXT: movl %ebp, %esp
691 ; X87-NEXT: popl %ebp
692 ; X87-NEXT: .cfi_def_cfa %esp, 4
694 %result = call float @llvm.experimental.constrained.uitofp.f32.i64(i64 %x,
695 metadata !"round.dynamic",
696 metadata !"fpexcept.strict") #0
700 define double @sitofp_i8tof64(i8 %x) #0 {
701 ; SSE-X86-LABEL: sitofp_i8tof64:
703 ; SSE-X86-NEXT: pushl %ebp
704 ; SSE-X86-NEXT: .cfi_def_cfa_offset 8
705 ; SSE-X86-NEXT: .cfi_offset %ebp, -8
706 ; SSE-X86-NEXT: movl %esp, %ebp
707 ; SSE-X86-NEXT: .cfi_def_cfa_register %ebp
708 ; SSE-X86-NEXT: andl $-8, %esp
709 ; SSE-X86-NEXT: subl $8, %esp
710 ; SSE-X86-NEXT: movsbl 8(%ebp), %eax
711 ; SSE-X86-NEXT: cvtsi2sd %eax, %xmm0
712 ; SSE-X86-NEXT: movsd %xmm0, (%esp)
713 ; SSE-X86-NEXT: fldl (%esp)
715 ; SSE-X86-NEXT: movl %ebp, %esp
716 ; SSE-X86-NEXT: popl %ebp
717 ; SSE-X86-NEXT: .cfi_def_cfa %esp, 4
720 ; SSE-X64-LABEL: sitofp_i8tof64:
722 ; SSE-X64-NEXT: movsbl %dil, %eax
723 ; SSE-X64-NEXT: cvtsi2sd %eax, %xmm0
726 ; AVX-X86-LABEL: sitofp_i8tof64:
728 ; AVX-X86-NEXT: pushl %ebp
729 ; AVX-X86-NEXT: .cfi_def_cfa_offset 8
730 ; AVX-X86-NEXT: .cfi_offset %ebp, -8
731 ; AVX-X86-NEXT: movl %esp, %ebp
732 ; AVX-X86-NEXT: .cfi_def_cfa_register %ebp
733 ; AVX-X86-NEXT: andl $-8, %esp
734 ; AVX-X86-NEXT: subl $8, %esp
735 ; AVX-X86-NEXT: movsbl 8(%ebp), %eax
736 ; AVX-X86-NEXT: vcvtsi2sd %eax, %xmm0, %xmm0
737 ; AVX-X86-NEXT: vmovsd %xmm0, (%esp)
738 ; AVX-X86-NEXT: fldl (%esp)
740 ; AVX-X86-NEXT: movl %ebp, %esp
741 ; AVX-X86-NEXT: popl %ebp
742 ; AVX-X86-NEXT: .cfi_def_cfa %esp, 4
745 ; AVX-X64-LABEL: sitofp_i8tof64:
747 ; AVX-X64-NEXT: movsbl %dil, %eax
748 ; AVX-X64-NEXT: vcvtsi2sd %eax, %xmm0, %xmm0
751 ; X87-LABEL: sitofp_i8tof64:
753 ; X87-NEXT: pushl %eax
754 ; X87-NEXT: .cfi_def_cfa_offset 8
755 ; X87-NEXT: movsbl {{[0-9]+}}(%esp), %eax
756 ; X87-NEXT: movw %ax, {{[0-9]+}}(%esp)
757 ; X87-NEXT: filds {{[0-9]+}}(%esp)
759 ; X87-NEXT: popl %eax
760 ; X87-NEXT: .cfi_def_cfa_offset 4
762 %result = call double @llvm.experimental.constrained.sitofp.f64.i8(i8 %x,
763 metadata !"round.dynamic",
764 metadata !"fpexcept.strict") #0
768 define double @sitofp_i16tof64(i16 %x) #0 {
769 ; SSE-X86-LABEL: sitofp_i16tof64:
771 ; SSE-X86-NEXT: pushl %ebp
772 ; SSE-X86-NEXT: .cfi_def_cfa_offset 8
773 ; SSE-X86-NEXT: .cfi_offset %ebp, -8
774 ; SSE-X86-NEXT: movl %esp, %ebp
775 ; SSE-X86-NEXT: .cfi_def_cfa_register %ebp
776 ; SSE-X86-NEXT: andl $-8, %esp
777 ; SSE-X86-NEXT: subl $8, %esp
778 ; SSE-X86-NEXT: movswl 8(%ebp), %eax
779 ; SSE-X86-NEXT: cvtsi2sd %eax, %xmm0
780 ; SSE-X86-NEXT: movsd %xmm0, (%esp)
781 ; SSE-X86-NEXT: fldl (%esp)
783 ; SSE-X86-NEXT: movl %ebp, %esp
784 ; SSE-X86-NEXT: popl %ebp
785 ; SSE-X86-NEXT: .cfi_def_cfa %esp, 4
788 ; SSE-X64-LABEL: sitofp_i16tof64:
790 ; SSE-X64-NEXT: movswl %di, %eax
791 ; SSE-X64-NEXT: cvtsi2sd %eax, %xmm0
794 ; AVX-X86-LABEL: sitofp_i16tof64:
796 ; AVX-X86-NEXT: pushl %ebp
797 ; AVX-X86-NEXT: .cfi_def_cfa_offset 8
798 ; AVX-X86-NEXT: .cfi_offset %ebp, -8
799 ; AVX-X86-NEXT: movl %esp, %ebp
800 ; AVX-X86-NEXT: .cfi_def_cfa_register %ebp
801 ; AVX-X86-NEXT: andl $-8, %esp
802 ; AVX-X86-NEXT: subl $8, %esp
803 ; AVX-X86-NEXT: movswl 8(%ebp), %eax
804 ; AVX-X86-NEXT: vcvtsi2sd %eax, %xmm0, %xmm0
805 ; AVX-X86-NEXT: vmovsd %xmm0, (%esp)
806 ; AVX-X86-NEXT: fldl (%esp)
808 ; AVX-X86-NEXT: movl %ebp, %esp
809 ; AVX-X86-NEXT: popl %ebp
810 ; AVX-X86-NEXT: .cfi_def_cfa %esp, 4
813 ; AVX-X64-LABEL: sitofp_i16tof64:
815 ; AVX-X64-NEXT: movswl %di, %eax
816 ; AVX-X64-NEXT: vcvtsi2sd %eax, %xmm0, %xmm0
819 ; X87-LABEL: sitofp_i16tof64:
821 ; X87-NEXT: pushl %eax
822 ; X87-NEXT: .cfi_def_cfa_offset 8
823 ; X87-NEXT: movzwl {{[0-9]+}}(%esp), %eax
824 ; X87-NEXT: movw %ax, {{[0-9]+}}(%esp)
825 ; X87-NEXT: filds {{[0-9]+}}(%esp)
827 ; X87-NEXT: popl %eax
828 ; X87-NEXT: .cfi_def_cfa_offset 4
830 %result = call double @llvm.experimental.constrained.sitofp.f64.i16(i16 %x,
831 metadata !"round.dynamic",
832 metadata !"fpexcept.strict") #0
836 define double @sitofp_i32tof64(i32 %x) #0 {
837 ; SSE-X86-LABEL: sitofp_i32tof64:
839 ; SSE-X86-NEXT: pushl %ebp
840 ; SSE-X86-NEXT: .cfi_def_cfa_offset 8
841 ; SSE-X86-NEXT: .cfi_offset %ebp, -8
842 ; SSE-X86-NEXT: movl %esp, %ebp
843 ; SSE-X86-NEXT: .cfi_def_cfa_register %ebp
844 ; SSE-X86-NEXT: andl $-8, %esp
845 ; SSE-X86-NEXT: subl $8, %esp
846 ; SSE-X86-NEXT: cvtsi2sdl 8(%ebp), %xmm0
847 ; SSE-X86-NEXT: movsd %xmm0, (%esp)
848 ; SSE-X86-NEXT: fldl (%esp)
850 ; SSE-X86-NEXT: movl %ebp, %esp
851 ; SSE-X86-NEXT: popl %ebp
852 ; SSE-X86-NEXT: .cfi_def_cfa %esp, 4
855 ; SSE-X64-LABEL: sitofp_i32tof64:
857 ; SSE-X64-NEXT: cvtsi2sd %edi, %xmm0
860 ; AVX-X86-LABEL: sitofp_i32tof64:
862 ; AVX-X86-NEXT: pushl %ebp
863 ; AVX-X86-NEXT: .cfi_def_cfa_offset 8
864 ; AVX-X86-NEXT: .cfi_offset %ebp, -8
865 ; AVX-X86-NEXT: movl %esp, %ebp
866 ; AVX-X86-NEXT: .cfi_def_cfa_register %ebp
867 ; AVX-X86-NEXT: andl $-8, %esp
868 ; AVX-X86-NEXT: subl $8, %esp
869 ; AVX-X86-NEXT: vcvtsi2sdl 8(%ebp), %xmm0, %xmm0
870 ; AVX-X86-NEXT: vmovsd %xmm0, (%esp)
871 ; AVX-X86-NEXT: fldl (%esp)
873 ; AVX-X86-NEXT: movl %ebp, %esp
874 ; AVX-X86-NEXT: popl %ebp
875 ; AVX-X86-NEXT: .cfi_def_cfa %esp, 4
878 ; AVX-X64-LABEL: sitofp_i32tof64:
880 ; AVX-X64-NEXT: vcvtsi2sd %edi, %xmm0, %xmm0
883 ; X87-LABEL: sitofp_i32tof64:
885 ; X87-NEXT: pushl %eax
886 ; X87-NEXT: .cfi_def_cfa_offset 8
887 ; X87-NEXT: movl {{[0-9]+}}(%esp), %eax
888 ; X87-NEXT: movl %eax, (%esp)
889 ; X87-NEXT: fildl (%esp)
891 ; X87-NEXT: popl %eax
892 ; X87-NEXT: .cfi_def_cfa_offset 4
894 %result = call double @llvm.experimental.constrained.sitofp.f64.i32(i32 %x,
895 metadata !"round.dynamic",
896 metadata !"fpexcept.strict") #0
900 define double @sitofp_i64tof64(i64 %x) #0 {
901 ; SSE-X86-LABEL: sitofp_i64tof64:
903 ; SSE-X86-NEXT: pushl %ebp
904 ; SSE-X86-NEXT: .cfi_def_cfa_offset 8
905 ; SSE-X86-NEXT: .cfi_offset %ebp, -8
906 ; SSE-X86-NEXT: movl %esp, %ebp
907 ; SSE-X86-NEXT: .cfi_def_cfa_register %ebp
908 ; SSE-X86-NEXT: andl $-8, %esp
909 ; SSE-X86-NEXT: subl $8, %esp
910 ; SSE-X86-NEXT: fildll 8(%ebp)
911 ; SSE-X86-NEXT: fstpl (%esp)
912 ; SSE-X86-NEXT: fldl (%esp)
914 ; SSE-X86-NEXT: movl %ebp, %esp
915 ; SSE-X86-NEXT: popl %ebp
916 ; SSE-X86-NEXT: .cfi_def_cfa %esp, 4
919 ; SSE-X64-LABEL: sitofp_i64tof64:
921 ; SSE-X64-NEXT: cvtsi2sd %rdi, %xmm0
924 ; AVX-X86-LABEL: sitofp_i64tof64:
926 ; AVX-X86-NEXT: pushl %ebp
927 ; AVX-X86-NEXT: .cfi_def_cfa_offset 8
928 ; AVX-X86-NEXT: .cfi_offset %ebp, -8
929 ; AVX-X86-NEXT: movl %esp, %ebp
930 ; AVX-X86-NEXT: .cfi_def_cfa_register %ebp
931 ; AVX-X86-NEXT: andl $-8, %esp
932 ; AVX-X86-NEXT: subl $8, %esp
933 ; AVX-X86-NEXT: fildll 8(%ebp)
934 ; AVX-X86-NEXT: fstpl (%esp)
935 ; AVX-X86-NEXT: fldl (%esp)
937 ; AVX-X86-NEXT: movl %ebp, %esp
938 ; AVX-X86-NEXT: popl %ebp
939 ; AVX-X86-NEXT: .cfi_def_cfa %esp, 4
942 ; AVX-X64-LABEL: sitofp_i64tof64:
944 ; AVX-X64-NEXT: vcvtsi2sd %rdi, %xmm0, %xmm0
947 ; X87-LABEL: sitofp_i64tof64:
949 ; X87-NEXT: fildll {{[0-9]+}}(%esp)
952 %result = call double @llvm.experimental.constrained.sitofp.f64.i64(i64 %x,
953 metadata !"round.dynamic",
954 metadata !"fpexcept.strict") #0
958 define double @uitofp_i1tof64(i1 %x) #0 {
959 ; SSE-X86-LABEL: uitofp_i1tof64:
961 ; SSE-X86-NEXT: pushl %ebp
962 ; SSE-X86-NEXT: .cfi_def_cfa_offset 8
963 ; SSE-X86-NEXT: .cfi_offset %ebp, -8
964 ; SSE-X86-NEXT: movl %esp, %ebp
965 ; SSE-X86-NEXT: .cfi_def_cfa_register %ebp
966 ; SSE-X86-NEXT: andl $-8, %esp
967 ; SSE-X86-NEXT: subl $8, %esp
968 ; SSE-X86-NEXT: movzbl 8(%ebp), %eax
969 ; SSE-X86-NEXT: andb $1, %al
970 ; SSE-X86-NEXT: movzbl %al, %eax
971 ; SSE-X86-NEXT: cvtsi2sd %eax, %xmm0
972 ; SSE-X86-NEXT: movsd %xmm0, (%esp)
973 ; SSE-X86-NEXT: fldl (%esp)
975 ; SSE-X86-NEXT: movl %ebp, %esp
976 ; SSE-X86-NEXT: popl %ebp
977 ; SSE-X86-NEXT: .cfi_def_cfa %esp, 4
980 ; SSE-X64-LABEL: uitofp_i1tof64:
982 ; SSE-X64-NEXT: andl $1, %edi
983 ; SSE-X64-NEXT: cvtsi2sd %edi, %xmm0
986 ; AVX-X86-LABEL: uitofp_i1tof64:
988 ; AVX-X86-NEXT: pushl %ebp
989 ; AVX-X86-NEXT: .cfi_def_cfa_offset 8
990 ; AVX-X86-NEXT: .cfi_offset %ebp, -8
991 ; AVX-X86-NEXT: movl %esp, %ebp
992 ; AVX-X86-NEXT: .cfi_def_cfa_register %ebp
993 ; AVX-X86-NEXT: andl $-8, %esp
994 ; AVX-X86-NEXT: subl $8, %esp
995 ; AVX-X86-NEXT: movzbl 8(%ebp), %eax
996 ; AVX-X86-NEXT: andb $1, %al
997 ; AVX-X86-NEXT: movzbl %al, %eax
998 ; AVX-X86-NEXT: vcvtsi2sd %eax, %xmm0, %xmm0
999 ; AVX-X86-NEXT: vmovsd %xmm0, (%esp)
1000 ; AVX-X86-NEXT: fldl (%esp)
1001 ; AVX-X86-NEXT: wait
1002 ; AVX-X86-NEXT: movl %ebp, %esp
1003 ; AVX-X86-NEXT: popl %ebp
1004 ; AVX-X86-NEXT: .cfi_def_cfa %esp, 4
1005 ; AVX-X86-NEXT: retl
1007 ; AVX-X64-LABEL: uitofp_i1tof64:
1009 ; AVX-X64-NEXT: andl $1, %edi
1010 ; AVX-X64-NEXT: vcvtsi2sd %edi, %xmm0, %xmm0
1011 ; AVX-X64-NEXT: retq
1013 ; X87-LABEL: uitofp_i1tof64:
1015 ; X87-NEXT: pushl %eax
1016 ; X87-NEXT: .cfi_def_cfa_offset 8
1017 ; X87-NEXT: movzbl {{[0-9]+}}(%esp), %eax
1018 ; X87-NEXT: andb $1, %al
1019 ; X87-NEXT: movzbl %al, %eax
1020 ; X87-NEXT: movw %ax, {{[0-9]+}}(%esp)
1021 ; X87-NEXT: filds {{[0-9]+}}(%esp)
1023 ; X87-NEXT: popl %eax
1024 ; X87-NEXT: .cfi_def_cfa_offset 4
1026 %result = call double @llvm.experimental.constrained.uitofp.f64.i1(i1 %x,
1027 metadata !"round.dynamic",
1028 metadata !"fpexcept.strict") #0
1032 define double @uitofp_i8tof64(i8 %x) #0 {
1033 ; SSE-X86-LABEL: uitofp_i8tof64:
1035 ; SSE-X86-NEXT: pushl %ebp
1036 ; SSE-X86-NEXT: .cfi_def_cfa_offset 8
1037 ; SSE-X86-NEXT: .cfi_offset %ebp, -8
1038 ; SSE-X86-NEXT: movl %esp, %ebp
1039 ; SSE-X86-NEXT: .cfi_def_cfa_register %ebp
1040 ; SSE-X86-NEXT: andl $-8, %esp
1041 ; SSE-X86-NEXT: subl $8, %esp
1042 ; SSE-X86-NEXT: movzbl 8(%ebp), %eax
1043 ; SSE-X86-NEXT: cvtsi2sd %eax, %xmm0
1044 ; SSE-X86-NEXT: movsd %xmm0, (%esp)
1045 ; SSE-X86-NEXT: fldl (%esp)
1046 ; SSE-X86-NEXT: wait
1047 ; SSE-X86-NEXT: movl %ebp, %esp
1048 ; SSE-X86-NEXT: popl %ebp
1049 ; SSE-X86-NEXT: .cfi_def_cfa %esp, 4
1050 ; SSE-X86-NEXT: retl
1052 ; SSE-X64-LABEL: uitofp_i8tof64:
1054 ; SSE-X64-NEXT: movzbl %dil, %eax
1055 ; SSE-X64-NEXT: cvtsi2sd %eax, %xmm0
1056 ; SSE-X64-NEXT: retq
1058 ; AVX-X86-LABEL: uitofp_i8tof64:
1060 ; AVX-X86-NEXT: pushl %ebp
1061 ; AVX-X86-NEXT: .cfi_def_cfa_offset 8
1062 ; AVX-X86-NEXT: .cfi_offset %ebp, -8
1063 ; AVX-X86-NEXT: movl %esp, %ebp
1064 ; AVX-X86-NEXT: .cfi_def_cfa_register %ebp
1065 ; AVX-X86-NEXT: andl $-8, %esp
1066 ; AVX-X86-NEXT: subl $8, %esp
1067 ; AVX-X86-NEXT: movzbl 8(%ebp), %eax
1068 ; AVX-X86-NEXT: vcvtsi2sd %eax, %xmm0, %xmm0
1069 ; AVX-X86-NEXT: vmovsd %xmm0, (%esp)
1070 ; AVX-X86-NEXT: fldl (%esp)
1071 ; AVX-X86-NEXT: wait
1072 ; AVX-X86-NEXT: movl %ebp, %esp
1073 ; AVX-X86-NEXT: popl %ebp
1074 ; AVX-X86-NEXT: .cfi_def_cfa %esp, 4
1075 ; AVX-X86-NEXT: retl
1077 ; AVX-X64-LABEL: uitofp_i8tof64:
1079 ; AVX-X64-NEXT: movzbl %dil, %eax
1080 ; AVX-X64-NEXT: vcvtsi2sd %eax, %xmm0, %xmm0
1081 ; AVX-X64-NEXT: retq
1083 ; X87-LABEL: uitofp_i8tof64:
1085 ; X87-NEXT: pushl %eax
1086 ; X87-NEXT: .cfi_def_cfa_offset 8
1087 ; X87-NEXT: movzbl {{[0-9]+}}(%esp), %eax
1088 ; X87-NEXT: movw %ax, {{[0-9]+}}(%esp)
1089 ; X87-NEXT: filds {{[0-9]+}}(%esp)
1091 ; X87-NEXT: popl %eax
1092 ; X87-NEXT: .cfi_def_cfa_offset 4
1094 %result = call double @llvm.experimental.constrained.uitofp.f64.i8(i8 %x,
1095 metadata !"round.dynamic",
1096 metadata !"fpexcept.strict") #0
1100 define double @uitofp_i16tof64(i16 %x) #0 {
1101 ; SSE-X86-LABEL: uitofp_i16tof64:
1103 ; SSE-X86-NEXT: pushl %ebp
1104 ; SSE-X86-NEXT: .cfi_def_cfa_offset 8
1105 ; SSE-X86-NEXT: .cfi_offset %ebp, -8
1106 ; SSE-X86-NEXT: movl %esp, %ebp
1107 ; SSE-X86-NEXT: .cfi_def_cfa_register %ebp
1108 ; SSE-X86-NEXT: andl $-8, %esp
1109 ; SSE-X86-NEXT: subl $8, %esp
1110 ; SSE-X86-NEXT: movzwl 8(%ebp), %eax
1111 ; SSE-X86-NEXT: cvtsi2sd %eax, %xmm0
1112 ; SSE-X86-NEXT: movsd %xmm0, (%esp)
1113 ; SSE-X86-NEXT: fldl (%esp)
1114 ; SSE-X86-NEXT: wait
1115 ; SSE-X86-NEXT: movl %ebp, %esp
1116 ; SSE-X86-NEXT: popl %ebp
1117 ; SSE-X86-NEXT: .cfi_def_cfa %esp, 4
1118 ; SSE-X86-NEXT: retl
1120 ; SSE-X64-LABEL: uitofp_i16tof64:
1122 ; SSE-X64-NEXT: movzwl %di, %eax
1123 ; SSE-X64-NEXT: cvtsi2sd %eax, %xmm0
1124 ; SSE-X64-NEXT: retq
1126 ; AVX-X86-LABEL: uitofp_i16tof64:
1128 ; AVX-X86-NEXT: pushl %ebp
1129 ; AVX-X86-NEXT: .cfi_def_cfa_offset 8
1130 ; AVX-X86-NEXT: .cfi_offset %ebp, -8
1131 ; AVX-X86-NEXT: movl %esp, %ebp
1132 ; AVX-X86-NEXT: .cfi_def_cfa_register %ebp
1133 ; AVX-X86-NEXT: andl $-8, %esp
1134 ; AVX-X86-NEXT: subl $8, %esp
1135 ; AVX-X86-NEXT: movzwl 8(%ebp), %eax
1136 ; AVX-X86-NEXT: vcvtsi2sd %eax, %xmm0, %xmm0
1137 ; AVX-X86-NEXT: vmovsd %xmm0, (%esp)
1138 ; AVX-X86-NEXT: fldl (%esp)
1139 ; AVX-X86-NEXT: wait
1140 ; AVX-X86-NEXT: movl %ebp, %esp
1141 ; AVX-X86-NEXT: popl %ebp
1142 ; AVX-X86-NEXT: .cfi_def_cfa %esp, 4
1143 ; AVX-X86-NEXT: retl
1145 ; AVX-X64-LABEL: uitofp_i16tof64:
1147 ; AVX-X64-NEXT: movzwl %di, %eax
1148 ; AVX-X64-NEXT: vcvtsi2sd %eax, %xmm0, %xmm0
1149 ; AVX-X64-NEXT: retq
1151 ; X87-LABEL: uitofp_i16tof64:
1153 ; X87-NEXT: pushl %eax
1154 ; X87-NEXT: .cfi_def_cfa_offset 8
1155 ; X87-NEXT: movzwl {{[0-9]+}}(%esp), %eax
1156 ; X87-NEXT: movl %eax, (%esp)
1157 ; X87-NEXT: fildl (%esp)
1159 ; X87-NEXT: popl %eax
1160 ; X87-NEXT: .cfi_def_cfa_offset 4
1162 %result = call double @llvm.experimental.constrained.uitofp.f64.i16(i16 %x,
1163 metadata !"round.dynamic",
1164 metadata !"fpexcept.strict") #0
1168 define double @uitofp_i32tof64(i32 %x) #0 {
1169 ; SSE-X86-LABEL: uitofp_i32tof64:
1171 ; SSE-X86-NEXT: pushl %ebp
1172 ; SSE-X86-NEXT: .cfi_def_cfa_offset 8
1173 ; SSE-X86-NEXT: .cfi_offset %ebp, -8
1174 ; SSE-X86-NEXT: movl %esp, %ebp
1175 ; SSE-X86-NEXT: .cfi_def_cfa_register %ebp
1176 ; SSE-X86-NEXT: andl $-8, %esp
1177 ; SSE-X86-NEXT: subl $16, %esp
1178 ; SSE-X86-NEXT: movl 8(%ebp), %eax
1179 ; SSE-X86-NEXT: movl %eax, (%esp)
1180 ; SSE-X86-NEXT: movl $0, {{[0-9]+}}(%esp)
1181 ; SSE-X86-NEXT: fildll (%esp)
1182 ; SSE-X86-NEXT: fstpl {{[0-9]+}}(%esp)
1183 ; SSE-X86-NEXT: fldl {{[0-9]+}}(%esp)
1184 ; SSE-X86-NEXT: wait
1185 ; SSE-X86-NEXT: movl %ebp, %esp
1186 ; SSE-X86-NEXT: popl %ebp
1187 ; SSE-X86-NEXT: .cfi_def_cfa %esp, 4
1188 ; SSE-X86-NEXT: retl
1190 ; SSE-X64-LABEL: uitofp_i32tof64:
1192 ; SSE-X64-NEXT: movl %edi, %eax
1193 ; SSE-X64-NEXT: cvtsi2sd %rax, %xmm0
1194 ; SSE-X64-NEXT: retq
1196 ; AVX1-X86-LABEL: uitofp_i32tof64:
1197 ; AVX1-X86: # %bb.0:
1198 ; AVX1-X86-NEXT: pushl %ebp
1199 ; AVX1-X86-NEXT: .cfi_def_cfa_offset 8
1200 ; AVX1-X86-NEXT: .cfi_offset %ebp, -8
1201 ; AVX1-X86-NEXT: movl %esp, %ebp
1202 ; AVX1-X86-NEXT: .cfi_def_cfa_register %ebp
1203 ; AVX1-X86-NEXT: andl $-8, %esp
1204 ; AVX1-X86-NEXT: subl $16, %esp
1205 ; AVX1-X86-NEXT: movl 8(%ebp), %eax
1206 ; AVX1-X86-NEXT: movl %eax, (%esp)
1207 ; AVX1-X86-NEXT: movl $0, {{[0-9]+}}(%esp)
1208 ; AVX1-X86-NEXT: fildll (%esp)
1209 ; AVX1-X86-NEXT: fstpl {{[0-9]+}}(%esp)
1210 ; AVX1-X86-NEXT: fldl {{[0-9]+}}(%esp)
1211 ; AVX1-X86-NEXT: wait
1212 ; AVX1-X86-NEXT: movl %ebp, %esp
1213 ; AVX1-X86-NEXT: popl %ebp
1214 ; AVX1-X86-NEXT: .cfi_def_cfa %esp, 4
1215 ; AVX1-X86-NEXT: retl
1217 ; AVX1-X64-LABEL: uitofp_i32tof64:
1218 ; AVX1-X64: # %bb.0:
1219 ; AVX1-X64-NEXT: movl %edi, %eax
1220 ; AVX1-X64-NEXT: vcvtsi2sd %rax, %xmm0, %xmm0
1221 ; AVX1-X64-NEXT: retq
1223 ; AVX512-X86-LABEL: uitofp_i32tof64:
1224 ; AVX512-X86: # %bb.0:
1225 ; AVX512-X86-NEXT: pushl %ebp
1226 ; AVX512-X86-NEXT: .cfi_def_cfa_offset 8
1227 ; AVX512-X86-NEXT: .cfi_offset %ebp, -8
1228 ; AVX512-X86-NEXT: movl %esp, %ebp
1229 ; AVX512-X86-NEXT: .cfi_def_cfa_register %ebp
1230 ; AVX512-X86-NEXT: andl $-8, %esp
1231 ; AVX512-X86-NEXT: subl $8, %esp
1232 ; AVX512-X86-NEXT: vcvtusi2sdl 8(%ebp), %xmm0, %xmm0
1233 ; AVX512-X86-NEXT: vmovsd %xmm0, (%esp)
1234 ; AVX512-X86-NEXT: fldl (%esp)
1235 ; AVX512-X86-NEXT: wait
1236 ; AVX512-X86-NEXT: movl %ebp, %esp
1237 ; AVX512-X86-NEXT: popl %ebp
1238 ; AVX512-X86-NEXT: .cfi_def_cfa %esp, 4
1239 ; AVX512-X86-NEXT: retl
1241 ; AVX512-X64-LABEL: uitofp_i32tof64:
1242 ; AVX512-X64: # %bb.0:
1243 ; AVX512-X64-NEXT: vcvtusi2sd %edi, %xmm0, %xmm0
1244 ; AVX512-X64-NEXT: retq
1246 ; X87-LABEL: uitofp_i32tof64:
1248 ; X87-NEXT: pushl %ebp
1249 ; X87-NEXT: .cfi_def_cfa_offset 8
1250 ; X87-NEXT: .cfi_offset %ebp, -8
1251 ; X87-NEXT: movl %esp, %ebp
1252 ; X87-NEXT: .cfi_def_cfa_register %ebp
1253 ; X87-NEXT: andl $-8, %esp
1254 ; X87-NEXT: subl $8, %esp
1255 ; X87-NEXT: movl 8(%ebp), %eax
1256 ; X87-NEXT: movl %eax, (%esp)
1257 ; X87-NEXT: movl $0, {{[0-9]+}}(%esp)
1258 ; X87-NEXT: fildll (%esp)
1260 ; X87-NEXT: movl %ebp, %esp
1261 ; X87-NEXT: popl %ebp
1262 ; X87-NEXT: .cfi_def_cfa %esp, 4
1264 %result = call double @llvm.experimental.constrained.uitofp.f64.i32(i32 %x,
1265 metadata !"round.dynamic",
1266 metadata !"fpexcept.strict") #0
1270 define double @uitofp_i64tof64(i64 %x) #0 {
1271 ; SSE-X86-LABEL: uitofp_i64tof64:
1273 ; SSE-X86-NEXT: pushl %ebp
1274 ; SSE-X86-NEXT: .cfi_def_cfa_offset 8
1275 ; SSE-X86-NEXT: .cfi_offset %ebp, -8
1276 ; SSE-X86-NEXT: movl %esp, %ebp
1277 ; SSE-X86-NEXT: .cfi_def_cfa_register %ebp
1278 ; SSE-X86-NEXT: andl $-8, %esp
1279 ; SSE-X86-NEXT: subl $24, %esp
1280 ; SSE-X86-NEXT: movl 12(%ebp), %eax
1281 ; SSE-X86-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
1282 ; SSE-X86-NEXT: movlps %xmm0, {{[0-9]+}}(%esp)
1283 ; SSE-X86-NEXT: shrl $31, %eax
1284 ; SSE-X86-NEXT: fildll {{[0-9]+}}(%esp)
1285 ; SSE-X86-NEXT: fadds {{\.?LCPI[0-9]+_[0-9]+}}(,%eax,4)
1286 ; SSE-X86-NEXT: fstpl {{[0-9]+}}(%esp)
1287 ; SSE-X86-NEXT: wait
1288 ; SSE-X86-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
1289 ; SSE-X86-NEXT: movsd %xmm0, (%esp)
1290 ; SSE-X86-NEXT: fldl (%esp)
1291 ; SSE-X86-NEXT: wait
1292 ; SSE-X86-NEXT: movl %ebp, %esp
1293 ; SSE-X86-NEXT: popl %ebp
1294 ; SSE-X86-NEXT: .cfi_def_cfa %esp, 4
1295 ; SSE-X86-NEXT: retl
1297 ; SSE-X64-LABEL: uitofp_i64tof64:
1299 ; SSE-X64-NEXT: movq %rdi, %rax
1300 ; SSE-X64-NEXT: shrq %rax
1301 ; SSE-X64-NEXT: movl %edi, %ecx
1302 ; SSE-X64-NEXT: andl $1, %ecx
1303 ; SSE-X64-NEXT: orq %rax, %rcx
1304 ; SSE-X64-NEXT: testq %rdi, %rdi
1305 ; SSE-X64-NEXT: cmovnsq %rdi, %rcx
1306 ; SSE-X64-NEXT: cvtsi2sd %rcx, %xmm0
1307 ; SSE-X64-NEXT: jns .LBB18_2
1308 ; SSE-X64-NEXT: # %bb.1:
1309 ; SSE-X64-NEXT: addsd %xmm0, %xmm0
1310 ; SSE-X64-NEXT: .LBB18_2:
1311 ; SSE-X64-NEXT: retq
1313 ; AVX-X86-LABEL: uitofp_i64tof64:
1315 ; AVX-X86-NEXT: pushl %ebp
1316 ; AVX-X86-NEXT: .cfi_def_cfa_offset 8
1317 ; AVX-X86-NEXT: .cfi_offset %ebp, -8
1318 ; AVX-X86-NEXT: movl %esp, %ebp
1319 ; AVX-X86-NEXT: .cfi_def_cfa_register %ebp
1320 ; AVX-X86-NEXT: andl $-8, %esp
1321 ; AVX-X86-NEXT: subl $24, %esp
1322 ; AVX-X86-NEXT: movl 12(%ebp), %eax
1323 ; AVX-X86-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
1324 ; AVX-X86-NEXT: vmovlps %xmm0, {{[0-9]+}}(%esp)
1325 ; AVX-X86-NEXT: shrl $31, %eax
1326 ; AVX-X86-NEXT: fildll {{[0-9]+}}(%esp)
1327 ; AVX-X86-NEXT: fadds {{\.?LCPI[0-9]+_[0-9]+}}(,%eax,4)
1328 ; AVX-X86-NEXT: fstpl {{[0-9]+}}(%esp)
1329 ; AVX-X86-NEXT: wait
1330 ; AVX-X86-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
1331 ; AVX-X86-NEXT: vmovsd %xmm0, (%esp)
1332 ; AVX-X86-NEXT: fldl (%esp)
1333 ; AVX-X86-NEXT: wait
1334 ; AVX-X86-NEXT: movl %ebp, %esp
1335 ; AVX-X86-NEXT: popl %ebp
1336 ; AVX-X86-NEXT: .cfi_def_cfa %esp, 4
1337 ; AVX-X86-NEXT: retl
1339 ; AVX1-X64-LABEL: uitofp_i64tof64:
1340 ; AVX1-X64: # %bb.0:
1341 ; AVX1-X64-NEXT: movq %rdi, %rax
1342 ; AVX1-X64-NEXT: shrq %rax
1343 ; AVX1-X64-NEXT: movl %edi, %ecx
1344 ; AVX1-X64-NEXT: andl $1, %ecx
1345 ; AVX1-X64-NEXT: orq %rax, %rcx
1346 ; AVX1-X64-NEXT: testq %rdi, %rdi
1347 ; AVX1-X64-NEXT: cmovnsq %rdi, %rcx
1348 ; AVX1-X64-NEXT: vcvtsi2sd %rcx, %xmm0, %xmm0
1349 ; AVX1-X64-NEXT: jns .LBB18_2
1350 ; AVX1-X64-NEXT: # %bb.1:
1351 ; AVX1-X64-NEXT: vaddsd %xmm0, %xmm0, %xmm0
1352 ; AVX1-X64-NEXT: .LBB18_2:
1353 ; AVX1-X64-NEXT: retq
1355 ; AVX512-X64-LABEL: uitofp_i64tof64:
1356 ; AVX512-X64: # %bb.0:
1357 ; AVX512-X64-NEXT: vcvtusi2sd %rdi, %xmm0, %xmm0
1358 ; AVX512-X64-NEXT: retq
1360 ; X87-LABEL: uitofp_i64tof64:
1362 ; X87-NEXT: pushl %ebp
1363 ; X87-NEXT: .cfi_def_cfa_offset 8
1364 ; X87-NEXT: .cfi_offset %ebp, -8
1365 ; X87-NEXT: movl %esp, %ebp
1366 ; X87-NEXT: .cfi_def_cfa_register %ebp
1367 ; X87-NEXT: andl $-8, %esp
1368 ; X87-NEXT: subl $16, %esp
1369 ; X87-NEXT: movl 8(%ebp), %eax
1370 ; X87-NEXT: movl 12(%ebp), %ecx
1371 ; X87-NEXT: movl %ecx, {{[0-9]+}}(%esp)
1372 ; X87-NEXT: movl %eax, (%esp)
1373 ; X87-NEXT: shrl $31, %ecx
1374 ; X87-NEXT: fildll (%esp)
1375 ; X87-NEXT: fadds {{\.?LCPI[0-9]+_[0-9]+}}(,%ecx,4)
1376 ; X87-NEXT: fstpl {{[0-9]+}}(%esp)
1377 ; X87-NEXT: fldl {{[0-9]+}}(%esp)
1379 ; X87-NEXT: movl %ebp, %esp
1380 ; X87-NEXT: popl %ebp
1381 ; X87-NEXT: .cfi_def_cfa %esp, 4
1383 %result = call double @llvm.experimental.constrained.uitofp.f64.i64(i64 %x,
1384 metadata !"round.dynamic",
1385 metadata !"fpexcept.strict") #0
1389 attributes #0 = { strictfp }