[llvm] r299335 - [X86][MMX] Added support for subvector extraction to MMX register
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 2 08:52:28 PDT 2017
Author: rksimon
Date: Sun Apr 2 10:52:28 2017
New Revision: 299335
URL: http://llvm.org/viewvc/llvm-project?rev=299335&view=rev
Log:
[X86][MMX] Added support for subvector extraction to MMX register
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
llvm/trunk/test/CodeGen/X86/mmx-cvt.ll
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=299335&r1=299334&r2=299335&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Sun Apr 2 10:52:28 2017
@@ -28958,8 +28958,10 @@ static SDValue combineBitcast(SDNode *N,
return DAG.getNode(X86ISD::MMX_MOVW2D, SDLoc(N00), VT, N00);
}
- // Detect bitcasts between v2i64/v2f64 extraction to x86mmx.
- if (VT == MVT::x86mmx && N0.getOpcode() == ISD::EXTRACT_VECTOR_ELT &&
+ // Detect bitcasts between element or subvector extraction to x86mmx.
+ if (VT == MVT::x86mmx &&
+ (N0.getOpcode() == ISD::EXTRACT_VECTOR_ELT ||
+ N0.getOpcode() == ISD::EXTRACT_SUBVECTOR) &&
isNullConstant(N0.getOperand(1))) {
SDValue N00 = N0->getOperand(0);
if (N00.getValueType().is128BitVector())
Modified: llvm/trunk/test/CodeGen/X86/mmx-cvt.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/mmx-cvt.ll?rev=299335&r1=299334&r2=299335&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/mmx-cvt.ll (original)
+++ llvm/trunk/test/CodeGen/X86/mmx-cvt.ll Sun Apr 2 10:52:28 2017
@@ -193,11 +193,10 @@ define void @fptosi_v4f32_v4i32(<4 x flo
; X86-NEXT: pushl %ebp
; X86-NEXT: movl %esp, %ebp
; X86-NEXT: andl $-8, %esp
-; X86-NEXT: subl $16, %esp
+; X86-NEXT: subl $8, %esp
; X86-NEXT: movl 8(%ebp), %eax
; X86-NEXT: cvttps2dq %xmm0, %xmm0
-; X86-NEXT: movlps %xmm0, {{[0-9]+}}(%esp)
-; X86-NEXT: movq {{[0-9]+}}(%esp), %mm0
+; X86-NEXT: movdq2q %xmm0, %mm0
; X86-NEXT: paddd %mm0, %mm0
; X86-NEXT: movq %mm0, (%esp)
; X86-NEXT: movl (%esp), %ecx
@@ -211,8 +210,7 @@ define void @fptosi_v4f32_v4i32(<4 x flo
; X64-LABEL: fptosi_v4f32_v4i32:
; X64: # BB#0:
; X64-NEXT: cvttps2dq %xmm0, %xmm0
-; X64-NEXT: movlps %xmm0, -{{[0-9]+}}(%rsp)
-; X64-NEXT: movq -{{[0-9]+}}(%rsp), %mm0
+; X64-NEXT: movdq2q %xmm0, %mm0
; X64-NEXT: paddd %mm0, %mm0
; X64-NEXT: movq %mm0, (%rdi)
; X64-NEXT: retq
More information about the llvm-commits
mailing list