[llvm] r353249 - [x86] add tests for extract+sitofp; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 5 16:19:56 PST 2019
Author: spatel
Date: Tue Feb 5 16:19:56 2019
New Revision: 353249
URL: http://llvm.org/viewvc/llvm-project?rev=353249&view=rev
Log:
[x86] add tests for extract+sitofp; NFC
Modified:
llvm/trunk/test/CodeGen/X86/vec_int_to_fp.ll
Modified: llvm/trunk/test/CodeGen/X86/vec_int_to_fp.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_int_to_fp.ll?rev=353249&r1=353248&r2=353249&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/vec_int_to_fp.ll (original)
+++ llvm/trunk/test/CodeGen/X86/vec_int_to_fp.ll Tue Feb 5 16:19:56 2019
@@ -5571,6 +5571,55 @@ define float @extract0_sitofp_v4i32_f32(
ret float %r
}
+define float @extract0_sitofp_v4i32_f32i_multiuse1(<4 x i32> %x) nounwind {
+; SSE-LABEL: extract0_sitofp_v4i32_f32i_multiuse1:
+; SSE: # %bb.0:
+; SSE-NEXT: movd %xmm0, %eax
+; SSE-NEXT: xorps %xmm0, %xmm0
+; SSE-NEXT: cvtsi2ssl %eax, %xmm0
+; SSE-NEXT: incl %eax
+; SSE-NEXT: cvtsi2ssl %eax, %xmm1
+; SSE-NEXT: divss %xmm1, %xmm0
+; SSE-NEXT: retq
+;
+; AVX-LABEL: extract0_sitofp_v4i32_f32i_multiuse1:
+; AVX: # %bb.0:
+; AVX-NEXT: vmovd %xmm0, %eax
+; AVX-NEXT: vcvtsi2ssl %eax, %xmm1, %xmm0
+; AVX-NEXT: incl %eax
+; AVX-NEXT: vcvtsi2ssl %eax, %xmm1, %xmm1
+; AVX-NEXT: vdivss %xmm1, %xmm0, %xmm0
+; AVX-NEXT: retq
+ %e = extractelement <4 x i32> %x, i32 0
+ %f = sitofp i32 %e to float
+ %e1 = add i32 %e, 1
+ %f1 = sitofp i32 %e1 to float
+ %r = fdiv float %f, %f1
+ ret float %r
+}
+
+define float @extract0_sitofp_v4i32_f32_multiuse2(<4 x i32> %x, i32* %p) nounwind {
+; SSE-LABEL: extract0_sitofp_v4i32_f32_multiuse2:
+; SSE: # %bb.0:
+; SSE-NEXT: movd %xmm0, %eax
+; SSE-NEXT: cvtsi2ssl %eax, %xmm1
+; SSE-NEXT: movd %xmm0, (%rdi)
+; SSE-NEXT: movaps %xmm1, %xmm0
+; SSE-NEXT: retq
+;
+; AVX-LABEL: extract0_sitofp_v4i32_f32_multiuse2:
+; AVX: # %bb.0:
+; AVX-NEXT: vmovd %xmm0, %eax
+; AVX-NEXT: vcvtsi2ssl %eax, %xmm1, %xmm1
+; AVX-NEXT: vmovd %xmm0, (%rdi)
+; AVX-NEXT: vmovaps %xmm1, %xmm0
+; AVX-NEXT: retq
+ %e = extractelement <4 x i32> %x, i32 0
+ %r = sitofp i32 %e to float
+ store i32 %e, i32* %p
+ ret float %r
+}
+
define double @extract0_sitofp_v4i32_f64(<4 x i32> %x) nounwind {
; SSE-LABEL: extract0_sitofp_v4i32_f64:
; SSE: # %bb.0:
More information about the llvm-commits
mailing list