1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 13:02:52 +02:00

Deal with call return values.

Don't put NOPs in delay slots at all. We'll have a fix-up pass later.

llvm-svn: 12725
This commit is contained in:
Brian Gaeke 2004-04-06 22:09:23 +00:00
parent cb52af2958
commit da22005285

View File

@ -229,8 +229,22 @@ bool V8ISel::runOnFunction(Function &Fn) {
void V8ISel::visitCallInst(CallInst &I) {
assert (I.getNumOperands () == 1 && "Can't handle call args yet");
unsigned DestReg = getReg (I);
BuildMI (BB, V8::CALL, 1).addPCDisp (I.getOperand (0));
BuildMI (BB, V8::NOP, 0); // NOP in delay slot
if (I.getType ()->getPrimitiveID () == Type::VoidTyID)
return;
// Deal w/ return value
switch (getClass (I.getType ())) {
case cByte:
case cShort:
case cInt:
// Schlep it over into the destination register
BuildMI (BB, V8::ORrr, 2, DestReg).addReg(V8::G0).addReg(V8::O0);
break;
default:
visitInstruction (I);
return;
}
}
void V8ISel::visitReturnInst(ReturnInst &I) {