Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #831 from FioraAeterna/cleanupimm
JIT: cleanup unnecessary immedate size-checking logic
  • Loading branch information
Sonicadvance1 committed Aug 19, 2014
2 parents 2bcc8d4 + 1a36210 commit 355f7b3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions Source/Core/Core/PowerPC/Jit64/Jit.cpp
Expand Up @@ -277,7 +277,7 @@ void Jit64::WriteExit(u32 destination)
{
Cleanup();

SUB(32, M(&PowerPC::ppcState.downcount), js.downcountAmount > 127 ? Imm32(js.downcountAmount) : Imm8(js.downcountAmount));
SUB(32, M(&PowerPC::ppcState.downcount), Imm32(js.downcountAmount));

//If nobody has taken care of this yet (this can be removed when all branches are done)
JitBlock *b = js.curBlock;
Expand Down Expand Up @@ -307,7 +307,7 @@ void Jit64::WriteExitDestInEAX()
{
MOV(32, M(&PC), R(EAX));
Cleanup();
SUB(32, M(&PowerPC::ppcState.downcount), js.downcountAmount > 127 ? Imm32(js.downcountAmount) : Imm8(js.downcountAmount));
SUB(32, M(&PowerPC::ppcState.downcount), Imm32(js.downcountAmount));
JMP(asm_routines.dispatcher, true);
}

Expand All @@ -317,7 +317,7 @@ void Jit64::WriteRfiExitDestInEAX()
MOV(32, M(&NPC), R(EAX));
Cleanup();
ABI_CallFunction(reinterpret_cast<void *>(&PowerPC::CheckExceptions));
SUB(32, M(&PowerPC::ppcState.downcount), js.downcountAmount > 127 ? Imm32(js.downcountAmount) : Imm8(js.downcountAmount));
SUB(32, M(&PowerPC::ppcState.downcount), Imm32(js.downcountAmount));
JMP(asm_routines.dispatcher, true);
}

Expand All @@ -327,7 +327,7 @@ void Jit64::WriteExceptionExit()
MOV(32, R(EAX), M(&PC));
MOV(32, M(&NPC), R(EAX));
ABI_CallFunction(reinterpret_cast<void *>(&PowerPC::CheckExceptions));
SUB(32, M(&PowerPC::ppcState.downcount), js.downcountAmount > 127 ? Imm32(js.downcountAmount) : Imm8(js.downcountAmount));
SUB(32, M(&PowerPC::ppcState.downcount), Imm32(js.downcountAmount));
JMP(asm_routines.dispatcher, true);
}

Expand All @@ -337,7 +337,7 @@ void Jit64::WriteExternalExceptionExit()
MOV(32, R(EAX), M(&PC));
MOV(32, M(&NPC), R(EAX));
ABI_CallFunction(reinterpret_cast<void *>(&PowerPC::CheckExternalExceptions));
SUB(32, M(&PowerPC::ppcState.downcount), js.downcountAmount > 127 ? Imm32(js.downcountAmount) : Imm8(js.downcountAmount));
SUB(32, M(&PowerPC::ppcState.downcount), Imm32(js.downcountAmount));
JMP(asm_routines.dispatcher, true);
}

Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/PowerPC/Jit64IL/IR_X86.cpp
Expand Up @@ -1784,7 +1784,7 @@ static void DoWriteCode(IRBuilder* ibuild, JitIL* Jit, u32 exitAddress) {
// If a FPU exception occurs, the exception handler will read
// from PC. Update PC with the latest value in case that happens.
Jit->MOV(32, M(&PC), Imm32(InstLoc));
Jit->SUB(32, M(&PowerPC::ppcState.downcount), Jit->js.downcountAmount > 127 ? Imm32(Jit->js.downcountAmount) : Imm8(Jit->js.downcountAmount));
Jit->SUB(32, M(&PowerPC::ppcState.downcount), Imm32(Jit->js.downcountAmount));
Jit->OR(32, M((void *)&PowerPC::ppcState.Exceptions), Imm32(EXCEPTION_FPU_UNAVAILABLE));
Jit->WriteExceptionExit();
Jit->SetJumpTarget(b1);
Expand Down
8 changes: 4 additions & 4 deletions Source/Core/Core/PowerPC/Jit64IL/JitIL.cpp
Expand Up @@ -379,7 +379,7 @@ void JitIL::WriteExit(u32 destination)
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bJITILTimeProfiling) {
ABI_CallFunction((void *)JitILProfiler::End);
}
SUB(32, M(&PowerPC::ppcState.downcount), js.downcountAmount > 127 ? Imm32(js.downcountAmount) : Imm8(js.downcountAmount));
SUB(32, M(&PowerPC::ppcState.downcount), Imm32(js.downcountAmount));

//If nobody has taken care of this yet (this can be removed when all branches are done)
JitBlock *b = js.curBlock;
Expand Down Expand Up @@ -411,7 +411,7 @@ void JitIL::WriteExitDestInOpArg(const Gen::OpArg& arg)
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bJITILTimeProfiling) {
ABI_CallFunction((void *)JitILProfiler::End);
}
SUB(32, M(&PowerPC::ppcState.downcount), js.downcountAmount > 127 ? Imm32(js.downcountAmount) : Imm8(js.downcountAmount));
SUB(32, M(&PowerPC::ppcState.downcount), Imm32(js.downcountAmount));
JMP(asm_routines.dispatcher, true);
}

Expand All @@ -424,7 +424,7 @@ void JitIL::WriteRfiExitDestInOpArg(const Gen::OpArg& arg)
ABI_CallFunction((void *)JitILProfiler::End);
}
ABI_CallFunction(reinterpret_cast<void *>(&PowerPC::CheckExceptions));
SUB(32, M(&PowerPC::ppcState.downcount), js.downcountAmount > 127 ? Imm32(js.downcountAmount) : Imm8(js.downcountAmount));
SUB(32, M(&PowerPC::ppcState.downcount), Imm32(js.downcountAmount));
JMP(asm_routines.dispatcher, true);
}

Expand All @@ -437,7 +437,7 @@ void JitIL::WriteExceptionExit()
MOV(32, R(EAX), M(&PC));
MOV(32, M(&NPC), R(EAX));
ABI_CallFunction(reinterpret_cast<void *>(&PowerPC::CheckExceptions));
SUB(32, M(&PowerPC::ppcState.downcount), js.downcountAmount > 127 ? Imm32(js.downcountAmount) : Imm8(js.downcountAmount));
SUB(32, M(&PowerPC::ppcState.downcount), Imm32(js.downcountAmount));
JMP(asm_routines.dispatcher, true);
}

Expand Down

0 comments on commit 355f7b3

Please sign in to comment.