1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00

Fix type mismatches when passing f32 values to calls

llvm-svn: 23159
This commit is contained in:
Chris Lattner 2005-08-30 21:28:19 +00:00
parent 36461b2e37
commit 0739f5a9da

View File

@ -1520,8 +1520,13 @@ SDOperand PPC32DAGToDAGISel::Select(SDOperand Op) {
} }
if (N->getOperand(i).getOpcode() != ISD::UNDEF) { if (N->getOperand(i).getOpcode() != ISD::UNDEF) {
Chain = CurDAG->getCopyToReg(Chain, DestReg, SDOperand Val = Select(N->getOperand(i));
Select(N->getOperand(i)), InFlag); if (Val.getValueType() != RegTy) {
// Use a register-register copy to handle f32 values in f64 registers.
assert(Val.getValueType() == MVT::f32 && RegTy == MVT::f64);
Val = CurDAG->getTargetNode(PPC::FMR, MVT::f64, Val);
}
Chain = CurDAG->getCopyToReg(Chain, DestReg, Val, InFlag);
InFlag = Chain.getValue(1); InFlag = Chain.getValue(1);
CallOperands.push_back(CurDAG->getRegister(DestReg, RegTy)); CallOperands.push_back(CurDAG->getRegister(DestReg, RegTy));
} }