summaryrefslogtreecommitdiffstats
path: root/llvm/lib
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
commit941d84a34d9fdda2519d84a0f9a9da1ccfdf8fb4 (patch)
tree9cd3a1a6c5a021dcb74accb48f28487628ccfd05 /llvm/lib
parent4c0f43edf6b34b0265d286de90098dfc4311a2c9 (diff)
downloadbcm5719-llvm-941d84a34d9fdda2519d84a0f9a9da1ccfdf8fb4.tar.gz
bcm5719-llvm-941d84a34d9fdda2519d84a0f9a9da1ccfdf8fb4.zip
fix float->long conversions on x86
llvm-svn: 22563
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 53e9b5cb63c..b47fc0df578 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud