aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/Alpha/AlphaISelLowering.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-02-14 17:28:50 +0000
committerDuncan Sands <baldrick@free.fr>2008-02-14 17:28:50 +0000
commitead972ea45c0c4dad4e2e5c8da1ad24abda2ef47 (patch)
tree6f4bfac1aa91b133348dc8e71727c95cb34d95f1 /lib/Target/Alpha/AlphaISelLowering.cpp
parente2ba64fc3785eb8bcc9a7fc2091c56ef056cbc07 (diff)
downloadexternal_llvm-ead972ea45c0c4dad4e2e5c8da1ad24abda2ef47.zip
external_llvm-ead972ea45c0c4dad4e2e5c8da1ad24abda2ef47.tar.gz
external_llvm-ead972ea45c0c4dad4e2e5c8da1ad24abda2ef47.tar.bz2
In TargetLowering::LowerCallTo, don't assert that
the return value is zero-extended if it isn't sign-extended. It may also be any-extended. Also, if a floating point value was returned in a larger floating point type, pass 1 as the second operand to FP_ROUND, which tells it that all the precision is in the original type. I think this is right but I could be wrong. Finally, when doing libcalls, set isZExt on a parameter if it is "unsigned". Currently isSExt is set when signed, and nothing is set otherwise. This should be right for all calls to standard library routines. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47122 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Alpha/AlphaISelLowering.cpp')
-rw-r--r--lib/Target/Alpha/AlphaISelLowering.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/Target/Alpha/AlphaISelLowering.cpp b/lib/Target/Alpha/AlphaISelLowering.cpp
index 774dad3..028f885 100644
--- a/lib/Target/Alpha/AlphaISelLowering.cpp
+++ b/lib/Target/Alpha/AlphaISelLowering.cpp
@@ -319,7 +319,7 @@ static SDOperand LowerRET(SDOperand Op, SelectionDAG &DAG) {
std::pair<SDOperand, SDOperand>
AlphaTargetLowering::LowerCallTo(SDOperand Chain, const Type *RetTy,
- bool RetTyIsSigned, bool isVarArg,
+ bool RetSExt, bool RetZExt, bool isVarArg,
unsigned CallingConv, bool isTailCall,
SDOperand Callee, ArgListTy &Args,
SelectionDAG &DAG) {
@@ -378,8 +378,16 @@ AlphaTargetLowering::LowerCallTo(SDOperand Chain, const Type *RetTy,
SDOperand RetVal = TheCall;
if (RetTyVT != ActualRetTyVT) {
- RetVal = DAG.getNode(RetTyIsSigned ? ISD::AssertSext : ISD::AssertZext,
- MVT::i64, RetVal, DAG.getValueType(RetTyVT));
+ ISD::NodeType AssertKind = ISD::DELETED_NODE;
+ if (RetSExt)
+ AssertKind = ISD::AssertSext;
+ else if (RetZExt)
+ AssertKind = ISD::AssertZext;
+
+ if (AssertKind != ISD::DELETED_NODE)
+ RetVal = DAG.getNode(AssertKind, MVT::i64, RetVal,
+ DAG.getValueType(RetTyVT));
+
RetVal = DAG.getNode(ISD::TRUNCATE, RetTyVT, RetVal);
}