1; RUN: llc -mtriple=x86_64-unknown-unknown -mcpu=generic -mattr=+sse2 -fast-isel --fast-isel-abort=1 < %s | FileCheck %s --check-prefix=ALL --check-prefix=SSE2
2; RUN: llc -mtriple=x86_64-unknown-unknown -mcpu=generic -mattr=+avx -fast-isel --fast-isel-abort=1 < %s | FileCheck %s --check-prefix=ALL --check-prefix=AVX
3
4
5define double @int_to_double_rr(i32 %a) {
6; ALL-LABEL: int_to_double_rr:
7; SSE2: cvtsi2sdl %edi, %xmm0
8; AVX: vcvtsi2sdl %edi, %xmm0, %xmm0
9; ALL-NEXT: ret
10entry:
11  %0 = sitofp i32 %a to double
12  ret double %0
13}
14
15define double @int_to_double_rm(i32* %a) {
16; ALL-LABEL: int_to_double_rm:
17; SSE2: cvtsi2sdl (%rdi), %xmm0
18; AVX: vcvtsi2sdl (%rdi), %xmm0, %xmm0
19; ALL-NEXT: ret
20entry:
21  %0 = load i32, i32* %a
22  %1 = sitofp i32 %0 to double
23  ret double %1
24}
25
26define float @int_to_float_rr(i32 %a) {
27; ALL-LABEL: int_to_float_rr:
28; SSE2: cvtsi2ssl %edi, %xmm0
29; AVX: vcvtsi2ssl %edi, %xmm0, %xmm0
30; ALL-NEXT: ret
31entry:
32  %0 = sitofp i32 %a to float
33  ret float %0
34}
35
36define float @int_to_float_rm(i32* %a) {
37; ALL-LABEL: int_to_float_rm:
38; SSE2: cvtsi2ssl (%rdi), %xmm0
39; AVX: vcvtsi2ssl (%rdi), %xmm0, %xmm0
40; ALL-NEXT: ret
41entry:
42  %0 = load i32, i32* %a
43  %1 = sitofp i32 %0 to float
44  ret float %1
45}
46