mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Fix timing issue wiith JIT on non-Windows platforms
This commit is contained in:
parent
d56bc40db4
commit
d8da92befa
5 changed files with 17 additions and 8 deletions
|
@ -33,9 +33,10 @@ void Core_Halt(const char *msg);
|
|||
|
||||
bool Core_IsStepping();
|
||||
|
||||
// RUNNING must be at 0.
|
||||
enum CoreState
|
||||
{
|
||||
CORE_RUNNING,
|
||||
CORE_RUNNING = 0,
|
||||
CORE_STEPPING,
|
||||
CORE_POWERDOWN,
|
||||
CORE_ERROR,
|
||||
|
|
|
@ -79,6 +79,11 @@ void AsmRoutineManager::Generate(MIPSState *mips, MIPSComp::Jit *jit)
|
|||
ABI_CallFunction(reinterpret_cast<void *>(&CoreTiming::Advance));
|
||||
FixupBranch skipToRealDispatch = J(); //skip the sync and compare first time
|
||||
|
||||
dispatcherCheckCoreState = GetCodePtr();
|
||||
|
||||
CMP(32, M((void*)&coreState), Imm32(0));
|
||||
FixupBranch badCoreState = J_CC(CC_NZ, true);
|
||||
|
||||
dispatcher = GetCodePtr();
|
||||
// The result of slice decrementation should be in flags if somebody jumped here
|
||||
// IMPORTANT - We jump on negative, not carry!!!
|
||||
|
@ -145,9 +150,10 @@ void AsmRoutineManager::Generate(MIPSState *mips, MIPSComp::Jit *jit)
|
|||
|
||||
SetJumpTarget(bail);
|
||||
|
||||
CMP(32, M((void*)&coreState), Imm8(0));
|
||||
CMP(32, M((void*)&coreState), Imm32(0));
|
||||
J_CC(CC_Z, outerLoop, true);
|
||||
|
||||
SetJumpTarget(badCoreState);
|
||||
//Landing pad for drec space
|
||||
ABI_PopAllCalleeSavedRegsAndAdjustStack();
|
||||
RET();
|
||||
|
|
|
@ -65,6 +65,7 @@ public:
|
|||
|
||||
const u8 *outerLoop;
|
||||
const u8 *dispatcher;
|
||||
const u8 *dispatcherCheckCoreState;
|
||||
const u8 *dispatcherNoCheck;
|
||||
|
||||
const u8 *fpException;
|
||||
|
|
|
@ -76,6 +76,7 @@ void Jit::RunLoopUntil(u64 globalticks)
|
|||
{
|
||||
// TODO: copy globalticks somewhere
|
||||
((void (*)())asm_.enterCode)();
|
||||
// NOTICE_LOG(HLE, "Exited jitted code at %i, corestate=%i, dc=%i", CoreTiming::GetTicks() / 1000, (int)coreState, CoreTiming::downcount);
|
||||
}
|
||||
|
||||
const u8 *Jit::DoJit(u32 em_address, JitBlock *b)
|
||||
|
@ -168,7 +169,7 @@ void Jit::WriteExitDestInEAX()
|
|||
void Jit::WriteSyscallExit()
|
||||
{
|
||||
SUB(32, M(&CoreTiming::downcount), js.downcountAmount > 127 ? Imm32(js.downcountAmount) : Imm8(js.downcountAmount));
|
||||
JMP(asm_.dispatcher, true);
|
||||
JMP(asm_.dispatcherCheckCoreState, true);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
Loading…
Add table
Reference in a new issue