mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-15 16:59:18 +01:00
Merge pull request #8472 from degasus/jitsetting
Core/Jits: Adds an option to disable the register cache.
This commit is contained in:
commit
e323f47ceb
@ -641,6 +641,8 @@ public final class SettingsFragmentPresenter
|
|||||||
Setting jitSystemRegistersOff =
|
Setting jitSystemRegistersOff =
|
||||||
debugSection.getSetting(SettingsFile.KEY_DEBUG_JITSYSTEMREGISTEROFF);
|
debugSection.getSetting(SettingsFile.KEY_DEBUG_JITSYSTEMREGISTEROFF);
|
||||||
Setting jitBranchOff = debugSection.getSetting(SettingsFile.KEY_DEBUG_JITBRANCHOFF);
|
Setting jitBranchOff = debugSection.getSetting(SettingsFile.KEY_DEBUG_JITBRANCHOFF);
|
||||||
|
Setting jitRegisterCacheOff =
|
||||||
|
debugSection.getSetting(SettingsFile.KEY_DEBUG_JITREGISTERCACHEOFF);
|
||||||
|
|
||||||
sl.add(new HeaderSetting(null, null, R.string.debug_warning, 0));
|
sl.add(new HeaderSetting(null, null, R.string.debug_warning, 0));
|
||||||
|
|
||||||
@ -673,6 +675,9 @@ public final class SettingsFragmentPresenter
|
|||||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_DEBUG_JITBRANCHOFF, Settings.SECTION_DEBUG,
|
sl.add(new CheckBoxSetting(SettingsFile.KEY_DEBUG_JITBRANCHOFF, Settings.SECTION_DEBUG,
|
||||||
R.string.debug_jitbranchoff, 0, false,
|
R.string.debug_jitbranchoff, 0, false,
|
||||||
jitBranchOff));
|
jitBranchOff));
|
||||||
|
sl.add(new CheckBoxSetting(SettingsFile.KEY_DEBUG_JITREGISTERCACHEOFF, Settings.SECTION_DEBUG,
|
||||||
|
R.string.debug_jitregistercacheoff, 0, false,
|
||||||
|
jitRegisterCacheOff));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addStereoSettings(ArrayList<SettingsItem> sl)
|
private void addStereoSettings(ArrayList<SettingsItem> sl)
|
||||||
|
@ -104,6 +104,7 @@ public final class SettingsFile
|
|||||||
public static final String KEY_DEBUG_JITPAIREDOFF = "JitPairedOff";
|
public static final String KEY_DEBUG_JITPAIREDOFF = "JitPairedOff";
|
||||||
public static final String KEY_DEBUG_JITSYSTEMREGISTEROFF = "JitSystemRegistersOff";
|
public static final String KEY_DEBUG_JITSYSTEMREGISTEROFF = "JitSystemRegistersOff";
|
||||||
public static final String KEY_DEBUG_JITBRANCHOFF = "JitBranchOff";
|
public static final String KEY_DEBUG_JITBRANCHOFF = "JitBranchOff";
|
||||||
|
public static final String KEY_DEBUG_JITREGISTERCACHEOFF = "JitRegisterCacheOff";
|
||||||
|
|
||||||
public static final String KEY_GCPAD_TYPE = "SIDevice";
|
public static final String KEY_GCPAD_TYPE = "SIDevice";
|
||||||
public static final String KEY_GCPAD_G_TYPE = "PadType";
|
public static final String KEY_GCPAD_G_TYPE = "PadType";
|
||||||
|
@ -257,6 +257,7 @@
|
|||||||
<string name="debug_jitpairedoff">Jit Paired Disabled</string>
|
<string name="debug_jitpairedoff">Jit Paired Disabled</string>
|
||||||
<string name="debug_jitsystemregistersoffr">Jit System Registers Disabled</string>
|
<string name="debug_jitsystemregistersoffr">Jit System Registers Disabled</string>
|
||||||
<string name="debug_jitbranchoff">Jit Branch Disabled</string>
|
<string name="debug_jitbranchoff">Jit Branch Disabled</string>
|
||||||
|
<string name="debug_jitregistercacheoff">Jit Register Cache Disabled</string>
|
||||||
|
|
||||||
<!-- Miscellaneous -->
|
<!-- Miscellaneous -->
|
||||||
<string name="yes">Yes</string>
|
<string name="yes">Yes</string>
|
||||||
|
@ -355,6 +355,7 @@ void SConfig::SaveJitDebugSettings(IniFile& ini)
|
|||||||
section->Set("JitPairedOff", bJITPairedOff);
|
section->Set("JitPairedOff", bJITPairedOff);
|
||||||
section->Set("JitSystemRegistersOff", bJITSystemRegistersOff);
|
section->Set("JitSystemRegistersOff", bJITSystemRegistersOff);
|
||||||
section->Set("JitBranchOff", bJITBranchOff);
|
section->Set("JitBranchOff", bJITBranchOff);
|
||||||
|
section->Set("JitRegisterCacheOff", bJITRegisterCacheOff);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SConfig::LoadSettings()
|
void SConfig::LoadSettings()
|
||||||
@ -647,6 +648,7 @@ void SConfig::LoadJitDebugSettings(IniFile& ini)
|
|||||||
section->Get("JitPairedOff", &bJITPairedOff, false);
|
section->Get("JitPairedOff", &bJITPairedOff, false);
|
||||||
section->Get("JitSystemRegistersOff", &bJITSystemRegistersOff, false);
|
section->Get("JitSystemRegistersOff", &bJITSystemRegistersOff, false);
|
||||||
section->Get("JitBranchOff", &bJITBranchOff, false);
|
section->Get("JitBranchOff", &bJITBranchOff, false);
|
||||||
|
section->Get("JitRegisterCacheOff", &bJITRegisterCacheOff, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SConfig::ResetRunningGameMetadata()
|
void SConfig::ResetRunningGameMetadata()
|
||||||
@ -799,6 +801,7 @@ void SConfig::LoadDefaults()
|
|||||||
bJITPairedOff = false;
|
bJITPairedOff = false;
|
||||||
bJITSystemRegistersOff = false;
|
bJITSystemRegistersOff = false;
|
||||||
bJITBranchOff = false;
|
bJITBranchOff = false;
|
||||||
|
bJITRegisterCacheOff = false;
|
||||||
|
|
||||||
ResetRunningGameMetadata();
|
ResetRunningGameMetadata();
|
||||||
}
|
}
|
||||||
|
@ -105,6 +105,7 @@ struct SConfig
|
|||||||
bool bJITPairedOff = false;
|
bool bJITPairedOff = false;
|
||||||
bool bJITSystemRegistersOff = false;
|
bool bJITSystemRegistersOff = false;
|
||||||
bool bJITBranchOff = false;
|
bool bJITBranchOff = false;
|
||||||
|
bool bJITRegisterCacheOff = false;
|
||||||
|
|
||||||
bool bFastmem;
|
bool bFastmem;
|
||||||
bool bFPRF = false;
|
bool bFPRF = false;
|
||||||
|
@ -1002,6 +1002,13 @@ u8* Jit64::DoJit(u32 em_address, JitBlock* b, u32 nextPC)
|
|||||||
SetJumpTarget(noBreakpoint);
|
SetJumpTarget(noBreakpoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (SConfig::GetInstance().bJITRegisterCacheOff)
|
||||||
|
{
|
||||||
|
gpr.Flush();
|
||||||
|
fpr.Flush();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
// If we have an input register that is going to be used again, load it pre-emptively,
|
// If we have an input register that is going to be used again, load it pre-emptively,
|
||||||
// even if the instruction doesn't strictly need it in a register, to avoid redundant
|
// even if the instruction doesn't strictly need it in a register, to avoid redundant
|
||||||
// loads later. Of course, don't do this if we're already out of registers.
|
// loads later. Of course, don't do this if we're already out of registers.
|
||||||
@ -1011,6 +1018,7 @@ u8* Jit64::DoJit(u32 em_address, JitBlock* b, u32 nextPC)
|
|||||||
// prioritize the more important registers.
|
// prioritize the more important registers.
|
||||||
gpr.PreloadRegisters(op.regsIn & op.gprInReg);
|
gpr.PreloadRegisters(op.regsIn & op.gprInReg);
|
||||||
fpr.PreloadRegisters(op.fregsIn & op.fprInXmm);
|
fpr.PreloadRegisters(op.fregsIn & op.fprInXmm);
|
||||||
|
}
|
||||||
|
|
||||||
CompileInstruction(op);
|
CompileInstruction(op);
|
||||||
|
|
||||||
|
@ -779,6 +779,13 @@ void JitArm64::DoJit(u32 em_address, JitBlock* b, u32 nextPC)
|
|||||||
js.firstFPInstructionFound = true;
|
js.firstFPInstructionFound = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (SConfig::GetInstance().bJITRegisterCacheOff)
|
||||||
|
{
|
||||||
|
gpr.Flush(FLUSH_ALL);
|
||||||
|
fpr.Flush(FLUSH_ALL);
|
||||||
|
FlushCarry();
|
||||||
|
}
|
||||||
|
|
||||||
CompileInstruction(op);
|
CompileInstruction(op);
|
||||||
if (!CanMergeNextInstructions(1) || js.op[1].opinfo->type != ::OpType::Integer)
|
if (!CanMergeNextInstructions(1) || js.op[1].opinfo->type != ::OpType::Integer)
|
||||||
FlushCarry();
|
FlushCarry();
|
||||||
|
@ -142,7 +142,7 @@ void MenuBar::OnEmulationStateChanged(Core::State state)
|
|||||||
{m_jit_off, m_jit_loadstore_off, m_jit_loadstore_lbzx_off, m_jit_loadstore_lxz_off,
|
{m_jit_off, m_jit_loadstore_off, m_jit_loadstore_lbzx_off, m_jit_loadstore_lxz_off,
|
||||||
m_jit_loadstore_lwz_off, m_jit_loadstore_floating_off, m_jit_loadstore_paired_off,
|
m_jit_loadstore_lwz_off, m_jit_loadstore_floating_off, m_jit_loadstore_paired_off,
|
||||||
m_jit_floatingpoint_off, m_jit_integer_off, m_jit_paired_off, m_jit_systemregisters_off,
|
m_jit_floatingpoint_off, m_jit_integer_off, m_jit_paired_off, m_jit_systemregisters_off,
|
||||||
m_jit_branch_off})
|
m_jit_branch_off, m_jit_register_cache_off})
|
||||||
{
|
{
|
||||||
action->setEnabled(running && !playing);
|
action->setEnabled(running && !playing);
|
||||||
}
|
}
|
||||||
@ -896,6 +896,14 @@ void MenuBar::AddJITMenu()
|
|||||||
SConfig::GetInstance().bJITBranchOff = enabled;
|
SConfig::GetInstance().bJITBranchOff = enabled;
|
||||||
ClearCache();
|
ClearCache();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
m_jit_register_cache_off = m_jit->addAction(tr("JIT Register Cache Off"));
|
||||||
|
m_jit_register_cache_off->setCheckable(true);
|
||||||
|
m_jit_register_cache_off->setChecked(SConfig::GetInstance().bJITRegisterCacheOff);
|
||||||
|
connect(m_jit_register_cache_off, &QAction::toggled, [this](bool enabled) {
|
||||||
|
SConfig::GetInstance().bJITRegisterCacheOff = enabled;
|
||||||
|
ClearCache();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void MenuBar::AddSymbolsMenu()
|
void MenuBar::AddSymbolsMenu()
|
||||||
|
@ -261,6 +261,7 @@ private:
|
|||||||
QAction* m_jit_paired_off;
|
QAction* m_jit_paired_off;
|
||||||
QAction* m_jit_systemregisters_off;
|
QAction* m_jit_systemregisters_off;
|
||||||
QAction* m_jit_branch_off;
|
QAction* m_jit_branch_off;
|
||||||
|
QAction* m_jit_register_cache_off;
|
||||||
|
|
||||||
bool m_game_selected = false;
|
bool m_game_selected = false;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user