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
Jit64: addx revisited #9464
Merged
Merged
Jit64: addx revisited #9464
+43
−39
Conversation
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
8bf555b
to
85dbf95
Compare
|
FYI, all of the examples are labeled "1" |
Oops, thanks for pointing that out. |
lioncash
reviewed
Jan 26, 2021
This doesn't really add any new optimizations, but fixes an issue that prevented the optimizations introduced in dolphin-emu#8551 and dolphin-emu#8755 from being applied in specific cases. A similar issue was solved for subfx as part of dolphin-emu#9425. Consider the case where the destination register is also an input register and happens to hold an immediate value. This results in a set of constraints that forces the RegCache to allocate a register and move the immediate value into it for us. By the time we check for immediate values in the JIT, we're too late. We solve this by refactoring the code in such a way that we can check for immediates before involving the RegCache. - Example 1 Before: 41 BF 00 68 00 CC mov r15d,0CC006800h 44 03 FF add r15d,edi After: 44 8D BF 00 68 00 CC lea r15d,[rdi-33FF9800h] - Example 2 Before: 41 BE 00 00 00 00 mov r14d,0 44 03 F7 add r14d,edi After: 44 8B F7 mov r14d,edi - Example 3 Before: 41 BD 03 00 00 00 mov r13d,3 44 03 6D 8C add r13d,dword ptr [rbp-74h] After: 44 8B 6D 8C mov r13d,dword ptr [rbp-74h] 41 83 C5 03 add r13d,3
85dbf95
to
6a51c15
Compare
|
Is there any more comments/complaints to this? |
|
Can I test on my Redmi Note 9 android phone? |
|
This change affects the x64 JIT, not the ARM JIT. Most android devices use ARM, so I don't think this would have any meaningful impact there. |
|
Poking this pr |
Tilka
approved these changes
Jun 28, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
This doesn't really add any new optimizations, but fixes an issue that prevented the optimizations introduced in #8551 and #8755 from being applied in specific cases. A similar issue was solved for subfx as part of #9425.
Consider the case where the destination register is also an input register and happens to hold an immediate value. This results in a set of constraints that forces the RegCache to allocate a register and move the immediate value into it for us. By the time we check for immediate values in the JIT, we're too late.
We solve this by refactoring the code in such a way that we can check for immediates before involving the RegCache.
Example 1
Before:
After:
Example 2
Before:
After:
Example 3
Before:
After: