diff options
author | Chris Lattner <sabre@nondot.org> | 2007-11-28 18:44:47 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-11-28 18:44:47 +0000 |
commit | 1f873003266fbdec7c2c48a965c60f4e2e35a158 (patch) | |
tree | ba7b97de75ebd8c34eb9f63380b907645a7d76f1 | |
parent | 5e037fce2b037fce1aa5a96d2c917fcb716c5a33 (diff) |
Implement ExpandOperationResult for ppc i64 fp->int, which fixes
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
-rw-r--r-- | lib/Target/PowerPC/PPCISelLowering.cpp | 9 | ||||
-rw-r--r-- | lib/Target/PowerPC/PPCISelLowering.h | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/lib/Target/PowerPC/PPCISelLowering.cpp b/lib/Target/PowerPC/PPCISelLowering.cpp index 4d577adfc6..cf6ce8a1a0 100644 --- a/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/lib/Target/PowerPC/PPCISelLowering.cpp @@ -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 //===----------------------------------------------------------------------===// diff --git a/lib/Target/PowerPC/PPCISelLowering.h b/lib/Target/PowerPC/PPCISelLowering.h index 01a35a8455..2df750d92a 100644 --- a/lib/Target/PowerPC/PPCISelLowering.h +++ b/lib/Target/PowerPC/PPCISelLowering.h @@ -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; |