diff options
author | Evan Cheng <evan.cheng@apple.com> | 2006-12-09 02:42:38 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2006-12-09 02:42:38 +0000 |
commit | 1a8f1fe676f1d83e0da7336e744ebcdcc14a88c4 (patch) | |
tree | aa030c01227dbbbc4be161c8c37725487a17f7da /lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | |
parent | c9ab2f39ceadefa4ac8c0c922c55a76c0d637a6e (diff) |
Preliminary soft float support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32394 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index e43303538d..cb408e18a3 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -2954,7 +2954,10 @@ TargetLowering::LowerArguments(Function &F, SelectionDAG &DAG) { // integers it is. MVT::ValueType NVT = getTypeToTransformTo(VT); unsigned NumVals = MVT::getSizeInBits(VT)/MVT::getSizeInBits(NVT); - if (NumVals == 2) { + if (NumVals == 1) { + SDOperand Tmp = SDOperand(Result, i++); + Ops.push_back(DAG.getNode(ISD::BIT_CONVERT, VT, Tmp)); + } else if (NumVals == 2) { SDOperand Lo = SDOperand(Result, i++); SDOperand Hi = SDOperand(Result, i++); @@ -3040,7 +3043,10 @@ TargetLowering::LowerCallTo(SDOperand Chain, const Type *RetTy, bool isVarArg, // integers it is. MVT::ValueType NVT = getTypeToTransformTo(VT); unsigned NumVals = MVT::getSizeInBits(VT)/MVT::getSizeInBits(NVT); - if (NumVals == 2) { + if (NumVals == 1) { + Ops.push_back(DAG.getNode(ISD::BIT_CONVERT, VT, Op)); + Ops.push_back(DAG.getConstant(isSigned, MVT::i32)); + } else if (NumVals == 2) { SDOperand Lo = DAG.getNode(ISD::EXTRACT_ELEMENT, NVT, Op, DAG.getConstant(0, getPointerTy())); SDOperand Hi = DAG.getNode(ISD::EXTRACT_ELEMENT, NVT, Op, @@ -3166,7 +3172,10 @@ TargetLowering::LowerCallTo(SDOperand Chain, const Type *RetTy, bool isVarArg, ResVal = DAG.getNode(ISD::TRUNCATE, VT, ResVal); } else { assert(MVT::isFloatingPoint(VT)); - ResVal = DAG.getNode(ISD::FP_ROUND, VT, ResVal); + if (getTypeAction(VT) == Expand) + ResVal = DAG.getNode(ISD::BIT_CONVERT, VT, ResVal); + else + ResVal = DAG.getNode(ISD::FP_ROUND, VT, ResVal); } } } else if (RetTys.size() == 3) { |