mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Jit64: Optimize dcbx being called in a loop over a large memory region.
This commit is contained in:
@ -230,6 +230,22 @@ void InvalidateICacheLine(u32 address)
|
||||
g_jit->GetBlockCache()->InvalidateICacheLine(address);
|
||||
}
|
||||
|
||||
void InvalidateICacheLines(u32 address, u32 count)
|
||||
{
|
||||
// This corresponds to a PPC code loop that:
|
||||
// - calls some form of dcb* instruction on 'address'
|
||||
// - increments 'address' by the size of a cache line (0x20 bytes)
|
||||
// - decrements 'count' by 1
|
||||
// - jumps back to the dcb* instruction if 'count' != 0
|
||||
// with an extra optimization for the case of a single cache line invalidation
|
||||
if (count == 1)
|
||||
InvalidateICacheLine(address);
|
||||
if (count == 0 || count >= static_cast<u32>(0x1'0000'0000 / 32))
|
||||
InvalidateICache(address & ~0x1f, 0xffffffff, false);
|
||||
else
|
||||
InvalidateICache(address & ~0x1f, 32 * count, false);
|
||||
}
|
||||
|
||||
void CompileExceptionCheck(ExceptionType type)
|
||||
{
|
||||
if (!g_jit)
|
||||
|
Reference in New Issue
Block a user