Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #10089 from AdmiralCurtiss/jit-cache-valid-block-c…
…lear

PowerPC/JitCache: Clear valid_block bits for long invalidations.
  • Loading branch information
lioncash committed Sep 8, 2021
2 parents 5538e90 + 34992f5 commit 8809d8e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Source/Core/Core/PowerPC/JitCommon/JitCache.cpp
Expand Up @@ -234,6 +234,16 @@ void JitBaseBlockCache::InvalidateICacheInternal(u32 physical_address, u32 addre
else
valid_block.Clear(physical_address / 32);
}
else if (length > 32)
{
// Even if we can't check the set for optimization, we still want to remove all fully covered
// cache lines from the valid_block set so that later calls don't try to invalidate already
// cleared regions.
const u32 covered_block_start = (physical_address + 0x1f) / 32;
const u32 covered_block_end = (physical_address + length) / 32;
for (u32 i = covered_block_start; i < covered_block_end; ++i)
valid_block.Clear(i);
}

if (destroy_block)
{
Expand Down

0 comments on commit 8809d8e

Please sign in to comment.