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

Add N64 recompiler block hashes & inline 64-bit ops #1640

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Sep 10, 2024

  1. n64: access compiled blocks via a hash

    We'd like the recompiler to take the execution context such as kernel
    mode into account when compiling blocks. That's why it's necessary to
    identify blocks not just by address but all the information used at
    compile time. This is done by computing a 32-bit key and using that as
    a block's identifier instead of the last six physical address bits like
    was done before.
    
    The execution state and its representation as bit vector are recomputed
    only when needed, in this case each time Context::setMode() is called,
    which happens on powerup, in both MTC0 and MFC0 instructions, and on
    exceptions.
    
    Since we have now 32-bit instead of 6-bit keys, the block() function
    hashes the keys before mapping them to one of the 64 pool rows. The hash
    function was chosen arbitrarily to be better than a simple multiplicative
    hash and is likely not the best choice for this exact task.
    kannoneer committed Sep 10, 2024
    Configuration menu
    Copy the full SHA
    dacacac View commit details
    Browse the repository at this point in the history
  2. n64: inline simple dual mode operations

    * Pass JITContext down to leaf emit functions.
    * Emit inline implementations of basic 64-bit operations.
    * Use block compile-time information to elide kernel mode checks of
    the now inlined operations.
    kannoneer committed Sep 10, 2024
    Configuration menu
    Copy the full SHA
    ba4504a View commit details
    Browse the repository at this point in the history