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
JitArm64: Skip redundant imm to register writes #11094
Conversation
When a guest register is an immediate, it may be necessary to move this value into a register. This is handled by gpr.R(), which lacks context on how the register will be used. This leads to cases where the immediate is written to a register, only for it to be overwritten. Take for example this code generated by srwx: 0x5280031b mov w27, #0x18 0x53187edb lsr w27, w22, dolphin-emu#24 gpr.BindToRegister() does have this context through the do_load parameter, but didn't handle immediates. By adding this logic, we can intelligently skip the write when do_load is false.
|
FYI, I can reproduce the F-Zero issue on x86, so it's unlikely that this PR caused it. |
|
I checked out the commit before this and it was fixed. Not sure what’s going on here. |
|
This PR seems to be causing the issue in F-Zero GX for me. Android, AArch64, OpenGL. |
|
I don't have access to this game myself, but perhaps unconditionally setting the dirty flag can fix this. |
|
Unconditionally setting the dirty flag can mess things up in MMU games when do_load is false. I'll try to debug this. |
|
Perhaps changing the condition to |
|
This PR uncovered an underlying bug in JitArm64 that I've now fixed in PR #11114. Can't reproduce the problem on x86-64. |
|
I would advise bisecting. |
|
My issue seems to be related to the x86 JIT. It's fixed with the cached interpreter and if I disable "JIT Floating Point". |
|
After some back and forth on IRC it turned out that my build was simply missing the game ini workaround for F-Zero. |
|
The Rogue Squadron II issue was indeed related to the dirty flag. Fixed in PR #11117. |



When a guest register is an immediate, it may be necessary to move this value into a register. This is handled by
gpr.R(), which lacks context on how the register will be used. This leads to cases where the immediate is written to a register, only for it to be overwritten. Take for example this code generated bysrwx:gpr.BindToRegister()does have this context through thedo_loadparameter, but didn't handle immediates. By adding this logic, we can intelligently skip the write whendo_loadis false.