Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PPCCache: Update PLRU on any cache access #11559

Merged
merged 1 commit into from Feb 13, 2023

Conversation

Pokechu22
Copy link
Contributor

The previous code only updated the PLRU on cache misses, which made it so that the least recently inserted cache block was evicted, instead of the least recently used/hit one.

This regressed in 9d39647 (part of #11183, but it was fine in e97d380), although beforehand it was only implemented for the instruction cache, and the instruction cache hit extremely infrequently when the JIT or cached interpreter is in use, which generally keeps it from behaving correctly (the pure interpreter behaves correctly with it).

I'm not aware of any games that are affected by this, though I did not do extensive testing.

The previous code only updated the PLRU on cache misses, which made it so that the least recently inserted cache block was evicted, instead of the least recently used/hit one.

This regressed in 9d39647 (part of dolphin-emu#11183, but it was fine in e97d380), although beforehand it was only implemented for the instruction cache, and the instruction cache hit extremely infrequently when the JIT or cached interpreter is in use, which generally keeps it from behaving correctly (the pure interpreter behaves correctly with it).

I'm not aware of any games that are affected by this, though I did not do extensive testing.
Copy link
Contributor

@AdmiralCurtiss AdmiralCurtiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me.

@Pokechu22
Copy link
Contributor Author

For reference, the specific phrasing in https://fail0verflow.com/media/files/ppc_750cl.pdf is on page 141:

For every hit in the cache, the PLRU bits are updated using the rules specified in Table 3-3 PLRU Bit Update Rules.

@AdmiralCurtiss AdmiralCurtiss merged commit e2d7b6d into dolphin-emu:master Feb 13, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants