[llvm] r286447 - [X86] Add knownbits vector logical shift test
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 10 05:34:18 PST 2016
Author: rksimon
Date: Thu Nov 10 07:34:17 2016
New Revision: 286447
URL: http://llvm.org/viewvc/llvm-project?rev=286447&view=rev
Log:
[X86] Add knownbits vector logical shift test
In preparation for demandedelts support
Modified:
llvm/trunk/test/CodeGen/X86/known-bits-vector.ll
Modified: llvm/trunk/test/CodeGen/X86/known-bits-vector.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/known-bits-vector.ll?rev=286447&r1=286446&r2=286447&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/known-bits-vector.ll (original)
+++ llvm/trunk/test/CodeGen/X86/known-bits-vector.ll Thu Nov 10 07:34:17 2016
@@ -135,3 +135,26 @@ define <4 x float> @knownbits_mask_xor_s
%4 = uitofp <4 x i32> %3 to <4 x float>
ret <4 x float> %4
}
+
+define <4 x i32> @knownbits_mask_shl_shuffle_lshr(<4 x i32> %a0) nounwind {
+; X32-LABEL: knownbits_mask_shl_shuffle_lshr:
+; X32: # BB#0:
+; X32-NEXT: vpand {{\.LCPI.*}}, %xmm0, %xmm0
+; X32-NEXT: vpslld $17, %xmm0, %xmm0
+; X32-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[0,0,3,3]
+; X32-NEXT: vpsrld $15, %xmm0, %xmm0
+; X32-NEXT: retl
+;
+; X64-LABEL: knownbits_mask_shl_shuffle_lshr:
+; X64: # BB#0:
+; X64-NEXT: vpand {{.*}}(%rip), %xmm0, %xmm0
+; X64-NEXT: vpslld $17, %xmm0, %xmm0
+; X64-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[0,0,3,3]
+; X64-NEXT: vpsrld $15, %xmm0, %xmm0
+; X64-NEXT: retq
+ %1 = and <4 x i32> %a0, <i32 -65536, i32 -7, i32 -7, i32 -65536>
+ %2 = shl <4 x i32> %1, <i32 17, i32 17, i32 17, i32 17>
+ %3 = shufflevector <4 x i32> %2, <4 x i32> undef, <4 x i32> <i32 0, i32 0, i32 3, i32 3>
+ %4 = lshr <4 x i32> %3, <i32 15, i32 15, i32 15, i32 15>
+ ret <4 x i32> %4
+}
More information about the llvm-commits
mailing list