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

PPCAnalyst: Count outputs as being in use #10453

Merged
merged 1 commit into from Mar 12, 2022

Conversation

JosJuice
Copy link
Member

In a code block where a guest register is accessed at least twice and the last access is a write and the register is not discardable immediately after the second-to-last instruction (perhaps there is an instruction in between that can cause an exception), currently Dolphin's JITs will flush the register after the second-to-last instruction.

It would be better if we replaced the flush after the second-to-last instruction with a flush that only happens if the exception path is taken. This change accomplishes that by marking guest registers as "in use" not just when they are used as inputs but also when they are used as outputs, preventing the loop in DoJit from flushing the register until after the last access.

In a code block where a guest register is accessed at least twice and the
last access is a write and the register is not discardable immediately
after the second-to-last instruction (perhaps there is an instruction
in between that can cause an exception), currently Dolphin's JITs will
flush the register after the second-to-last instruction.

It would be better if we replaced the flush after the second-to-last
instruction with a flush that only happens if the exception path is
taken. This change accomplishes that by marking guest registers as
"in use" not just when they are used as inputs but also when they are
used as outputs, preventing the loop in DoJit from flushing the
register until after the last access.
@JosJuice JosJuice merged commit 7a3c719 into dolphin-emu:master Mar 12, 2022
10 checks passed
@JosJuice JosJuice deleted the output-in-use branch March 12, 2022 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants