[llvm] r373569 - [X86] Add test case for v8i64->v8i8 truncate with avx512 and prefer-vector-width/min-legal-vector-width=256. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 2 23:18:46 PDT 2019
Author: ctopper
Date: Wed Oct 2 23:18:45 2019
New Revision: 373569
URL: http://llvm.org/viewvc/llvm-project?rev=373569&view=rev
Log:
[X86] Add test case for v8i64->v8i8 truncate with avx512 and prefer-vector-width/min-legal-vector-width=256. NFC
With vpmovqb, we should be able to do better here until we get
AVX512VBMI on Cannonlake/Icelake.
Modified:
llvm/trunk/test/CodeGen/X86/min-legal-vector-width.ll
Modified: llvm/trunk/test/CodeGen/X86/min-legal-vector-width.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/min-legal-vector-width.ll?rev=373569&r1=373568&r2=373569&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/min-legal-vector-width.ll (original)
+++ llvm/trunk/test/CodeGen/X86/min-legal-vector-width.ll Wed Oct 2 23:18:45 2019
@@ -828,6 +828,37 @@ define <16 x i8> @trunc_v16i32_v16i8(<16
ret <16 x i8> %b
}
+define <8 x i8> @trunc_v8i64_v8i8(<8 x i64>* %x) nounwind "min-legal-vector-width"="256" {
+; CHECK-AVX512-LABEL: trunc_v8i64_v8i8:
+; CHECK-AVX512: # %bb.0:
+; CHECK-AVX512-NEXT: vmovdqa (%rdi), %xmm0
+; CHECK-AVX512-NEXT: vmovdqa 16(%rdi), %xmm1
+; CHECK-AVX512-NEXT: vmovdqa 32(%rdi), %xmm2
+; CHECK-AVX512-NEXT: vmovdqa 48(%rdi), %xmm3
+; CHECK-AVX512-NEXT: vmovdqa {{.*#+}} xmm4 = <u,u,0,8,u,u,u,u,u,u,u,u,u,u,u,u>
+; CHECK-AVX512-NEXT: vpshufb %xmm4, %xmm3, %xmm3
+; CHECK-AVX512-NEXT: vpshufb %xmm4, %xmm2, %xmm2
+; CHECK-AVX512-NEXT: vpunpcklwd {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1],xmm2[2],xmm3[2],xmm2[3],xmm3[3]
+; CHECK-AVX512-NEXT: vmovdqa {{.*#+}} xmm3 = <0,8,u,u,u,u,u,u,u,u,u,u,u,u,u,u>
+; CHECK-AVX512-NEXT: vpshufb %xmm3, %xmm1, %xmm1
+; CHECK-AVX512-NEXT: vpshufb %xmm3, %xmm0, %xmm0
+; CHECK-AVX512-NEXT: vpunpcklwd {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
+; CHECK-AVX512-NEXT: vpblendd {{.*#+}} xmm0 = xmm0[0],xmm2[1],xmm0[2,3]
+; CHECK-AVX512-NEXT: retq
+;
+; CHECK-VBMI-LABEL: trunc_v8i64_v8i8:
+; CHECK-VBMI: # %bb.0:
+; CHECK-VBMI-NEXT: vmovdqa (%rdi), %ymm1
+; CHECK-VBMI-NEXT: vpbroadcastq {{.*#+}} ymm0 = [4048780183313844224,4048780183313844224,4048780183313844224,4048780183313844224]
+; CHECK-VBMI-NEXT: vpermi2b 32(%rdi), %ymm1, %ymm0
+; CHECK-VBMI-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
+; CHECK-VBMI-NEXT: vzeroupper
+; CHECK-VBMI-NEXT: retq
+ %a = load <8 x i64>, <8 x i64>* %x
+ %b = trunc <8 x i64> %a to <8 x i8>
+ ret <8 x i8> %b
+}
+
define <8 x i16> @trunc_v8i64_v8i16(<8 x i64>* %x) nounwind "min-legal-vector-width"="256" {
; CHECK-LABEL: trunc_v8i64_v8i16:
; CHECK: # %bb.0:
More information about the llvm-commits
mailing list