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

Evaluate a hybrid approach for macro-operation fusion in both the decoding and execution stages #298

Open
jserv opened this issue Dec 17, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@jserv
Copy link
Contributor

jserv commented Dec 17, 2023

The rv32emu employs block chaining, macro-operation fusion during the decoding stage would be generally more advantageous. This is because the primary benefit of block chaining is to streamline the transition between basic blocks during execution. By fusing operations during decoding, we reduce the overall number of operations and potentially the number of basic blocks, making the block chaining more efficient. Additionally, doing this work upfront during decoding means that the execution phase can remain fast and efficient, which is critical for both interpreters and JIT compilers.

However, the best approach can vary based on specific emulator design goals, the nature of the instruction set being emulated, and the typical workload expected for the emulator. In practice, a hybrid approach might also be feasible, where some fusion decisions are made during decoding and others are deferred until execution, depending on the context and potential optimization gains.

Once macro-operation fusion is implemented through the hybrid instruction decoding and execution stages, more complex scenarios, such as dynamic superinstructions (#282), can be applied in a similar and more concrete manner. Similarly, C routine substitution can be implemented more efficiently in the instruction decoding stage, because optimized routines such as memcmp can always be used to recognize the target instruction sequences.

Additional materals:

@jserv jserv added the enhancement New feature or request label Dec 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants