diff options
author | Chris Lattner <sabre@nondot.org> | 2007-10-19 03:58:25 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-10-19 03:58:25 +0000 |
commit | 597ab48ca04e470dc90a2022ca7729dce68d092a (patch) | |
tree | 3d6b1706a80c33a487e25cde1bb7661b23fa2f53 /lib | |
parent | c224a53d7aa077d36f1495b242d7c8e4f324754d (diff) | |
download | external_llvm-597ab48ca04e470dc90a2022ca7729dce68d092a.zip external_llvm-597ab48ca04e470dc90a2022ca7729dce68d092a.tar.gz external_llvm-597ab48ca04e470dc90a2022ca7729dce68d092a.tar.bz2 |
Make use of TLI.ExpandOperation, remove softfloat stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43167 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeDAGTypes.cpp | 64 |
1 files changed, 15 insertions, 49 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAGTypes.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAGTypes.cpp index 62b9019..b7cec45 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAGTypes.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAGTypes.cpp @@ -725,19 +725,6 @@ void DAGTypeLegalizer::ExpandResult_LOAD(LoadSDNode *N, if (ExtType == ISD::NON_EXTLOAD) { Lo = DAG.getLoad(NVT, Ch, Ptr, N->getSrcValue(), SVOffset, isVolatile, Alignment); - if (VT == MVT::f32 || VT == MVT::f64) { - assert(0 && "FIXME: softfp should use promotion!"); -#if 0 - // f32->i32 or f64->i64 one to one expansion. - // Remember that we legalized the chain. - AddLegalizedOperand(SDOperand(Node, 1), LegalizeOp(Lo.getValue(1))); - // Recursively expand the new load. - if (getTypeAction(NVT) == Expand) - ExpandOp(Lo, Lo, Hi); - break; -#endif - } - // Increment the pointer to the other half. unsigned IncrementSize = MVT::getSizeInBits(Lo.getValueType())/8; Ptr = DAG.getNode(ISD::ADD, Ptr.getValueType(), Ptr, @@ -756,19 +743,6 @@ void DAGTypeLegalizer::ExpandResult_LOAD(LoadSDNode *N, } else { MVT::ValueType EVT = N->getLoadedVT(); - if (VT == MVT::f64 && EVT == MVT::f32) { - assert(0 && "FIXME: softfp should use promotion!"); -#if 0 - // f64 = EXTLOAD f32 should expand to LOAD, FP_EXTEND - SDOperand Load = DAG.getLoad(EVT, Ch, Ptr, N->getSrcValue(), - SVOffset, isVolatile, Alignment); - // Remember that we legalized the chain. - AddLegalizedOperand(SDOperand(Node, 1), LegalizeOp(Load.getValue(1))); - ExpandOp(DAG.getNode(ISD::FP_EXTEND, VT, Load), Lo, Hi); - break; -#endif - } - if (EVT == NVT) Lo = DAG.getLoad(NVT, Ch, Ptr, N->getSrcValue(), SVOffset, isVolatile, Alignment); @@ -843,13 +817,11 @@ void DAGTypeLegalizer::ExpandResult_ADDSUB(SDNode *N, // If the target wants to custom expand this, let them. if (TLI.getOperationAction(N->getOpcode(), VT) == TargetLowering::Custom) { - SDOperand Op = TLI.LowerOperation(SDOperand(N, 0), DAG); - // FIXME: Do a replace all uses with here! - assert(0 && "Custom not impl yet!"); - if (Op.Val) { -#if 0 - ExpandOp(Op, Lo, Hi); -#endif + std::pair<SDOperand,SDOperand> Ret = + TLI.ExpandOperation(SDOperand(N, 0), DAG); + if (Ret.first.Val) { + Lo = Ret.first; + Hi = Ret.second; return; } } @@ -905,13 +877,11 @@ void DAGTypeLegalizer::ExpandResult_MUL(SDNode *N, // If the target wants to custom expand this, let them. if (TLI.getOperationAction(ISD::MUL, VT) == TargetLowering::Custom) { - SDOperand New = TLI.LowerOperation(SDOperand(N, 0), DAG); - if (New.Val) { - // FIXME: Do a replace all uses with here! - assert(0 && "Custom not impl yet!"); -#if 0 - ExpandOp(New, Lo, Hi); -#endif + std::pair<SDOperand,SDOperand> Ret = + TLI.ExpandOperation(SDOperand(N, 0), DAG); + if (Ret.first.Val) { + Lo = Ret.first; + Hi = Ret.second; return; } } @@ -990,15 +960,11 @@ void DAGTypeLegalizer::ExpandResult_Shift(SDNode *N, // If the target wants custom lowering, do so. if (TLI.getOperationAction(N->getOpcode(), VT) == TargetLowering::Custom) { - SDOperand Op = TLI.LowerOperation(SDOperand(N, 0), DAG); - if (Op.Val) { - // Now that the custom expander is done, expand the result, which is - // still VT. - // FIXME: Do a replace all uses with here! - abort(); -#if 0 - ExpandOp(Op, Lo, Hi); -#endif + std::pair<SDOperand,SDOperand> Ret = + TLI.ExpandOperation(SDOperand(N, 0), DAG); + if (Ret.first.Val) { + Lo = Ret.first; + Hi = Ret.second; return; } } |