Repository navigation
JIT: Include kmov instructions in an encoding assert - #119579
Merged
Merged
Conversation
We can get here for kmov instructions. On x64 the above check for `EA_PTRSIZE` will make the assert pass, but for x86 the assert fails.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an assertion failure that occurs when the JIT encounters kmov instructions on x86. The issue was that kmov instructions can have EA_8BYTE size attributes even on x86, causing an existing assert to fail which expected only certain instruction types to reach that code path.
- Updated the encoding assert to include kmov instructions as a valid case
- Allows kmov instructions to pass through the encoding path without triggering assertion failures
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
tannergooding
approved these changes
Sep 11, 2025
tannergooding
left a comment
Member
There was a problem hiding this comment.
LGTM.
Longer term I'd still like to see if we can simplify emitInsSizeAM to just reuse the same logic as the other paths do via emitInsSize instead. But that's a more involved change.
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.Suggestion cannot be applied right now. Please check back later.
We can get here for kmov instructions. On x64 the above check for
EA_PTRSIZEwill make the assert pass, but for x86 the assert fails.This just includes the kmov instructions like @tannergooding suggested here: #118921 (comment)
I verified that the produced codegen looks reasonable: we see
kmovq k1, qword ptr [eax+0x10]and correspondingkmovq qword ptr [eax+0x10], k1when moving the mask local between heap and local because of the async suspension.Fix #118921