From e7bc874831ed1f98742f2ce308361939f32f8f8d Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Mon, 20 Feb 2017 15:16:43 +0000 Subject: [PATCH] [X86][SSE] Regenerate vselect widening tests and add 32-bit test target git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295665 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/X86/2011-10-19-widen_vselect.ll | 109 ++++++++++++++++--- 1 file changed, 91 insertions(+), 18 deletions(-) diff --git a/test/CodeGen/X86/2011-10-19-widen_vselect.ll b/test/CodeGen/X86/2011-10-19-widen_vselect.ll index b5272696240..449f2a50228 100644 --- a/test/CodeGen/X86/2011-10-19-widen_vselect.ll +++ b/test/CodeGen/X86/2011-10-19-widen_vselect.ll @@ -1,23 +1,50 @@ -; RUN: llc < %s -march=x86-64 -mtriple=x86_64-unknown-linux-gnu -mcpu=corei7 | FileCheck %s +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc < %s -mtriple=i686-unknown-linux-gnu -mcpu=corei7 | FileCheck %s --check-prefix=X32 +; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=corei7 | FileCheck %s --check-prefix=X64 ; Make sure that we don't crash when legalizing vselect and vsetcc and that ; we are able to generate vector blend instructions. -; CHECK-LABEL: simple_widen -; CHECK-NOT: blend -; CHECK: ret define void @simple_widen(<2 x float> %a, <2 x float> %b) { +; X32-LABEL: simple_widen: +; X32: # BB#0: # %entry +; X32-NEXT: extractps $1, %xmm1, (%eax) +; X32-NEXT: movss %xmm1, (%eax) +; X32-NEXT: retl +; +; X64-LABEL: simple_widen: +; X64: # BB#0: # %entry +; X64-NEXT: movlps %xmm1, (%rax) +; X64-NEXT: retq entry: %0 = select <2 x i1> undef, <2 x float> %a, <2 x float> %b store <2 x float> %0, <2 x float>* undef ret void } -; CHECK-LABEL: complex_inreg_work -; CHECK: blend -; CHECK: ret - define void @complex_inreg_work(<2 x float> %a, <2 x float> %b) { +; X32-LABEL: complex_inreg_work: +; X32: # BB#0: # %entry +; X32-NEXT: movaps %xmm0, %xmm2 +; X32-NEXT: cmpordps %xmm0, %xmm0 +; X32-NEXT: pmovsxdq %xmm0, %xmm0 +; X32-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,2,2,3] +; X32-NEXT: pslld $31, %xmm0 +; X32-NEXT: blendvps %xmm0, %xmm2, %xmm1 +; X32-NEXT: extractps $1, %xmm1, (%eax) +; X32-NEXT: movss %xmm1, (%eax) +; X32-NEXT: retl +; +; X64-LABEL: complex_inreg_work: +; X64: # BB#0: # %entry +; X64-NEXT: movaps %xmm0, %xmm2 +; X64-NEXT: cmpordps %xmm0, %xmm0 +; X64-NEXT: pmovsxdq %xmm0, %xmm0 +; X64-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,2,2,3] +; X64-NEXT: pslld $31, %xmm0 +; X64-NEXT: blendvps %xmm0, %xmm2, %xmm1 +; X64-NEXT: movlps %xmm1, (%rax) +; X64-NEXT: retq entry: %0 = fcmp oeq <2 x float> undef, undef %1 = select <2 x i1> %0, <2 x float> %a, <2 x float> %b @@ -25,22 +52,70 @@ entry: ret void } -; CHECK-LABEL: zero_test -; CHECK: xorps %xmm0, %xmm0 -; CHECK: ret - define void @zero_test() { +; X32-LABEL: zero_test: +; X32: # BB#0: # %entry +; X32-NEXT: pxor %xmm0, %xmm0 +; X32-NEXT: pextrd $1, %xmm0, (%eax) +; X32-NEXT: movd %xmm0, (%eax) +; X32-NEXT: retl +; +; X64-LABEL: zero_test: +; X64: # BB#0: # %entry +; X64-NEXT: xorps %xmm0, %xmm0 +; X64-NEXT: movlps %xmm0, (%rax) +; X64-NEXT: retq entry: %0 = select <2 x i1> undef, <2 x float> undef, <2 x float> zeroinitializer store <2 x float> %0, <2 x float>* undef ret void } -; CHECK-LABEL: full_test -; CHECK: blend -; CHECK: ret - define void @full_test() { +; X32-LABEL: full_test: +; X32: # BB#0: # %entry +; X32-NEXT: subl $60, %esp +; X32-NEXT: .Lcfi0: +; X32-NEXT: .cfi_def_cfa_offset 64 +; X32-NEXT: movsd {{.*#+}} xmm2 = mem[0],zero +; X32-NEXT: cvttps2dq %xmm2, %xmm0 +; X32-NEXT: cvtdq2ps %xmm0, %xmm1 +; X32-NEXT: xorps %xmm0, %xmm0 +; X32-NEXT: cmpltps %xmm2, %xmm0 +; X32-NEXT: pmovsxdq %xmm0, %xmm0 +; X32-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,2,2,3] +; X32-NEXT: pslld $31, %xmm0 +; X32-NEXT: movaps {{.*#+}} xmm3 = <1,1,u,u> +; X32-NEXT: addps %xmm1, %xmm3 +; X32-NEXT: movaps %xmm1, %xmm4 +; X32-NEXT: blendvps %xmm0, %xmm3, %xmm4 +; X32-NEXT: cmpeqps %xmm2, %xmm1 +; X32-NEXT: movaps %xmm1, %xmm0 +; X32-NEXT: blendvps %xmm0, %xmm2, %xmm4 +; X32-NEXT: extractps $1, %xmm4, {{[0-9]+}}(%esp) +; X32-NEXT: movss %xmm4, {{[0-9]+}}(%esp) +; X32-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero +; X32-NEXT: movsd %xmm0, {{[0-9]+}}(%esp) +; X32-NEXT: addl $60, %esp +; X32-NEXT: retl +; +; X64-LABEL: full_test: +; X64: # BB#0: # %entry +; X64-NEXT: movsd {{.*#+}} xmm2 = mem[0],zero +; X64-NEXT: cvttps2dq %xmm2, %xmm0 +; X64-NEXT: cvtdq2ps %xmm0, %xmm1 +; X64-NEXT: xorps %xmm0, %xmm0 +; X64-NEXT: cmpltps %xmm2, %xmm0 +; X64-NEXT: movaps {{.*#+}} xmm3 = <1,1,u,u> +; X64-NEXT: addps %xmm1, %xmm3 +; X64-NEXT: movaps %xmm1, %xmm4 +; X64-NEXT: blendvps %xmm0, %xmm3, %xmm4 +; X64-NEXT: cmpeqps %xmm2, %xmm1 +; X64-NEXT: movaps %xmm1, %xmm0 +; X64-NEXT: blendvps %xmm0, %xmm2, %xmm4 +; X64-NEXT: movlps %xmm4, -{{[0-9]+}}(%rsp) +; X64-NEXT: movlps %xmm4, -{{[0-9]+}}(%rsp) +; X64-NEXT: retq entry: %Cy300 = alloca <4 x float> %Cy11a = alloca <2 x float> @@ -62,5 +137,3 @@ define void @full_test() { store <2 x float> %8, <2 x float>* %Cy11a ret void } - - -- 2.50.1