JIT: Fix disasm of reg to reg SIMD narrowing/widening instructions#126371
Merged
JulieLeeMSFT merged 4 commits intodotnet:mainfrom Apr 17, 2026
Merged
JIT: Fix disasm of reg to reg SIMD narrowing/widening instructions#126371JulieLeeMSFT merged 4 commits intodotnet:mainfrom
JulieLeeMSFT merged 4 commits intodotnet:mainfrom
Conversation
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the xarch JIT instruction disassembly formatting to correctly display operand register widths for SIMD widening/narrowing instructions (e.g., showing ymm sources for zmm widening, and ymm targets for zmm narrowing), addressing incorrect/invalid-looking disasm output reported in #126363.
Changes:
- Adjust disasm operand-size selection for reg-to-reg SIMD widening and narrowing/conversion instructions by deriving source/target
emitAttrfrom the instruction size. - Refactor
IF_RRW_*reg/reg display logic to computetgtAttr/srcAttrand print via a single shared path (preserving special-case handling forbtand APX NDD shift forms). - Add
vcvtps2phhandling in the reg/reg/imm display path to account for differing source/target widths.
Member
Author
|
cc @dotnet/jit-contrib No code diffs, just disasm text fixes. |
This was referenced Apr 1, 2026
Open
tannergooding
approved these changes
Apr 6, 2026
Member
|
/ba-g all known issues. |
JulieLeeMSFT
approved these changes
Apr 17, 2026
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 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.Suggestion cannot be applied right now. Please check back later.
Fixes #126363
This re-works the disasm for reg to reg instructions to cover some additional cases and make it a bit more consistent.
Many of the widening and narrowing instructions were showing the same size for source and target register.
Diff for the current vector byte multiply implementation:
62F17C481002 vmovups zmm0, zmmword ptr [rdx] 62F17C4828C8 vmovaps zmm1, zmm0 - 62F27D4820C9 vpmovsxbw zmm1, zmm1 + 62F27D4820C9 vpmovsxbw zmm1, ymm1 62D17C481010 vmovups zmm2, zmmword ptr [r8] 62F17C4828DA vmovaps zmm3, zmm2 - 62F27D4820DB vpmovsxbw zmm3, zmm3 + 62F27D4820DB vpmovsxbw zmm3, ymm3 62F16548D5C9 vpmullw zmm1, zmm3, zmm1 - 62F27E4830C9 vpmovwb zmm1, zmm1 + 62F27E4830C9 vpmovwb ymm1, zmm1 62F37D483BC001 vextracti32x8 ymm0, zmm0, 1 - 62F27D4820C0 vpmovsxbw zmm0, zmm0 + 62F27D4820C0 vpmovsxbw zmm0, ymm0 62F37D483BD201 vextracti32x8 ymm2, zmm2, 1 - 62F27D4820D2 vpmovsxbw zmm2, zmm2 + 62F27D4820D2 vpmovsxbw zmm2, ymm2 62F16D48D5C0 vpmullw zmm0, zmm2, zmm0 - 62F27E4830C0 vpmovwb zmm0, zmm0 + 62F27E4830C0 vpmovwb ymm0, zmm0 62F375483AC001 vinserti32x8 zmm0, zmm1, ymm0, 1 62F17C481101 vmovups zmmword ptr [rcx], zmm0 488BC1 mov rax, rcx C5F877 vzeroupper C3 retThis also catches a few cases where embedded rounding was not included in the disasm. ex:
Confirmed with local
jit-diffthat there are no text changes aside from the above intended ones.