-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Fix zero-extending displacement on win_x86_x64 JIT #117945
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a zero-extending issue in the x86_x64 JIT compiler that was causing crossgen2-comparison test failures. The issue occurred when comparing crossgen output targeting x86 from both x86 and x64 JITs, which produced different encodings due to incorrect displacement handling.
- Changed displacement variable type from
unsigned
toint
to properly handle sign extension - Ensures 32-bit displacement values are correctly sign-extended to 64-bit values instead of being zero-extended
- Prevents the JIT from incorrectly treating displacements as large positive numbers and using inefficient larger encodings
/azp list |
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
/azp run runtime-coreclr crossgen2 outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
cc @dotnet/jit-contrib |
@max-charlamb The JIT codebase is auto-formatted. Could you please apply the auto-formatter patch from one of the failing formatter legs? |
/azp run runtime-coreclr crossgen2 outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
Resolves #115661
crossgen2-comparison test comparing crossgen targeting x86 from a x86 and x64 JIT has been failing due to the x64 host JIT using different encodings.
I traced this back to a 32-bit displacement value not being sign extended to a 64-bit value. This caused the JIT to think the displacement was a large positive number and used a larger encoding.
Fixed by treating the displacement as a signed value.