jit: Initialize startDefaultPrefix when switching.

This commit is contained in:
Unknown W. Brackets 2014-06-27 23:21:22 -07:00
parent 27870aa593
commit f544a87b2f
4 changed files with 9 additions and 4 deletions

View file

@ -88,7 +88,7 @@ Jit::Jit(MIPSState *mips) : blocks(mips, this), gpr(mips, &jo), fpr(mips), mips_
AllocCodeSpace(1024 * 1024 * 16); // 32MB is the absolute max because that's what an ARM branch instruction can reach, backwards and forwards.
GenerateFixedCode();
js.startDefaultPrefix = true;
js.startDefaultPrefix = mips_->HasDefaultPrefix();
}
void Jit::DoState(PointerWrap &p)

View file

@ -218,6 +218,10 @@ void MIPSState::Init() {
rng.Init(0x1337);
}
bool MIPSState::HasDefaultPrefix() const {
return vfpuCtrl[VFPU_CTRL_SPREFIX] == 0xe4 && vfpuCtrl[VFPU_CTRL_TPREFIX] == 0xe4 && vfpuCtrl[VFPU_CTRL_DPREFIX] == 0;
}
void MIPSState::UpdateCore(CPUCore desired) {
if (PSP_CoreParameter().cpuCore == desired) {
return;

View file

@ -186,6 +186,8 @@ public:
return (vfpuCtrl[VFPU_CTRL_DPREFIX] >> (8 + i)) & 1;
}
bool HasDefaultPrefix() const;
void SingleStep();
int RunLoopUntil(u64 globalTicks);
// To clear jit caches, etc.

View file

@ -135,10 +135,9 @@ Jit::Jit(MIPSState *mips) : blocks(mips, this), mips_(mips)
fpr.SetEmitter(this);
AllocCodeSpace(1024 * 1024 * 16);
asm_.Init(mips, this);
// TODO: If it becomes possible to switch from the interpreter, this should be set right.
js.startDefaultPrefix = true;
safeMemFuncs.Init(&thunks);
js.startDefaultPrefix = mips_->HasDefaultPrefix();
}
Jit::~Jit() {