diff options
author | Chris Lattner <sabre@nondot.org> | 2005-07-30 00:04:12 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-07-30 00:04:12 +0000 |
commit | f1fa74ee0d30dfdb854f7d3f5ee67437cc82e250 (patch) | |
tree | 577454744e4370805aab2b1f857afe0a9d79ebb7 | |
parent | a00269bc3e97d4e53ed196325ef02e6d1f3d70dc (diff) |
Allow targets to have custom expanders for FP_TO_*INT conversions where
both the src and dest values are legal
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22555 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 8508030b82..53e9b5cb63 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -1570,21 +1570,27 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { case ISD::FP_TO_UINT: switch (getTypeAction(Node->getOperand(0).getValueType())) { case Legal: + Tmp1 = LegalizeOp(Node->getOperand(0)); + switch (TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0))){ default: assert(0 && "Unknown operation action!"); case TargetLowering::Expand: assert(0 && "Cannot expand FP_TO*INT yet"); case TargetLowering::Promote: - Result = PromoteLegalFP_TO_INT(LegalizeOp(Node->getOperand(0)), - Node->getValueType(0), + Result = PromoteLegalFP_TO_INT(Tmp1, Node->getValueType(0), Node->getOpcode() == ISD::FP_TO_SINT); AddLegalizedOperand(Op, Result); return Result; case TargetLowering::Legal: break; + case TargetLowering::Custom: + Result = DAG.getNode(Node->getOpcode(), Node->getValueType(0), Tmp1); + Result = TLI.LowerOperation(Result, DAG); + AddLegalizedOperand(Op, Result); + NeedsAnotherIteration = true; + return Result; } - Tmp1 = LegalizeOp(Node->getOperand(0)); if (Tmp1 != Node->getOperand(0)) Result = DAG.getNode(Node->getOpcode(), Node->getValueType(0), Tmp1); break; |