[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri Jul 29 18:41:08 PDT 2005



Changes in directory llvm/lib/CodeGen/SelectionDAG:

LegalizeDAG.cpp updated: 1.148 -> 1.149
---
Log message:

fix float->long conversions on x86


---
Diffs of the changes:  (+10 -3)

 LegalizeDAG.cpp |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.148 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.149
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.148	Fri Jul 29 19:04:12 2005
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp	Fri Jul 29 20:40:57 2005
@@ -2779,11 +2779,18 @@
     // 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;
     }
     






More information about the llvm-commits mailing list