JitIL: Omitted some extra MOVs when a next program counter is in a register.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6116 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
nodchip 2010-08-22 08:27:43 +00:00
parent 10a14d17d3
commit 43dc70eace
3 changed files with 11 additions and 13 deletions

View File

@ -653,9 +653,7 @@ static void regWriteExit(RegInfo& RI, InstLoc dest) {
if (isImm(*dest)) { if (isImm(*dest)) {
RI.Jit->WriteExit(RI.Build->GetImmValue(dest), RI.exitNumber++); RI.Jit->WriteExit(RI.Build->GetImmValue(dest), RI.exitNumber++);
} else { } else {
if (!regLocForInst(RI, dest).IsSimpleReg(EAX)) RI.Jit->WriteExitDestInOpArg(regLocForInst(RI, dest), RI.exitNumber++);
RI.Jit->MOV(32, R(EAX), regLocForInst(RI, dest));
RI.Jit->WriteExitDestInEAX(RI.exitNumber++);
} }
} }
@ -1608,7 +1606,7 @@ static void DoWriteCode(IRBuilder* ibuild, JitIL* Jit, bool UseProfile, bool Mak
} }
case InterpreterBranch: { case InterpreterBranch: {
Jit->MOV(32, R(EAX), M(&NPC)); Jit->MOV(32, R(EAX), M(&NPC));
Jit->WriteExitDestInEAX(0); Jit->WriteExitDestInOpArg(R(EAX), 0);
break; break;
} }
case RFIExit: { case RFIExit: {
@ -1625,7 +1623,7 @@ static void DoWriteCode(IRBuilder* ibuild, JitIL* Jit, bool UseProfile, bool Mak
Jit->MOV(32, M(&MSR), R(EAX)); Jit->MOV(32, M(&MSR), R(EAX));
// NPC = SRR0; // NPC = SRR0;
Jit->MOV(32, R(EAX), M(&SRR0)); Jit->MOV(32, R(EAX), M(&SRR0));
Jit->WriteRfiExitDestInEAX(); Jit->WriteRfiExitDestInOpArg(R(EAX));
break; break;
} }
case FPExceptionCheckStart: { case FPExceptionCheckStart: {

View File

@ -227,7 +227,7 @@ void JitIL::WriteCallInterpreter(UGeckoInstruction inst)
if (js.isLastInstruction) if (js.isLastInstruction)
{ {
MOV(32, R(EAX), M(&NPC)); MOV(32, R(EAX), M(&NPC));
WriteRfiExitDestInEAX(); WriteRfiExitDestInOpArg(R(EAX));
} }
} }
@ -248,7 +248,7 @@ void JitIL::HLEFunction(UGeckoInstruction _inst)
{ {
ABI_CallFunctionCC((void*)&HLE::Execute, js.compilerPC, _inst.hex); ABI_CallFunctionCC((void*)&HLE::Execute, js.compilerPC, _inst.hex);
MOV(32, R(EAX), M(&NPC)); MOV(32, R(EAX), M(&NPC));
WriteExitDestInEAX(0); WriteExitDestInOpArg(R(EAX), 0);
} }
void JitIL::DoNothing(UGeckoInstruction _inst) void JitIL::DoNothing(UGeckoInstruction _inst)
@ -316,17 +316,17 @@ void JitIL::WriteExit(u32 destination, int exit_num)
} }
} }
void JitIL::WriteExitDestInEAX(int exit_num) void JitIL::WriteExitDestInOpArg(const Gen::OpArg& arg, int exit_num)
{ {
MOV(32, M(&PC), R(EAX)); MOV(32, M(&PC), arg);
Cleanup(); Cleanup();
SUB(32, M(&CoreTiming::downcount), js.downcountAmount > 127 ? Imm32(js.downcountAmount) : Imm8(js.downcountAmount)); SUB(32, M(&CoreTiming::downcount), js.downcountAmount > 127 ? Imm32(js.downcountAmount) : Imm8(js.downcountAmount));
JMP(asm_routines.dispatcher, true); JMP(asm_routines.dispatcher, true);
} }
void JitIL::WriteRfiExitDestInEAX() void JitIL::WriteRfiExitDestInOpArg(const Gen::OpArg& arg)
{ {
MOV(32, M(&PC), R(EAX)); MOV(32, M(&PC), arg);
Cleanup(); Cleanup();
SUB(32, M(&CoreTiming::downcount), js.downcountAmount > 127 ? Imm32(js.downcountAmount) : Imm8(js.downcountAmount)); SUB(32, M(&CoreTiming::downcount), js.downcountAmount > 127 ? Imm32(js.downcountAmount) : Imm8(js.downcountAmount));
JMP(asm_routines.testExceptions, true); JMP(asm_routines.testExceptions, true);

View File

@ -110,9 +110,9 @@ public:
// Utilities for use by opcodes // Utilities for use by opcodes
void WriteExit(u32 destination, int exit_num); void WriteExit(u32 destination, int exit_num);
void WriteExitDestInEAX(int exit_num); void WriteExitDestInOpArg(const Gen::OpArg& arg, int exit_num);
void WriteExceptionExit(); void WriteExceptionExit();
void WriteRfiExitDestInEAX(); void WriteRfiExitDestInOpArg(const Gen::OpArg& arg);
void WriteCallInterpreter(UGeckoInstruction _inst); void WriteCallInterpreter(UGeckoInstruction _inst);
void Cleanup(); void Cleanup();