summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2021-08-04 22:24:41 +0200
committerGitHub <noreply@github.com>2021-08-04 22:24:41 +0200
commit28b7e2ef30fd5183b3f9cd1d13cf6b9928d557aa (patch)
tree725bd48041eefeb1bafe25a5bc4886d4c97b4b35 /Source
parent234859e2f321d20704a637f9bef7ceee0346f319 (diff)
parent0e76dabbbb771a0fd42d9d744a36f9a1a5d0143d (diff)
Merge pull request #9995 from AdmiralCurtiss/dcbx-virtual-address
Jit64: Always pass effective address to InvalidateICache() in dcbx.
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/Core/PowerPC/Jit64/Jit_LoadStore.cpp10
-rw-r--r--Source/Core/Core/PowerPC/Jit64Common/EmuCodeBlock.cpp2
2 files changed, 7 insertions, 5 deletions
diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_LoadStore.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_LoadStore.cpp
index a8b26fb86b..63157a6747 100644
--- a/Source/Core/Core/PowerPC/Jit64/Jit_LoadStore.cpp
+++ b/Source/Core/Core/PowerPC/Jit64/Jit_LoadStore.cpp
@@ -239,15 +239,17 @@ void Jit64::dcbx(UGeckoInstruction inst)
RCOpArg Ra = inst.RA ? gpr.Use(inst.RA, RCMode::Read) : RCOpArg::Imm32(0);
RCOpArg Rb = gpr.Use(inst.RB, RCMode::Read);
RCX64Reg tmp = gpr.Scratch();
- RegCache::Realize(Ra, Rb, tmp);
+ RCX64Reg effective_address = gpr.Scratch();
+ RegCache::Realize(Ra, Rb, tmp, effective_address);
// Translate effective address to physical address.
MOV_sum(32, value, Ra, Rb);
FixupBranch bat_lookup_failed;
+ MOV(32, R(effective_address), R(value));
if (MSR.IR)
{
- MOV(32, R(addr), R(value));
bat_lookup_failed = BATAddressLookup(value, tmp, PowerPC::ibat_table.data());
+ MOV(32, R(addr), R(effective_address));
AND(32, R(addr), Imm32(0x0001ffff));
AND(32, R(value), Imm32(0xfffe0000));
OR(32, R(value), R(addr));
@@ -264,14 +266,14 @@ void Jit64::dcbx(UGeckoInstruction inst)
SwitchToFarCode();
SetJumpTarget(invalidate_needed);
- SHL(32, R(addr), Imm8(5));
if (MSR.IR)
SetJumpTarget(bat_lookup_failed);
BitSet32 registersInUse = CallerSavedRegistersInUse();
registersInUse[X64Reg(tmp)] = false;
+ registersInUse[X64Reg(effective_address)] = false;
ABI_PushRegistersAndAdjustStack(registersInUse, 0);
- MOV(32, R(ABI_PARAM1), R(addr));
+ MOV(32, R(ABI_PARAM1), R(effective_address));
MOV(32, R(ABI_PARAM2), Imm32(32));
XOR(32, R(ABI_PARAM3), R(ABI_PARAM3));
ABI_CallFunction(JitInterface::InvalidateICache);
diff --git a/Source/Core/Core/PowerPC/Jit64Common/EmuCodeBlock.cpp b/Source/Core/Core/PowerPC/Jit64Common/EmuCodeBlock.cpp
index 0d5b37d358..80d1d0f7fc 100644
--- a/Source/Core/Core/PowerPC/Jit64Common/EmuCodeBlock.cpp
+++ b/Source/Core/Core/PowerPC/Jit64Common/EmuCodeBlock.cpp
@@ -98,7 +98,7 @@ FixupBranch EmuCodeBlock::BATAddressLookup(X64Reg addr, X64Reg tmp, const void*
MOV(32, R(addr), MComplex(tmp, addr, SCALE_4, 0));
BT(32, R(addr), Imm8(IntLog2(PowerPC::BAT_MAPPED_BIT)));
- return J_CC(CC_Z, m_far_code.Enabled());
+ return J_CC(CC_NC, m_far_code.Enabled());
}
FixupBranch EmuCodeBlock::CheckIfSafeAddress(const OpArg& reg_value, X64Reg reg_addr,