[llvm] 97ac848 - [X86] Add test coverage for #116977
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 21 02:36:07 PST 2024
Author: Simon Pilgrim
Date: 2024-11-21T10:35:55Z
New Revision: 97ac84846a724809d28e167651b81355696d0d0b
URL: https://github.com/llvm/llvm-project/commit/97ac84846a724809d28e167651b81355696d0d0b
DIFF: https://github.com/llvm/llvm-project/commit/97ac84846a724809d28e167651b81355696d0d0b.diff
LOG: [X86] Add test coverage for #116977
Added:
Modified:
llvm/test/CodeGen/X86/vector-compare-all_of.ll
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/X86/vector-compare-all_of.ll b/llvm/test/CodeGen/X86/vector-compare-all_of.ll
index 30202701fdb8c8..deaf2d1b7de490 100644
--- a/llvm/test/CodeGen/X86/vector-compare-all_of.ll
+++ b/llvm/test/CodeGen/X86/vector-compare-all_of.ll
@@ -1594,3 +1594,76 @@ define i1 @select_v2i8(ptr %s0, ptr %s1) {
%res = select i1 %cmp0, i1 %cmp1, i1 false
ret i1 %res
}
+
+define i1 @PR116977(<32 x i8> %a, <32 x i8> %b, <32 x i8> %v) {
+; SSE-LABEL: PR116977:
+; SSE: # %bb.0:
+; SSE-NEXT: pcmpeqb %xmm4, %xmm0
+; SSE-NEXT: pcmpeqd %xmm6, %xmm6
+; SSE-NEXT: pxor %xmm6, %xmm0
+; SSE-NEXT: pcmpeqb %xmm5, %xmm1
+; SSE-NEXT: pxor %xmm6, %xmm1
+; SSE-NEXT: pcmpeqb %xmm4, %xmm2
+; SSE-NEXT: pxor %xmm6, %xmm2
+; SSE-NEXT: por %xmm0, %xmm2
+; SSE-NEXT: pcmpeqb %xmm5, %xmm3
+; SSE-NEXT: pxor %xmm6, %xmm3
+; SSE-NEXT: por %xmm1, %xmm3
+; SSE-NEXT: por %xmm2, %xmm3
+; SSE-NEXT: pmovmskb %xmm3, %eax
+; SSE-NEXT: testl %eax, %eax
+; SSE-NEXT: sete %al
+; SSE-NEXT: retq
+;
+; AVX1-LABEL: PR116977:
+; AVX1: # %bb.0:
+; AVX1-NEXT: vpcmpeqb %xmm0, %xmm2, %xmm3
+; AVX1-NEXT: vpcmpeqd %xmm4, %xmm4, %xmm4
+; AVX1-NEXT: vpxor %xmm4, %xmm3, %xmm3
+; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm0
+; AVX1-NEXT: vextractf128 $1, %ymm2, %xmm5
+; AVX1-NEXT: vpcmpeqb %xmm0, %xmm5, %xmm0
+; AVX1-NEXT: vpxor %xmm4, %xmm0, %xmm0
+; AVX1-NEXT: vpcmpeqb %xmm1, %xmm2, %xmm2
+; AVX1-NEXT: vpxor %xmm4, %xmm2, %xmm2
+; AVX1-NEXT: vpor %xmm2, %xmm3, %xmm2
+; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm1
+; AVX1-NEXT: vpcmpeqb %xmm1, %xmm5, %xmm1
+; AVX1-NEXT: vpxor %xmm4, %xmm1, %xmm1
+; AVX1-NEXT: vpor %xmm1, %xmm0, %xmm0
+; AVX1-NEXT: vpor %xmm0, %xmm2, %xmm0
+; AVX1-NEXT: vpmovmskb %xmm0, %eax
+; AVX1-NEXT: testl %eax, %eax
+; AVX1-NEXT: sete %al
+; AVX1-NEXT: vzeroupper
+; AVX1-NEXT: retq
+;
+; AVX2-LABEL: PR116977:
+; AVX2: # %bb.0:
+; AVX2-NEXT: vpcmpeqb %ymm0, %ymm2, %ymm0
+; AVX2-NEXT: vpcmpeqd %ymm3, %ymm3, %ymm3
+; AVX2-NEXT: vpxor %ymm3, %ymm0, %ymm0
+; AVX2-NEXT: vpcmpeqb %ymm1, %ymm2, %ymm1
+; AVX2-NEXT: vpxor %ymm3, %ymm1, %ymm1
+; AVX2-NEXT: vpor %ymm1, %ymm0, %ymm0
+; AVX2-NEXT: vpmovmskb %ymm0, %eax
+; AVX2-NEXT: testl %eax, %eax
+; AVX2-NEXT: sete %al
+; AVX2-NEXT: vzeroupper
+; AVX2-NEXT: retq
+;
+; AVX512-LABEL: PR116977:
+; AVX512: # %bb.0:
+; AVX512-NEXT: vpcmpneqb %ymm0, %ymm2, %k0
+; AVX512-NEXT: vpcmpneqb %ymm1, %ymm2, %k1
+; AVX512-NEXT: kortestd %k1, %k0
+; AVX512-NEXT: sete %al
+; AVX512-NEXT: vzeroupper
+; AVX512-NEXT: retq
+ %ca = icmp ne <32 x i8> %v, %a
+ %cb = icmp ne <32 x i8> %v, %b
+ %or = or <32 x i1> %ca, %cb
+ %scl = bitcast <32 x i1> %or to i32
+ %cmp = icmp eq i32 %scl, 0
+ ret i1 %cmp
+}
More information about the llvm-commits
mailing list