From 1946b2ff30134aee019e94a2005ce913e37d2125 Mon Sep 17 00:00:00 2001 From: Duraid Madina Date: Thu, 19 Jan 2006 08:31:51 +0000 Subject: [PATCH] fix calls that return f32 llvm-svn: 25455 --- lib/Target/IA64/IA64ISelLowering.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/Target/IA64/IA64ISelLowering.cpp b/lib/Target/IA64/IA64ISelLowering.cpp index a9ce9df2b9d..c4a4cdf9435 100644 --- a/lib/Target/IA64/IA64ISelLowering.cpp +++ b/lib/Target/IA64/IA64ISelLowering.cpp @@ -473,7 +473,7 @@ IA64TargetLowering::LowerCallTo(SDOperand Chain, SDOperand RetVal; if (RetTyVT != MVT::isVoid) { switch (RetTyVT) { - default: // assert(0 && "Unknown value type to return!"); + default: assert(0 && "Unknown value type to return!"); case MVT::i1: { // bools are just like other integers (returned in r8) SDOperand boolInR8 = DAG.getCopyFromReg(Chain, IA64::r8, MVT::i64, InFlag); InFlag = boolInR8.getValue(2); @@ -491,7 +491,7 @@ IA64TargetLowering::LowerCallTo(SDOperand Chain, RetVal = DAG.getCopyFromReg(Chain, IA64::r8, MVT::i64, InFlag); Chain = RetVal.getValue(1); - // Add a note to keep track of whether it is sign or zero extended - TODO: bools + // keep track of whether it is sign or zero extended (todo: bools?) RetVal = DAG.getNode(RetTy->isSigned() ? ISD::AssertSext :ISD::AssertZext, MVT::i64, RetVal, DAG.getValueType(RetTyVT)); RetVal = DAG.getNode(ISD::TRUNCATE, RetTyVT, RetVal); @@ -501,6 +501,11 @@ IA64TargetLowering::LowerCallTo(SDOperand Chain, Chain = RetVal.getValue(1); InFlag = RetVal.getValue(2); // XXX dead break; + case MVT::f32: + RetVal = DAG.getCopyFromReg(Chain, IA64::F8, MVT::f64, InFlag); + Chain = RetVal.getValue(1); + RetVal = DAG.getNode(ISD::TRUNCATE, MVT::f32, RetVal); + break; case MVT::f64: RetVal = DAG.getCopyFromReg(Chain, IA64::F8, MVT::f64, InFlag); Chain = RetVal.getValue(1);