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

Fix a dumb bug of mine where we were mishandling the PPC ABI (undef handling).

This fixes voronoi and bh in Olden, allowing all of olden to pass!

llvm-svn: 23133
This commit is contained in:
Chris Lattner 2005-08-29 22:22:57 +00:00
parent 05f6bb1b68
commit 238fbfcf67

View File

@ -1479,27 +1479,28 @@ SDOperand PPC32DAGToDAGISel::Select(SDOperand Op) {
PPC::F8, PPC::F9, PPC::F10, PPC::F11, PPC::F12, PPC::F13
};
for (unsigned i = 2, e = N->getNumOperands(); i != e; ++i)
if (N->getOperand(i).getOpcode() != ISD::UNDEF) {
unsigned DestReg = 0;
MVT::ValueType RegTy;
if (N->getOperand(i).getValueType() == MVT::i32) {
assert(GPR_idx < 8 && "Too many int args");
DestReg = GPR[GPR_idx++];
RegTy = MVT::i32;
} else {
assert(MVT::isFloatingPoint(N->getOperand(i).getValueType()) &&
"Unpromoted integer arg?");
assert(FPR_idx < 13 && "Too many fp args");
DestReg = FPR[FPR_idx++];
RegTy = MVT::f64; // Even if this is really f32!
}
for (unsigned i = 2, e = N->getNumOperands(); i != e; ++i) {
unsigned DestReg = 0;
MVT::ValueType RegTy;
if (N->getOperand(i).getValueType() == MVT::i32) {
assert(GPR_idx < 8 && "Too many int args");
DestReg = GPR[GPR_idx++];
RegTy = MVT::i32;
} else {
assert(MVT::isFloatingPoint(N->getOperand(i).getValueType()) &&
"Unpromoted integer arg?");
assert(FPR_idx < 13 && "Too many fp args");
DestReg = FPR[FPR_idx++];
RegTy = MVT::f64; // Even if this is really f32!
}
if (N->getOperand(i).getOpcode() != ISD::UNDEF) {
SDOperand Reg = CurDAG->getRegister(DestReg, RegTy);
Chain = CurDAG->getNode(ISD::CopyToReg, MVT::Other, Chain, Reg,
Select(N->getOperand(i)));
CallOperands.push_back(Reg);
}
}
// Finally, once everything is in registers to pass to the call, emit the
// call itself.