mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-09-08 02:25:56 +00:00
Merge pull request #10340 from AdmiralCurtiss/config-port-core-1
Config: Port remaining Core settings to new config system (partial).
This commit is contained in:
commit
bc14485489
35 changed files with 188 additions and 218 deletions
|
@ -9,6 +9,7 @@
|
|||
#include "Common/MsgHandler.h"
|
||||
#include "Common/Swap.h"
|
||||
|
||||
#include "Core/Config/MainSettings.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/PowerPC/Interpreter/ExceptionUtils.h"
|
||||
#include "Core/PowerPC/Interpreter/Interpreter_FPUtils.h"
|
||||
|
@ -504,8 +505,11 @@ void Interpreter::dcbz(UGeckoInstruction inst)
|
|||
}
|
||||
|
||||
// Hack to stop dcbz/dcbi over low MEM1 trashing memory.
|
||||
if (SConfig::GetInstance().bLowDCBZHack && (dcbz_addr < 0x80008000) && (dcbz_addr >= 0x80000000))
|
||||
if ((dcbz_addr < 0x80008000) && (dcbz_addr >= 0x80000000) &&
|
||||
Config::Get(Config::MAIN_LOW_DCBZ_HACK))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: Implement some sort of L2 emulation.
|
||||
PowerPC::ClearCacheLine(dcbz_addr & (~31));
|
||||
|
|
|
@ -38,7 +38,7 @@ void Jit64::SetFPRFIfNeeded(const OpArg& input, bool single)
|
|||
// As far as we know, the games that use this flag only need FPRF for fmul and fmadd, but
|
||||
// FPRF is fast enough in JIT that we might as well just enable it for every float instruction
|
||||
// if the FPRF flag is set.
|
||||
if (!SConfig::GetInstance().bFPRF || !js.op->wantsFPRF)
|
||||
if (!m_fprf || !js.op->wantsFPRF)
|
||||
return;
|
||||
|
||||
X64Reg xmm = XMM0;
|
||||
|
@ -102,7 +102,7 @@ void Jit64::HandleNaNs(UGeckoInstruction inst, X64Reg xmm_out, X64Reg xmm, X64Re
|
|||
// Dragon Ball: Revenge of King Piccolo requires generated NaNs
|
||||
// to be positive, so we'll have to handle them manually.
|
||||
|
||||
if (!SConfig::GetInstance().bAccurateNaNs)
|
||||
if (!m_accurate_nans)
|
||||
{
|
||||
if (xmm_out != xmm)
|
||||
MOVAPD(xmm_out, R(xmm));
|
||||
|
@ -230,7 +230,7 @@ void Jit64::fp_arith(UGeckoInstruction inst)
|
|||
packed = false;
|
||||
|
||||
bool round_input = single && !js.op->fprIsSingle[inst.FC];
|
||||
bool preserve_inputs = SConfig::GetInstance().bAccurateNaNs;
|
||||
bool preserve_inputs = m_accurate_nans;
|
||||
|
||||
const auto fp_tri_op = [&](int op1, int op2, bool reversible,
|
||||
void (XEmitter::*avxOp)(X64Reg, X64Reg, const OpArg&),
|
||||
|
@ -475,7 +475,7 @@ void Jit64::fmaddXX(UGeckoInstruction inst)
|
|||
if (negate)
|
||||
XORPD(result_xmm, MConst(packed ? psSignBits2 : psSignBits));
|
||||
|
||||
if (SConfig::GetInstance().bAccurateNaNs && result_xmm == XMM0)
|
||||
if (m_accurate_nans && result_xmm == XMM0)
|
||||
{
|
||||
// HandleNaNs needs to clobber XMM0
|
||||
MOVAPD(Rd, R(result_xmm));
|
||||
|
@ -632,7 +632,7 @@ void Jit64::fmrx(UGeckoInstruction inst)
|
|||
|
||||
void Jit64::FloatCompare(UGeckoInstruction inst, bool upper)
|
||||
{
|
||||
bool fprf = SConfig::GetInstance().bFPRF && js.op->wantsFPRF;
|
||||
bool fprf = m_fprf && js.op->wantsFPRF;
|
||||
// bool ordered = !!(inst.SUBOP10 & 32);
|
||||
int a = inst.FA;
|
||||
int b = inst.FB;
|
||||
|
|
|
@ -413,7 +413,7 @@ void Jit64::dcbz(UGeckoInstruction inst)
|
|||
}
|
||||
|
||||
FixupBranch end_dcbz_hack;
|
||||
if (SConfig::GetInstance().bLowDCBZHack)
|
||||
if (m_low_dcbz_hack)
|
||||
{
|
||||
// HACK: Don't clear any memory in the [0x8000'0000, 0x8000'8000) region.
|
||||
CMP(32, R(RSCRATCH), Imm32(0x8000'8000));
|
||||
|
@ -454,7 +454,7 @@ void Jit64::dcbz(UGeckoInstruction inst)
|
|||
SetJumpTarget(end_far_code);
|
||||
}
|
||||
|
||||
if (SConfig::GetInstance().bLowDCBZHack)
|
||||
if (m_low_dcbz_hack)
|
||||
SetJumpTarget(end_dcbz_hack);
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ using namespace Arm64Gen;
|
|||
|
||||
void JitArm64::SetFPRFIfNeeded(bool single, ARM64Reg reg)
|
||||
{
|
||||
if (!SConfig::GetInstance().bFPRF || !js.op->wantsFPRF)
|
||||
if (!m_fprf || !js.op->wantsFPRF)
|
||||
return;
|
||||
|
||||
gpr.Lock(ARM64Reg::W0, ARM64Reg::W1, ARM64Reg::W2, ARM64Reg::W3, ARM64Reg::W4, ARM64Reg::W30);
|
||||
|
@ -374,7 +374,7 @@ void JitArm64::frspx(UGeckoInstruction inst)
|
|||
|
||||
void JitArm64::FloatCompare(UGeckoInstruction inst, bool upper)
|
||||
{
|
||||
const bool fprf = SConfig::GetInstance().bFPRF && js.op->wantsFPRF;
|
||||
const bool fprf = m_fprf && js.op->wantsFPRF;
|
||||
|
||||
const u32 a = inst.FA;
|
||||
const u32 b = inst.FB;
|
||||
|
|
|
@ -764,7 +764,7 @@ void JitArm64::dcbz(UGeckoInstruction inst)
|
|||
{
|
||||
INSTRUCTION_START
|
||||
JITDISABLE(bJITLoadStoreOff);
|
||||
FALLBACK_IF(SConfig::GetInstance().bLowDCBZHack);
|
||||
FALLBACK_IF(m_low_dcbz_hack);
|
||||
|
||||
int a = inst.RA, b = inst.RB;
|
||||
|
||||
|
|
|
@ -49,7 +49,15 @@ void JitBase::RefreshConfig()
|
|||
bJITBranchOff = Config::Get(Config::MAIN_DEBUG_JIT_BRANCH_OFF);
|
||||
bJITRegisterCacheOff = Config::Get(Config::MAIN_DEBUG_JIT_REGISTER_CACHE_OFF);
|
||||
m_enable_debugging = Config::Get(Config::MAIN_ENABLE_DEBUGGING);
|
||||
m_enable_float_exceptions = Config::Get(Config::MAIN_FLOAT_EXCEPTIONS);
|
||||
m_enable_div_by_zero_exceptions = Config::Get(Config::MAIN_DIVIDE_BY_ZERO_EXCEPTIONS);
|
||||
m_low_dcbz_hack = Config::Get(Config::MAIN_LOW_DCBZ_HACK);
|
||||
m_fprf = Config::Get(Config::MAIN_FPRF);
|
||||
m_accurate_nans = Config::Get(Config::MAIN_ACCURATE_NANS);
|
||||
analyzer.SetDebuggingEnabled(m_enable_debugging);
|
||||
analyzer.SetBranchFollowingEnabled(Config::Get(Config::MAIN_JIT_FOLLOW_BRANCH));
|
||||
analyzer.SetFloatExceptionsEnabled(m_enable_float_exceptions);
|
||||
analyzer.SetDivByZeroExceptionsEnabled(m_enable_div_by_zero_exceptions);
|
||||
}
|
||||
|
||||
bool JitBase::CanMergeNextInstructions(int count) const
|
||||
|
@ -72,8 +80,8 @@ void JitBase::UpdateMemoryAndExceptionOptions()
|
|||
bool any_watchpoints = PowerPC::memchecks.HasAny();
|
||||
jo.fastmem = SConfig::GetInstance().bFastmem && jo.fastmem_arena && (MSR.DR || !any_watchpoints);
|
||||
jo.memcheck = SConfig::GetInstance().bMMU || any_watchpoints;
|
||||
jo.fp_exceptions = SConfig::GetInstance().bFloatExceptions;
|
||||
jo.div_by_zero_exceptions = SConfig::GetInstance().bDivideByZeroExceptions;
|
||||
jo.fp_exceptions = m_enable_float_exceptions;
|
||||
jo.div_by_zero_exceptions = m_enable_div_by_zero_exceptions;
|
||||
}
|
||||
|
||||
bool JitBase::ShouldHandleFPExceptionForInstruction(const PPCAnalyst::CodeOp* op)
|
||||
|
|
|
@ -127,6 +127,11 @@ protected:
|
|||
bool bJITBranchOff = false;
|
||||
bool bJITRegisterCacheOff = false;
|
||||
bool m_enable_debugging = false;
|
||||
bool m_enable_float_exceptions = false;
|
||||
bool m_enable_div_by_zero_exceptions = false;
|
||||
bool m_low_dcbz_hack = false;
|
||||
bool m_fprf = false;
|
||||
bool m_accurate_nans = false;
|
||||
|
||||
void RefreshConfig();
|
||||
|
||||
|
|
|
@ -556,10 +556,10 @@ void PPCAnalyzer::SetInstructionStats(CodeBlock* block, CodeOp* code, const Gekk
|
|||
code->outputFPRF = (opinfo->flags & FL_SET_FPRF) != 0;
|
||||
code->canEndBlock = (opinfo->flags & FL_ENDBLOCK) != 0;
|
||||
|
||||
code->canCauseException =
|
||||
first_fpu_instruction || (opinfo->flags & (FL_LOADSTORE | FL_PROGRAMEXCEPTION)) != 0 ||
|
||||
(SConfig::GetInstance().bFloatExceptions && (opinfo->flags & FL_FLOAT_EXCEPTION)) ||
|
||||
(SConfig::GetInstance().bDivideByZeroExceptions && (opinfo->flags & FL_FLOAT_DIV));
|
||||
code->canCauseException = first_fpu_instruction ||
|
||||
(opinfo->flags & (FL_LOADSTORE | FL_PROGRAMEXCEPTION)) != 0 ||
|
||||
(m_enable_float_exceptions && (opinfo->flags & FL_FLOAT_EXCEPTION)) ||
|
||||
(m_enable_div_by_zero_exceptions && (opinfo->flags & FL_FLOAT_DIV));
|
||||
|
||||
code->wantsCA = (opinfo->flags & FL_READ_CA) != 0;
|
||||
code->outputCA = (opinfo->flags & FL_SET_CA) != 0;
|
||||
|
@ -761,7 +761,7 @@ u32 PPCAnalyzer::Analyze(u32 address, CodeBlock* block, CodeBuffer* buffer,
|
|||
u32 numFollows = 0;
|
||||
u32 num_inst = 0;
|
||||
|
||||
const bool enable_follow = SConfig::GetInstance().bJITFollowBranch;
|
||||
const bool enable_follow = m_enable_branch_following;
|
||||
|
||||
for (std::size_t i = 0; i < block_size; ++i)
|
||||
{
|
||||
|
|
|
@ -216,6 +216,9 @@ public:
|
|||
void ClearOption(AnalystOption option) { m_options &= ~(option); }
|
||||
bool HasOption(AnalystOption option) const { return !!(m_options & option); }
|
||||
void SetDebuggingEnabled(bool enabled) { m_is_debugging_enabled = enabled; }
|
||||
void SetBranchFollowingEnabled(bool enabled) { m_enable_branch_following = enabled; }
|
||||
void SetFloatExceptionsEnabled(bool enabled) { m_enable_float_exceptions = enabled; }
|
||||
void SetDivByZeroExceptionsEnabled(bool enabled) { m_enable_div_by_zero_exceptions = enabled; }
|
||||
u32 Analyze(u32 address, CodeBlock* block, CodeBuffer* buffer, std::size_t block_size) const;
|
||||
|
||||
private:
|
||||
|
@ -238,6 +241,9 @@ private:
|
|||
u32 m_options = 0;
|
||||
|
||||
bool m_is_debugging_enabled = false;
|
||||
bool m_enable_branch_following = false;
|
||||
bool m_enable_float_exceptions = false;
|
||||
bool m_enable_div_by_zero_exceptions = false;
|
||||
};
|
||||
|
||||
void FindFunctions(u32 startAddr, u32 endAddr, PPCSymbolDB* func_db);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue