Implement ExpandOperationResult for ppc i64 fp->int, which fixes
authorChris Lattner <sabre@nondot.org>
Wed, 28 Nov 2007 18:44:47 +0000 (18:44 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 28 Nov 2007 18:44:47 +0000 (18:44 +0000)
CodeGen/Generic/fp_to_int.ll among others.  Its unclear why this
just started failing...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44407 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPCISelLowering.cpp
lib/Target/PowerPC/PPCISelLowering.h

index 4d577adfc6e7eeb69acbe325ec15ebd31acc09fc..cf6ce8a1a043ae7ec9fffe6acfc55fe7fd0b57ad 100644 (file)
@@ -2076,6 +2076,7 @@ static SDOperand LowerSELECT_CC(SDOperand Op, SelectionDAG &DAG) {
   return SDOperand();
 }
 
+// FIXME: Split this code up when LegalizeDAGTypes lands.
 static SDOperand LowerFP_TO_SINT(SDOperand Op, SelectionDAG &DAG) {
   assert(MVT::isFloatingPoint(Op.getOperand(0).getValueType()));
   SDOperand Src = Op.getOperand(0);
@@ -3042,6 +3043,14 @@ SDOperand PPCTargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) {
   return SDOperand();
 }
 
+SDNode *PPCTargetLowering::ExpandOperationResult(SDNode *N, SelectionDAG &DAG) {
+  switch (N->getOpcode()) {
+  default: assert(0 && "Wasn't expecting to be able to lower this!");
+  case ISD::FP_TO_SINT: return LowerFP_TO_SINT(SDOperand(N, 0), DAG).Val;
+  }
+}
+
+
 //===----------------------------------------------------------------------===//
 //  Other Lowering Code
 //===----------------------------------------------------------------------===//
index 01a35a84553e5b1a0a1cbaebaa8c5e3cb7e84c50..2df750d92afb501b345b96eacfb88421ec08ea06 100644 (file)
@@ -248,6 +248,8 @@ namespace llvm {
     /// LowerOperation - Provide custom lowering hooks for some operations.
     ///
     virtual SDOperand LowerOperation(SDOperand Op, SelectionDAG &DAG);
+
+    virtual SDNode *ExpandOperationResult(SDNode *N, SelectionDAG &DAG);
     
     virtual SDOperand PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const;