llvm.org GIT mirror llvm / master
[X86][SSE] Add shuffle demanded elts test case for PR39549 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347139 91177308-0d34-0410-b5e6-96231b3b80d8 Simon Pilgrim 2 hours ago
1 changed file(s) with 22 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
28222822 %shuf2 = shufflevector <4 x float> %shuf1, <4 x float> , <4 x i32>
28232823 ret <4 x float> %shuf2
28242824 }
2825
2826 define <8 x i16> @PR39549(<16 x i8> %x) {
2827 ; SSE-LABEL: PR39549:
2828 ; SSE: # %bb.0:
2829 ; SSE-NEXT: pxor %xmm1, %xmm1
2830 ; SSE-NEXT: punpckhbw {{.*#+}} xmm1 = xmm1[8],xmm0[8],xmm1[9],xmm0[9],xmm1[10],xmm0[10],xmm1[11],xmm0[11],xmm1[12],xmm0[12],xmm1[13],xmm0[13],xmm1[14],xmm0[14],xmm1[15],xmm0[15]
2831 ; SSE-NEXT: psraw $8, %xmm1
2832 ; SSE-NEXT: movdqa %xmm1, %xmm0
2833 ; SSE-NEXT: retq
2834 ;
2835 ; AVX-LABEL: PR39549:
2836 ; AVX: # %bb.0:
2837 ; AVX-NEXT: vpxor %xmm1, %xmm1, %xmm1
2838 ; AVX-NEXT: vpunpckhbw {{.*#+}} xmm0 = xmm1[8],xmm0[8],xmm1[9],xmm0[9],xmm1[10],xmm0[10],xmm1[11],xmm0[11],xmm1[12],xmm0[12],xmm1[13],xmm0[13],xmm1[14],xmm0[14],xmm1[15],xmm0[15]
2839 ; AVX-NEXT: vpsraw $8, %xmm0, %xmm0
2840 ; AVX-NEXT: retq
2841 %a = shufflevector <16 x i8> %x, <16 x i8> undef, <16 x i32>
2842 %b = bitcast <16 x i8> %a to <8 x i16>
2843 %c = shl <8 x i16> %b,
2844 %d = ashr <8 x i16> %c,
2845 ret <8 x i16> %d
2846 }