diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-08-10 20:25:59 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-08-10 20:25:59 +0000 |
commit | e2b861f7d91c09115cd637614b1bc5f5154bce1d (patch) | |
tree | c71cfda8ed5cd85d772e28ce75e99638523aea48 /lib/Target/ARM | |
parent | 70671845adce8ab36ae596bb06d0375459a7a2af (diff) | |
download | external_llvm-e2b861f7d91c09115cd637614b1bc5f5154bce1d.zip external_llvm-e2b861f7d91c09115cd637614b1bc5f5154bce1d.tar.gz external_llvm-e2b861f7d91c09115cd637614b1bc5f5154bce1d.tar.bz2 |
Handle the constantfp created during post-legalization dag combiner phase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78594 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM')
-rw-r--r-- | lib/Target/ARM/ARMISelDAGToDAG.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/Target/ARM/ARMISelDAGToDAG.cpp b/lib/Target/ARM/ARMISelDAGToDAG.cpp index 3304900..823ae2f 100644 --- a/lib/Target/ARM/ARMISelDAGToDAG.cpp +++ b/lib/Target/ARM/ARMISelDAGToDAG.cpp @@ -988,6 +988,24 @@ SDNode *ARMDAGToDAGISel::Select(SDValue Op) { // Other cases are autogenerated. break; } + case ISD::ConstantFP: { + ConstantFPSDNode *CFP = cast<ConstantFPSDNode>(N); + MVT VT = CFP->getValueType(0); + ConstantFP *LLVMC = const_cast<ConstantFP*>(CFP->getConstantFPValue()); + SDValue CPIdx = CurDAG->getTargetConstantPool(LLVMC, TLI.getPointerTy()); + SDNode *ResNode; + SDValue Ops[] = { + CPIdx, + CurDAG->getTargetConstant(0, MVT::i32), + getAL(CurDAG), + CurDAG->getRegister(0, MVT::i32), + CurDAG->getEntryNode() + }; + unsigned Opc = (VT == MVT::f32) ? ARM::FLDS : ARM::FLDD; + ResNode=CurDAG->getTargetNode(Opc, dl, VT, MVT::Other, Ops, 5); + ReplaceUses(Op, SDValue(ResNode, 0)); + return NULL; + } case ISD::FrameIndex: { // Selects to ADDri FI, 0 which in turn will become ADDri SP, imm. int FI = cast<FrameIndexSDNode>(N)->getIndex(); |