diff options
| author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2017-04-02 17:45:41 +0000 |
|---|---|---|
| committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2017-04-02 17:45:41 +0000 |
| commit | 0e2f8cd8758614fcf70ace2213f000e640118609 (patch) | |
| tree | ae146a0b6389879423d9e8238cd5544842929815 /llvm/lib/Target/X86 | |
| parent | d133591a7e6804e7cb59b4b003f94c8f02b5f90a (diff) | |
| download | bcm5719-llvm-0e2f8cd8758614fcf70ace2213f000e640118609.tar.gz bcm5719-llvm-0e2f8cd8758614fcf70ace2213f000e640118609.zip | |
[X86][MMX] Improve support for folding fptosi from XMM to MMX
llvm-svn: 299338
Diffstat (limited to 'llvm/lib/Target/X86')
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 567eae52236..57d8139acba 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -28969,6 +28969,16 @@ static SDValue combineBitcast(SDNode *N, SelectionDAG &DAG, DAG.getBitcast(MVT::v2i64, N00)); } + // Detect bitcasts from FP_TO_SINT to x86mmx. + if (VT == MVT::x86mmx && SrcVT == MVT::v2i32 && + N0.getOpcode() == ISD::FP_TO_SINT) { + SDLoc DL(N0); + SDValue Res = DAG.getNode(ISD::CONCAT_VECTORS, DL, MVT::v4i32, N0, + DAG.getUNDEF(MVT::v2i32)); + return DAG.getNode(X86ISD::MOVDQ2Q, DL, VT, + DAG.getBitcast(MVT::v2i64, Res)); + } + // Convert a bitcasted integer logic operation that has one bitcasted // floating-point operand into a floating-point logic operation. This may // create a load of a constant, but that is cheaper than materializing the |

