1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; 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
3 ; 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
4 ; RUN: llc -mtriple=x86_64-unknown-unknown -mcpu=generic -mattr=+avx512f -fast-isel --fast-isel-abort=1 < %s | FileCheck %s --check-prefix=ALL --check-prefix=AVX
7 define double @long_to_double_rr(i64 %a) {
8 ; SSE2-LABEL: long_to_double_rr:
9 ; SSE2: # %bb.0: # %entry
10 ; SSE2-NEXT: cvtsi2sd %rdi, %xmm0
13 ; AVX-LABEL: long_to_double_rr:
14 ; AVX: # %bb.0: # %entry
15 ; AVX-NEXT: vcvtsi2sd %rdi, %xmm0, %xmm0
18 %0 = sitofp i64 %a to double
22 define double @long_to_double_rm(i64* %a) {
23 ; SSE2-LABEL: long_to_double_rm:
24 ; SSE2: # %bb.0: # %entry
25 ; SSE2-NEXT: cvtsi2sdq (%rdi), %xmm0
28 ; AVX-LABEL: long_to_double_rm:
29 ; AVX: # %bb.0: # %entry
30 ; AVX-NEXT: vcvtsi2sdq (%rdi), %xmm0, %xmm0
33 %0 = load i64, i64* %a
34 %1 = sitofp i64 %0 to double
38 define double @long_to_double_rm_optsize(i64* %a) optsize {
39 ; SSE2-LABEL: long_to_double_rm_optsize:
40 ; SSE2: # %bb.0: # %entry
41 ; SSE2-NEXT: cvtsi2sdq (%rdi), %xmm0
44 ; AVX-LABEL: long_to_double_rm_optsize:
45 ; AVX: # %bb.0: # %entry
46 ; AVX-NEXT: vcvtsi2sdq (%rdi), %xmm0, %xmm0
49 %0 = load i64, i64* %a
50 %1 = sitofp i64 %0 to double
54 define float @long_to_float_rr(i64 %a) {
55 ; SSE2-LABEL: long_to_float_rr:
56 ; SSE2: # %bb.0: # %entry
57 ; SSE2-NEXT: cvtsi2ss %rdi, %xmm0
60 ; AVX-LABEL: long_to_float_rr:
61 ; AVX: # %bb.0: # %entry
62 ; AVX-NEXT: vcvtsi2ss %rdi, %xmm0, %xmm0
65 %0 = sitofp i64 %a to float
69 define float @long_to_float_rm(i64* %a) {
70 ; SSE2-LABEL: long_to_float_rm:
71 ; SSE2: # %bb.0: # %entry
72 ; SSE2-NEXT: cvtsi2ssq (%rdi), %xmm0
75 ; AVX-LABEL: long_to_float_rm:
76 ; AVX: # %bb.0: # %entry
77 ; AVX-NEXT: vcvtsi2ssq (%rdi), %xmm0, %xmm0
80 %0 = load i64, i64* %a
81 %1 = sitofp i64 %0 to float
85 define float @long_to_float_rm_optsize(i64* %a) optsize {
86 ; SSE2-LABEL: long_to_float_rm_optsize:
87 ; SSE2: # %bb.0: # %entry
88 ; SSE2-NEXT: cvtsi2ssq (%rdi), %xmm0
91 ; AVX-LABEL: long_to_float_rm_optsize:
92 ; AVX: # %bb.0: # %entry
93 ; AVX-NEXT: vcvtsi2ssq (%rdi), %xmm0, %xmm0
96 %0 = load i64, i64* %a
97 %1 = sitofp i64 %0 to float