[llvm] r323542 - [X86][AVX] LowerBUILD_VECTORAsVariablePermute - add support for VPERMILPV to v4i32/v4f32
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 26 09:19:59 PST 2018
Author: rksimon
Date: Fri Jan 26 09:19:59 2018
New Revision: 323542
URL: http://llvm.org/viewvc/llvm-project?rev=323542&view=rev
Log:
[X86][AVX] LowerBUILD_VECTORAsVariablePermute - add support for VPERMILPV to v4i32/v4f32
Extension to D42431, adding support for v4i32/v4f32 as well as v2i64/v2f64 now that D42308 has landed
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
llvm/trunk/test/CodeGen/X86/var-permute-128.ll
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=323542&r1=323541&r2=323542&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Fri Jan 26 09:19:59 2018
@@ -7847,6 +7847,13 @@ LowerBUILD_VECTORAsVariablePermute(SDVal
if (Subtarget.hasSSE3())
Opcode = X86ISD::PSHUFB;
break;
+ case MVT::v4f32:
+ case MVT::v4i32:
+ if (Subtarget.hasAVX()) {
+ Opcode = X86ISD::VPERMILPV;
+ ShuffleVT = MVT::v4f32;
+ }
+ break;
case MVT::v2f64:
case MVT::v2i64:
if (Subtarget.hasAVX()) {
Modified: llvm/trunk/test/CodeGen/X86/var-permute-128.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/var-permute-128.ll?rev=323542&r1=323541&r2=323542&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/var-permute-128.ll (original)
+++ llvm/trunk/test/CodeGen/X86/var-permute-128.ll Fri Jan 26 09:19:59 2018
@@ -60,19 +60,7 @@ define <4 x i32> @var_shuffle_v4i32(<4 x
;
; AVX-LABEL: var_shuffle_v4i32:
; AVX: # %bb.0:
-; AVX-NEXT: vmovd %xmm1, %eax
-; AVX-NEXT: vpextrd $1, %xmm1, %ecx
-; AVX-NEXT: vpextrd $2, %xmm1, %edx
-; AVX-NEXT: vpextrd $3, %xmm1, %esi
-; AVX-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp)
-; AVX-NEXT: andl $3, %eax
-; AVX-NEXT: andl $3, %ecx
-; AVX-NEXT: andl $3, %edx
-; AVX-NEXT: andl $3, %esi
-; AVX-NEXT: vmovd {{.*#+}} xmm0 = mem[0],zero,zero,zero
-; AVX-NEXT: vpinsrd $1, -24(%rsp,%rcx,4), %xmm0, %xmm0
-; AVX-NEXT: vpinsrd $2, -24(%rsp,%rdx,4), %xmm0, %xmm0
-; AVX-NEXT: vpinsrd $3, -24(%rsp,%rsi,4), %xmm0, %xmm0
+; AVX-NEXT: vpermilps %xmm1, %xmm0, %xmm0
; AVX-NEXT: retq
%index0 = extractelement <4 x i32> %indices, i32 0
%index1 = extractelement <4 x i32> %indices, i32 1
@@ -308,19 +296,7 @@ define <4 x float> @var_shuffle_v4f32(<4
;
; AVX-LABEL: var_shuffle_v4f32:
; AVX: # %bb.0:
-; AVX-NEXT: vmovd %xmm1, %eax
-; AVX-NEXT: vpextrd $1, %xmm1, %ecx
-; AVX-NEXT: vpextrd $2, %xmm1, %edx
-; AVX-NEXT: vpextrd $3, %xmm1, %esi
-; AVX-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp)
-; AVX-NEXT: andl $3, %eax
-; AVX-NEXT: andl $3, %ecx
-; AVX-NEXT: andl $3, %edx
-; AVX-NEXT: andl $3, %esi
-; AVX-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero
-; AVX-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0],mem[0],xmm0[2,3]
-; AVX-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0,1],mem[0],xmm0[3]
-; AVX-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0,1,2],mem[0]
+; AVX-NEXT: vpermilps %xmm1, %xmm0, %xmm0
; AVX-NEXT: retq
%index0 = extractelement <4 x i32> %indices, i32 0
%index1 = extractelement <4 x i32> %indices, i32 1
More information about the llvm-commits
mailing list