diff options
Diffstat (limited to 'llvm/test/CodeGen/X86/fast-isel-int-float-conversion-x86-64.ll')
-rw-r--r-- | llvm/test/CodeGen/X86/fast-isel-int-float-conversion-x86-64.ll | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/llvm/test/CodeGen/X86/fast-isel-int-float-conversion-x86-64.ll b/llvm/test/CodeGen/X86/fast-isel-int-float-conversion-x86-64.ll index 432e190a745..50eddab2b45 100644 --- a/llvm/test/CodeGen/X86/fast-isel-int-float-conversion-x86-64.ll +++ b/llvm/test/CodeGen/X86/fast-isel-int-float-conversion-x86-64.ll @@ -21,7 +21,8 @@ entry: define double @long_to_double_rm(i64* %a) { ; SSE2-LABEL: long_to_double_rm: ; SSE2: # BB#0: # %entry -; SSE2-NEXT: cvtsi2sdq (%rdi), %xmm0 +; SSE2-NEXT: movq (%rdi), %rax +; SSE2-NEXT: cvtsi2sdq %rax, %xmm0 ; SSE2-NEXT: retq ; ; AVX-LABEL: long_to_double_rm: @@ -34,6 +35,22 @@ entry: ret double %1 } +define double @long_to_double_rm_optsize(i64* %a) optsize { +; SSE2-LABEL: long_to_double_rm_optsize: +; SSE2: # BB#0: # %entry +; SSE2-NEXT: cvtsi2sdq (%rdi), %xmm0 +; SSE2-NEXT: retq +; +; AVX-LABEL: long_to_double_rm_optsize: +; AVX: # BB#0: # %entry +; AVX-NEXT: vcvtsi2sdq (%rdi), %xmm0, %xmm0 +; AVX-NEXT: retq +entry: + %0 = load i64, i64* %a + %1 = sitofp i64 %0 to double + ret double %1 +} + define float @long_to_float_rr(i64 %a) { ; SSE2-LABEL: long_to_float_rr: ; SSE2: # BB#0: # %entry @@ -52,7 +69,8 @@ entry: define float @long_to_float_rm(i64* %a) { ; SSE2-LABEL: long_to_float_rm: ; SSE2: # BB#0: # %entry -; SSE2-NEXT: cvtsi2ssq (%rdi), %xmm0 +; SSE2-NEXT: movq (%rdi), %rax +; SSE2-NEXT: cvtsi2ssq %rax, %xmm0 ; SSE2-NEXT: retq ; ; AVX-LABEL: long_to_float_rm: @@ -64,3 +82,19 @@ entry: %1 = sitofp i64 %0 to float ret float %1 } + +define float @long_to_float_rm_optsize(i64* %a) optsize { +; SSE2-LABEL: long_to_float_rm_optsize: +; SSE2: # BB#0: # %entry +; SSE2-NEXT: cvtsi2ssq (%rdi), %xmm0 +; SSE2-NEXT: retq +; +; AVX-LABEL: long_to_float_rm_optsize: +; AVX: # BB#0: # %entry +; AVX-NEXT: vcvtsi2ssq (%rdi), %xmm0, %xmm0 +; AVX-NEXT: retq +entry: + %0 = load i64, i64* %a + %1 = sitofp i64 %0 to float + ret float %1 +} |