[llvm] 24d06ff - [x86] add test for pcmpeq with 0; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Wed May 12 05:25:40 PDT 2021
Author: Sanjay Patel
Date: 2021-05-12T08:25:29-04:00
New Revision: 24d06fff55510780eba1a267d844ee26a17d6888
URL: https://github.com/llvm/llvm-project/commit/24d06fff55510780eba1a267d844ee26a17d6888
DIFF: https://github.com/llvm/llvm-project/commit/24d06fff55510780eba1a267d844ee26a17d6888.diff
LOG: [x86] add test for pcmpeq with 0; NFC
Added:
Modified:
llvm/test/CodeGen/X86/setcc-lowering.ll
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/X86/setcc-lowering.ll b/llvm/test/CodeGen/X86/setcc-lowering.ll
index eb0d92f4539c..0edd17928028 100644
--- a/llvm/test/CodeGen/X86/setcc-lowering.ll
+++ b/llvm/test/CodeGen/X86/setcc-lowering.ll
@@ -103,3 +103,27 @@ for_loop599: ; preds = %for_loop599, %for_t
for_exit600: ; preds = %for_loop599
ret void
}
+
+define <4 x i32> @pcmpgt(<4 x i8> %x) {
+; AVX-LABEL: pcmpgt:
+; AVX: # %bb.0:
+; AVX-NEXT: vpmovzxbd {{.*#+}} xmm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero,xmm0[2],zero,zero,zero,xmm0[3],zero,zero,zero
+; AVX-NEXT: vpxor %xmm1, %xmm1, %xmm1
+; AVX-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
+; AVX-NEXT: vpcmpeqd %xmm1, %xmm1, %xmm1
+; AVX-NEXT: vpxor %xmm1, %xmm0, %xmm0
+; AVX-NEXT: retq
+;
+; KNL-32-LABEL: pcmpgt:
+; KNL-32: # %bb.0:
+; KNL-32-NEXT: vpmovzxbd {{.*#+}} xmm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero,xmm0[2],zero,zero,zero,xmm0[3],zero,zero,zero
+; KNL-32-NEXT: vpxor %xmm1, %xmm1, %xmm1
+; KNL-32-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
+; KNL-32-NEXT: vpternlogq $15, %zmm0, %zmm0, %zmm0
+; KNL-32-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
+; KNL-32-NEXT: retl
+ %zext = zext <4 x i8> %x to <4 x i32>
+ %icmp = icmp ne <4 x i32> %zext, zeroinitializer
+ %sext = sext <4 x i1> %icmp to <4 x i32>
+ ret <4 x i32> %sext
+}
More information about the llvm-commits
mailing list