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

sh2: fix recompiler regressions #1760

Merged
merged 1 commit into from
Jan 11, 2025

Conversation

invertego
Copy link
Contributor

This change corrects two regressions introduced by my last change.

  1. The purge() call in SH2::Cache::power() was, through a call to Recompiler::invalidate(), accessing the pool array before it was allocated.

    This purge call was erronous for two reasons:

    • It was purging a single line, though it appears the intent was
      to purge the entire cache.
    • According to the SH7604 manual, the cache is not initialized on
      reset.

    Therefore, I simply removed the call.

  2. The size of the recompiler code cache for both of the two SH2s is now halved to fit within the recently halved fixed code cache buffer. The SH2 recompiler is good at reusing previously compiled blocks, so flushes should not be especially common even with this reduced capacity.

This change corrects two regressions introduced by my last change.

1.  The purge() call in SH2::Cache::power() was, through a call to
    Recompiler::invalidate(), accessing the pool array before it was
    allocated.

    This purge call was erronous for two reasons:
    -   It was purging a single line, though it *appears* the intent was
        to purge the entire cache.
    -   According to the SH7604 manual, the cache is not initialized on
        reset.

    Therefore, I simply removed the call.

2.  The size of the recompiler code cache for both of the two SH2s is
    now halved to fit within the recently halved fixed code cache
    buffer. The SH2 recompiler is good at reusing previously compiled
    blocks, so flushes should not be especially common even with this
    reduced capacity.
@LukeUsher LukeUsher merged commit 05898a6 into ares-emulator:master Jan 11, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants