aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-07-30 01:40:57 +0000
committerChris Lattner <sabre@nondot.org>2005-07-30 01:40:57 +0000
commitf20d183c2268553c738fefb014959ea924dd0555 (patch)
tree916952e0d44d7bc7652b747241a2cbf12b9478ce
parentc3f9dc198da335785b3db50a4fd4eac8c45e3ea5 (diff)
downloadexternal_llvm-f20d183c2268553c738fefb014959ea924dd0555.zip
external_llvm-f20d183c2268553c738fefb014959ea924dd0555.tar.gz
external_llvm-f20d183c2268553c738fefb014959ea924dd0555.tar.bz2
fix float->long conversions on x86
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22563 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeDAG.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 53e9b5c..b47fc0d 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -2779,11 +2779,18 @@ void SelectionDAGLegalize::ExpandOp(SDOperand Op, SDOperand &Lo, SDOperand &Hi){
// library functions.
case ISD::FP_TO_SINT:
if (TLI.getOperationAction(ISD::FP_TO_SINT, VT) == TargetLowering::Custom) {
- SDOperand Op = DAG.getNode(ISD::FP_TO_SINT, VT,
- LegalizeOp(Node->getOperand(0)));
+ SDOperand Op;
+ switch (getTypeAction(Node->getOperand(0).getValueType())) {
+ case Expand: assert(0 && "cannot expand FP!");
+ case Legal: Op = LegalizeOp(Node->getOperand(0)); break;
+ case Promote: Op = PromoteOp(Node->getOperand(0)); break;
+ }
+
+ Op = TLI.LowerOperation(DAG.getNode(ISD::FP_TO_SINT, VT, Op), DAG);
+
// Now that the custom expander is done, expand the result, which is still
// VT.
- ExpandOp(TLI.LowerOperation(Op, DAG), Lo, Hi);
+ ExpandOp(Op, Lo, Hi);
break;
}