[llvm] 8692e27 - [X86][AVX512] Add PR52500 vXi1 broadcast test case
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 21 10:25:48 PDT 2022
Author: Simon Pilgrim
Date: 2022-03-21T17:25:29Z
New Revision: 8692e27ad671c31514e2ab828974924c149e741b
URL: https://github.com/llvm/llvm-project/commit/8692e27ad671c31514e2ab828974924c149e741b
DIFF: https://github.com/llvm/llvm-project/commit/8692e27ad671c31514e2ab828974924c149e741b.diff
LOG: [X86][AVX512] Add PR52500 vXi1 broadcast test case
Added:
Modified:
llvm/test/CodeGen/X86/vector-shuffle-v1.ll
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/X86/vector-shuffle-v1.ll b/llvm/test/CodeGen/X86/vector-shuffle-v1.ll
index 3eadf8812156c..9af454b3cc984 100644
--- a/llvm/test/CodeGen/X86/vector-shuffle-v1.ll
+++ b/llvm/test/CodeGen/X86/vector-shuffle-v1.ll
@@ -908,3 +908,64 @@ define i64 @shuf64i1_zero(i64 %a) {
%d = bitcast <64 x i1> %c to i64
ret i64 %d
}
+
+define <16 x i1> @PR52500(<16 x i1> %msk, i32 %in) {
+; AVX512F-LABEL: PR52500:
+; AVX512F: # %bb.0:
+; AVX512F-NEXT: vpmovsxbd %xmm0, %zmm0
+; AVX512F-NEXT: vpslld $31, %zmm0, %zmm0
+; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k1
+; AVX512F-NEXT: vmovd %edi, %xmm0
+; AVX512F-NEXT: movl $789, %eax # imm = 0x315
+; AVX512F-NEXT: vmovd %eax, %xmm1
+; AVX512F-NEXT: vpmulld %xmm1, %xmm0, %xmm0
+; AVX512F-NEXT: vptestnmd %zmm0, %zmm0, %k2
+; AVX512F-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k2} {z}
+; AVX512F-NEXT: vpbroadcastd %xmm0, %zmm0
+; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k1 {%k1}
+; AVX512F-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
+; AVX512F-NEXT: vpmovdb %zmm0, %xmm0
+; AVX512F-NEXT: vzeroupper
+; AVX512F-NEXT: retq
+;
+; AVX512VL-LABEL: PR52500:
+; AVX512VL: # %bb.0:
+; AVX512VL-NEXT: vpmovsxbd %xmm0, %zmm0
+; AVX512VL-NEXT: vpslld $31, %zmm0, %zmm0
+; AVX512VL-NEXT: vptestmd %zmm0, %zmm0, %k1
+; AVX512VL-NEXT: vmovd %edi, %xmm0
+; AVX512VL-NEXT: movl $789, %eax # imm = 0x315
+; AVX512VL-NEXT: vmovd %eax, %xmm1
+; AVX512VL-NEXT: vpmulld %xmm1, %xmm0, %xmm0
+; AVX512VL-NEXT: vptestnmd %zmm0, %zmm0, %k2
+; AVX512VL-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k2} {z}
+; AVX512VL-NEXT: vpbroadcastd %xmm0, %zmm0
+; AVX512VL-NEXT: vptestmd %zmm0, %zmm0, %k1 {%k1}
+; AVX512VL-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
+; AVX512VL-NEXT: vpmovdb %zmm0, %xmm0
+; AVX512VL-NEXT: vzeroupper
+; AVX512VL-NEXT: retq
+;
+; VL_BW_DQ-LABEL: PR52500:
+; VL_BW_DQ: # %bb.0:
+; VL_BW_DQ-NEXT: vpsllw $7, %xmm0, %xmm0
+; VL_BW_DQ-NEXT: vpxor %xmm1, %xmm1, %xmm1
+; VL_BW_DQ-NEXT: vmovd %edi, %xmm2
+; VL_BW_DQ-NEXT: movl $789, %eax # imm = 0x315
+; VL_BW_DQ-NEXT: vmovd %eax, %xmm3
+; VL_BW_DQ-NEXT: vpmulld %xmm3, %xmm2, %xmm2
+; VL_BW_DQ-NEXT: vptestnmd %zmm2, %zmm2, %k0
+; VL_BW_DQ-NEXT: vpmovm2d %k0, %zmm2
+; VL_BW_DQ-NEXT: vpbroadcastd %xmm2, %zmm2
+; VL_BW_DQ-NEXT: vpmovd2m %zmm2, %k1
+; VL_BW_DQ-NEXT: vpcmpgtb %xmm0, %xmm1, %k0 {%k1}
+; VL_BW_DQ-NEXT: vpmovm2b %k0, %xmm0
+; VL_BW_DQ-NEXT: vzeroupper
+; VL_BW_DQ-NEXT: retq
+ %insrt = insertelement <16 x i32> undef, i32 %in, i32 0
+ %mul = mul <16 x i32> %insrt, <i32 789, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
+ %eq = icmp eq <16 x i32> %mul, zeroinitializer
+ %cmp1 = shufflevector <16 x i1> %eq, <16 x i1> poison, <16 x i32> zeroinitializer
+ %and = and <16 x i1> %cmp1, %msk
+ ret <16 x i1> %and
+}
More information about the llvm-commits
mailing list