diff options
author | Craig Topper <craig.topper@intel.com> | 2019-08-18 23:30:07 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2019-08-18 23:30:07 +0000 |
commit | 6bd2e8eff817daa26d26a6f00f220b357857aa75 (patch) | |
tree | 1c563411af5ca7920fb0acfc5243b20967559ca7 | |
parent | 388b8dd94a470e589f5c01d27a38eb4c741db3b7 (diff) | |
download | bcm5719-llvm-6bd2e8eff817daa26d26a6f00f220b357857aa75.tar.gz bcm5719-llvm-6bd2e8eff817daa26d26a6f00f220b357857aa75.zip |
[X86] Add test cases for suboptimal insertion of a vXi1 vector into a larger vector with zeros in the lower elements and undef upper elements.
Currently we generate kshifts to clear both the upper and lower
elements, but we only need one kshift.
llvm-svn: 369223
-rw-r--r-- | llvm/test/CodeGen/X86/avx512-skx-insert-subvec.ll | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/avx512-skx-insert-subvec.ll b/llvm/test/CodeGen/X86/avx512-skx-insert-subvec.ll index 5338eb3c3a1..bd0057e0d82 100644 --- a/llvm/test/CodeGen/X86/avx512-skx-insert-subvec.ll +++ b/llvm/test/CodeGen/X86/avx512-skx-insert-subvec.ll @@ -163,3 +163,42 @@ define <8 x i1> @test11(<4 x i1> %a, <4 x i1>%b) { %res = shufflevector <4 x i1> %a, <4 x i1> undef, <8 x i32> <i32 undef, i32 undef, i32 undef, i32 undef, i32 0, i32 1, i32 2, i32 3> ret <8 x i1> %res } + +define <16 x i1> @test12(<2 x i1> %a) { +; CHECK-LABEL: test12: +; CHECK: # %bb.0: +; CHECK-NEXT: vpsllq $63, %xmm0, %xmm0 +; CHECK-NEXT: vpmovq2m %xmm0, %k0 +; CHECK-NEXT: kshiftlw $14, %k0, %k0 +; CHECK-NEXT: kshiftrw $4, %k0, %k0 +; CHECK-NEXT: vpmovm2b %k0, %xmm0 +; CHECK-NEXT: retq + %res = shufflevector <2 x i1> %a, <2 x i1> zeroinitializer, <16 x i32> <i32 2, i32 3, i32 2, i32 3, i32 2, i32 3, i32 2, i32 3, i32 2, i32 3, i32 0, i32 1, i32 undef, i32 undef, i32 undef, i32 undef> + ret <16 x i1> %res +} + +define <32 x i1> @test13(<2 x i1> %a) { +; CHECK-LABEL: test13: +; CHECK: # %bb.0: +; CHECK-NEXT: vpsllq $63, %xmm0, %xmm0 +; CHECK-NEXT: vpmovq2m %xmm0, %k0 +; CHECK-NEXT: kshiftld $30, %k0, %k0 +; CHECK-NEXT: kshiftrd $20, %k0, %k0 +; CHECK-NEXT: vpmovm2b %k0, %ymm0 +; CHECK-NEXT: retq + %res = shufflevector <2 x i1> %a, <2 x i1> zeroinitializer, <32 x i32> <i32 2, i32 3, i32 2, i32 3, i32 2, i32 3, i32 2, i32 3, i32 2, i32 3, i32 0, i32 1, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef> + ret <32 x i1> %res +} + +define <64 x i1> @test14(<2 x i1> %a) { +; CHECK-LABEL: test14: +; CHECK: # %bb.0: +; CHECK-NEXT: vpsllq $63, %xmm0, %xmm0 +; CHECK-NEXT: vpmovq2m %xmm0, %k0 +; CHECK-NEXT: kshiftlq $62, %k0, %k0 +; CHECK-NEXT: kshiftrq $52, %k0, %k0 +; CHECK-NEXT: vpmovm2b %k0, %zmm0 +; CHECK-NEXT: retq + %res = shufflevector <2 x i1> %a, <2 x i1> zeroinitializer, <64 x i32> <i32 2, i32 3, i32 2, i32 3, i32 2, i32 3, i32 2, i32 3, i32 2, i32 3, i32 0, i32 1, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef> + ret <64 x i1> %res +} |