Merge pull request #6596 from lioncash/dcbz

Interpreter_LoadStore: Generate alignment exceptions if dcbz or dcbz_l are executed with the data cache disabled
This commit is contained in:
Markus Wick 2018-04-05 08:46:36 +02:00 committed by GitHub
commit a8821839da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 9 deletions

View File

@ -421,6 +421,13 @@ void Interpreter::dcbz(UGeckoInstruction inst)
return;
const u32 dcbz_addr = Helper_Get_EA_X(inst);
if (!HID0.DCE)
{
GenerateAlignmentException(dcbz_addr);
return;
}
// Hack to stop dcbz/dcbi over low MEM1 trashing memory.
if (SConfig::GetInstance().bLowDCBZHack && (dcbz_addr < 0x80008000) && (dcbz_addr >= 0x80000000))
return;
@ -429,6 +436,20 @@ void Interpreter::dcbz(UGeckoInstruction inst)
PowerPC::ClearCacheLine(dcbz_addr & (~31));
}
void Interpreter::dcbz_l(UGeckoInstruction inst)
{
const u32 address = Helper_Get_EA_X(inst);
if (!HID0.DCE)
{
GenerateAlignmentException(address);
return;
}
// FAKE: clear memory instead of clearing the cache block
PowerPC::ClearCacheLine(address & (~31));
}
// eciwx/ecowx technically should access the specified device
// We just do it instantly from ppc...and hey, it works! :D
void Interpreter::eciwx(UGeckoInstruction inst)

View File

@ -331,12 +331,3 @@ void Interpreter::ps_cmpo1(UGeckoInstruction inst)
{
Helper_FloatCompareOrdered(inst, rPS1(inst.FA), rPS1(inst.FB));
}
// __________________________________________________________________________________________________
// dcbz_l
// TODO(ector) check docs
void Interpreter::dcbz_l(UGeckoInstruction inst)
{
// FAKE: clear memory instead of clearing the cache block
PowerPC::ClearCacheLine(Helper_Get_EA_X(inst) & (~31));
}