[llvm] c7fb1cd - [X86] Add test case for Issue #58546
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 23 06:27:50 PDT 2022
Author: Simon Pilgrim
Date: 2022-10-23T14:27:37+01:00
New Revision: c7fb1cdcbaf3c0e2ae4480ecf7b8516c9ecc5dd3
URL: https://github.com/llvm/llvm-project/commit/c7fb1cdcbaf3c0e2ae4480ecf7b8516c9ecc5dd3
DIFF: https://github.com/llvm/llvm-project/commit/c7fb1cdcbaf3c0e2ae4480ecf7b8516c9ecc5dd3.diff
LOG: [X86] Add test case for Issue #58546
Added:
Modified:
llvm/test/CodeGen/X86/bitcast-vector-bool.ll
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/X86/bitcast-vector-bool.ll b/llvm/test/CodeGen/X86/bitcast-vector-bool.ll
index 8ce36dd3c8ef..94901e665d56 100644
--- a/llvm/test/CodeGen/X86/bitcast-vector-bool.ll
+++ b/llvm/test/CodeGen/X86/bitcast-vector-bool.ll
@@ -640,3 +640,77 @@ define i64 @bitcast_v128i8_to_v2i64(<128 x i8> %a0) nounwind {
%5 = add i64 %3, %4
ret i64 %5
}
+
+define [2 x i8] @PR58546(<16 x float> %a0) {
+; SSE2-SSSE3-LABEL: PR58546:
+; SSE2-SSSE3: # %bb.0:
+; SSE2-SSSE3-NEXT: xorps %xmm4, %xmm4
+; SSE2-SSSE3-NEXT: cmpunordps %xmm4, %xmm3
+; SSE2-SSSE3-NEXT: cmpunordps %xmm4, %xmm2
+; SSE2-SSSE3-NEXT: packssdw %xmm3, %xmm2
+; SSE2-SSSE3-NEXT: cmpunordps %xmm4, %xmm1
+; SSE2-SSSE3-NEXT: cmpunordps %xmm4, %xmm0
+; SSE2-SSSE3-NEXT: packssdw %xmm1, %xmm0
+; SSE2-SSSE3-NEXT: packsswb %xmm2, %xmm0
+; SSE2-SSSE3-NEXT: pmovmskb %xmm0, %eax
+; SSE2-SSSE3-NEXT: movl %eax, %edx
+; SSE2-SSSE3-NEXT: shrl $8, %edx
+; SSE2-SSSE3-NEXT: # kill: def $al killed $al killed $eax
+; SSE2-SSSE3-NEXT: # kill: def $dl killed $dl killed $edx
+; SSE2-SSSE3-NEXT: retq
+;
+; AVX1-LABEL: PR58546:
+; AVX1: # %bb.0:
+; AVX1-NEXT: vxorps %xmm2, %xmm2, %xmm2
+; AVX1-NEXT: vcmpunordps %ymm2, %ymm1, %ymm1
+; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm3
+; AVX1-NEXT: vpackssdw %xmm3, %xmm1, %xmm1
+; AVX1-NEXT: vcmpunordps %ymm2, %ymm0, %ymm0
+; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
+; AVX1-NEXT: vpackssdw %xmm2, %xmm0, %xmm0
+; AVX1-NEXT: vpacksswb %xmm1, %xmm0, %xmm0
+; AVX1-NEXT: vpmovmskb %xmm0, %eax
+; AVX1-NEXT: movl %eax, %edx
+; AVX1-NEXT: shrl $8, %edx
+; AVX1-NEXT: # kill: def $al killed $al killed $eax
+; AVX1-NEXT: # kill: def $dl killed $dl killed $edx
+; AVX1-NEXT: vzeroupper
+; AVX1-NEXT: retq
+;
+; AVX2-LABEL: PR58546:
+; AVX2: # %bb.0:
+; AVX2-NEXT: vxorps %xmm2, %xmm2, %xmm2
+; AVX2-NEXT: vcmpunordps %ymm2, %ymm1, %ymm1
+; AVX2-NEXT: vcmpunordps %ymm2, %ymm0, %ymm0
+; AVX2-NEXT: vpackssdw %ymm1, %ymm0, %ymm0
+; AVX2-NEXT: vextracti128 $1, %ymm0, %xmm1
+; AVX2-NEXT: vpacksswb %xmm1, %xmm0, %xmm0
+; AVX2-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[0,2,1,3]
+; AVX2-NEXT: vpmovmskb %xmm0, %eax
+; AVX2-NEXT: movl %eax, %edx
+; AVX2-NEXT: shrl $8, %edx
+; AVX2-NEXT: # kill: def $al killed $al killed $eax
+; AVX2-NEXT: # kill: def $dl killed $dl killed $edx
+; AVX2-NEXT: vzeroupper
+; AVX2-NEXT: retq
+;
+; AVX512-LABEL: PR58546:
+; AVX512: # %bb.0:
+; AVX512-NEXT: vxorps %xmm1, %xmm1, %xmm1
+; AVX512-NEXT: vcmpunordps %zmm1, %zmm0, %k0
+; AVX512-NEXT: kmovw %k0, -{{[0-9]+}}(%rsp)
+; AVX512-NEXT: vmovdqa -{{[0-9]+}}(%rsp), %xmm0
+; AVX512-NEXT: vmovd %xmm0, %eax
+; AVX512-NEXT: vpextrb $1, %xmm0, %edx
+; AVX512-NEXT: # kill: def $al killed $al killed $eax
+; AVX512-NEXT: # kill: def $dl killed $dl killed $edx
+; AVX512-NEXT: vzeroupper
+; AVX512-NEXT: retq
+ %1 = fcmp uno <16 x float> %a0, zeroinitializer
+ %2 = bitcast <16 x i1> %1 to <2 x i8>
+ %3 = extractelement <2 x i8> %2, i64 0
+ %4 = extractelement <2 x i8> %2, i64 1
+ %5 = insertvalue [2 x i8] poison, i8 %3, 0
+ %6 = insertvalue [2 x i8] %5, i8 %4, 1
+ ret [2 x i8] %6
+}
More information about the llvm-commits
mailing list