-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dedicate one register to cycles counting
Instead of returning the number of cycles of the block in each end-of-block, adding it to the current cycles count in the dispatcher and comparing the result to the target cycle count, we now dedicate a register that will contain the number of cycles that should be executed before exiting the dynarec. Each end-of-block will then substract the number of executed opcodes, and the dispatcher loop only need to exit when the value in the register becomes negative. This introduces a small overhead on the generated code because of the smaller number of available registers (+~0.33 average IPI on x86_64), however it makes the dispatcher code simpler, so it might actually result in a performance win. But the purpose of this change is mainly to open the way to do in-block branches, as we wouldn't be able anymore to tell how many cycles a block takes and hardcode it in the end-of-block. Signed-off-by: Paul Cercueil <paul@crapouillou.net>
- Loading branch information
Showing
3 changed files
with
82 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters