From 7be6d994424ba699c9f6b672b650e63e7547776e Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Thu, 10 Nov 2016 14:46:24 +0000 Subject: [PATCH] [X86] Add knownbits vector arithmetic shift test In preparation for demandedelts support llvm-svn: 286457 --- llvm/test/CodeGen/X86/known-bits-vector.ll | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/llvm/test/CodeGen/X86/known-bits-vector.ll b/llvm/test/CodeGen/X86/known-bits-vector.ll index 03758f0..63ac994 100644 --- a/llvm/test/CodeGen/X86/known-bits-vector.ll +++ b/llvm/test/CodeGen/X86/known-bits-vector.ll @@ -152,3 +152,26 @@ define <4 x i32> @knownbits_mask_shl_shuffle_lshr(<4 x i32> %a0) nounwind { %4 = lshr <4 x i32> %3, ret <4 x i32> %4 } + +define <4 x i32> @knownbits_mask_ashr_shuffle_lshr(<4 x i32> %a0) nounwind { +; X32-LABEL: knownbits_mask_ashr_shuffle_lshr: +; X32: # BB#0: +; X32-NEXT: vpand {{\.LCPI.*}}, %xmm0, %xmm0 +; X32-NEXT: vpsrad $15, %xmm0, %xmm0 +; X32-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[0,0,3,3] +; X32-NEXT: vpsrld $30, %xmm0, %xmm0 +; X32-NEXT: retl +; +; X64-LABEL: knownbits_mask_ashr_shuffle_lshr: +; X64: # BB#0: +; X64-NEXT: vpand {{.*}}(%rip), %xmm0, %xmm0 +; X64-NEXT: vpsrad $15, %xmm0, %xmm0 +; X64-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[0,0,3,3] +; X64-NEXT: vpsrld $30, %xmm0, %xmm0 +; X64-NEXT: retq + %1 = and <4 x i32> %a0, + %2 = ashr <4 x i32> %1, + %3 = shufflevector <4 x i32> %2, <4 x i32> undef, <4 x i32> + %4 = lshr <4 x i32> %3, + ret <4 x i32> %4 +} -- 2.7.4