diff options
author | Craig Topper <craig.topper@intel.com> | 2017-11-01 16:23:06 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2017-11-01 16:23:06 +0000 |
commit | 5ae677e102e35e4cabe393ae6185e25e49c91160 (patch) | |
tree | ed4d3de52e6449c9e141d47a443fba22d91a3a1a /llvm/test/CodeGen/X86/fast-isel-int-float-conversion-x86-64.ll | |
parent | 3d971e39f8a41b10e0a55232ce83be5c00a29d28 (diff) | |
download | bcm5719-llvm-5ae677e102e35e4cabe393ae6185e25e49c91160.tar.gz bcm5719-llvm-5ae677e102e35e4cabe393ae6185e25e49c91160.zip |
[X86] Add 64-bit int to float/double conversion with AVX to X86FastISel::X86SelectSIToFP
Summary:
[X86] Teach fast isel to handle i64 sitofp with AVX.
For some reason we only handled i32 sitofp with AVX. But with SSE only we support i64 so we should do the same with AVX.
Also add i686 command lines for the 32-bit tests. 64-bit tests are in a separate file to avoid a fast-isel abort failure in 32-bit mode.
Reviewers: RKSimon, zvi
Reviewed By: RKSimon
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D39450
llvm-svn: 317102
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 | 66 |
1 files changed, 66 insertions, 0 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 new file mode 100644 index 00000000000..432e190a745 --- /dev/null +++ b/llvm/test/CodeGen/X86/fast-isel-int-float-conversion-x86-64.ll @@ -0,0 +1,66 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; 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 +; 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 + + +define double @long_to_double_rr(i64 %a) { +; SSE2-LABEL: long_to_double_rr: +; SSE2: # BB#0: # %entry +; SSE2-NEXT: cvtsi2sdq %rdi, %xmm0 +; SSE2-NEXT: retq +; +; AVX-LABEL: long_to_double_rr: +; AVX: # BB#0: # %entry +; AVX-NEXT: vcvtsi2sdq %rdi, %xmm0, %xmm0 +; AVX-NEXT: retq +entry: + %0 = sitofp i64 %a to double + ret double %0 +} + +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: retq +; +; AVX-LABEL: long_to_double_rm: +; 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 +; SSE2-NEXT: cvtsi2ssq %rdi, %xmm0 +; SSE2-NEXT: retq +; +; AVX-LABEL: long_to_float_rr: +; AVX: # BB#0: # %entry +; AVX-NEXT: vcvtsi2ssq %rdi, %xmm0, %xmm0 +; AVX-NEXT: retq +entry: + %0 = sitofp i64 %a to float + ret float %0 +} + +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: retq +; +; AVX-LABEL: long_to_float_rm: +; 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 +} |