JitDisable: Add option to disable regalloc across instructions (flush after every instruction)

This commit is contained in:
Henrik Rydgård 2019-06-02 16:06:10 +02:00
parent 1018c4dd97
commit 6fd40332fd
5 changed files with 30 additions and 0 deletions

View file

@ -349,7 +349,17 @@ const u8 *ArmJit::DoJit(u32 em_address, JitBlock *b)
js.compilerPC += 4;
js.numInstructions++;
if (jo.disableFlags & (uint32_t)JitDisable::REGALLOC_GPR) {
gpr.FlushAll();
}
if (jo.disableFlags & (uint32_t)JitDisable::REGALLOC_FPR) {
fpr.FlushAll();
FlushPrefixV();
}
#if !PPSSPP_ARCH(ARMV7)
// TODO: Is this path still even supported?
if ((GetCodePtr() - b->checkedEntry - partialFlushOffset) > 3200)
{
// We need to prematurely flush as we are out of range

View file

@ -336,6 +336,14 @@ const u8 *Arm64Jit::DoJit(u32 em_address, JitBlock *b) {
js.compilerPC += 4;
js.numInstructions++;
if (jo.disableFlags & (uint32_t)JitDisable::REGALLOC_GPR) {
gpr.FlushAll();
}
if (jo.disableFlags & (uint32_t)JitDisable::REGALLOC_FPR) {
fpr.FlushAll();
FlushPrefixV();
}
// Safety check, in case we get a bunch of really large jit ops without a lot of branching.
if (GetSpaceLeft() < 0x800 || js.numInstructions >= JitBlockCache::MAX_BLOCK_INSTRUCTIONS) {
FlushAll();

View file

@ -205,6 +205,8 @@ namespace MIPSComp {
POINTERIFY = 0x00400000,
STATIC_ALLOC = 0x00800000,
CACHE_POINTERS = 0x01000000,
REGALLOC_GPR = 0x02000000, // Doesn't really disable regalloc, but flushes after every instr.
REGALLOC_FPR = 0x04000000,
ALL_FLAGS = 0x01FFFFFF,
};

View file

@ -389,6 +389,14 @@ const u8 *Jit::DoJit(u32 em_address, JitBlock *b) {
js.compilerPC += 4;
js.numInstructions++;
if (jo.disableFlags & (uint32_t)JitDisable::REGALLOC_GPR) {
gpr.Flush();
}
if (jo.disableFlags & (uint32_t)JitDisable::REGALLOC_FPR) {
fpr.Flush();
FlushPrefixV();
}
// Safety check, in case we get a bunch of really large jit ops without a lot of branching.
if (GetSpaceLeft() < 0x800 || js.numInstructions >= JitBlockCache::MAX_BLOCK_INSTRUCTIONS) {
FlushAll();

View file

@ -350,6 +350,8 @@ static const JitDisableFlag jitDisableFlags[] = {
{ MIPSComp::JitDisable::POINTERIFY, "Pointerify" },
{ MIPSComp::JitDisable::STATIC_ALLOC, "Static regalloc" },
{ MIPSComp::JitDisable::CACHE_POINTERS, "Cached pointers" },
{ MIPSComp::JitDisable::REGALLOC_GPR, "GPR Regalloc across instructions" },
{ MIPSComp::JitDisable::REGALLOC_FPR, "FPR Regalloc across instructions" },
};
void JitDebugScreen::CreateViews() {