summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-07-30 00:04:12 +0000
committerChris Lattner <sabre@nondot.org>2005-07-30 00:04:12 +0000
commitf59b2daddb7fb9364c24161a422ded9ecd4fc6ec (patch)
tree037a56b4595acab006276a293a4c3cd1c0b45a07 /llvm/lib
parent0940218ccaba85b05825bacd4a1b187c3595be3e (diff)
downloadbcm5719-llvm-f59b2daddb7fb9364c24161a422ded9ecd4fc6ec.tar.gz
bcm5719-llvm-f59b2daddb7fb9364c24161a422ded9ecd4fc6ec.zip
Allow targets to have custom expanders for FP_TO_*INT conversions where
both the src and dest values are legal llvm-svn: 22555
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 8508030b820..53e9b5cb63c 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud