Fix the encoding of vcvtps2ph#127111
Merged
tannergooding merged 1 commit intodotnet:mainfrom Apr 19, 2026
Merged
Conversation
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the CoreCLR xarch JIT’s encoding metadata for vcvtps2ph so it uses the correct MR form (destination in ModRM r/m), preventing incorrect results when the instruction is exercised (notably after #127094 enabled new usage).
Changes:
- Update
vcvtps2phinstruction table entry to use the MR opcode slot instead of RM. - Extend the emitter’s MRD/RRD/imm8 handling to recognize
INS_vcvtps2ph. - Ensure
ConvertToVector{128,256}Halfstore paths are categorized with otherins reg/mem, xmm, imm8intrinsics in store-indirect codegen.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/coreclr/jit/instrsxarch.h |
Moves vcvtps2ph encoding from RM to MR in the instruction metadata table. |
src/coreclr/jit/emitxarch.cpp |
Allows vcvtps2ph in the MRD/RRD/CNS emission path used for “dest r/m, src reg, imm8” forms. |
src/coreclr/jit/codegenxarch.cpp |
Adds AVX2 half-conversion intrinsics to the store-indirect handling bucket that expects ins reg/mem, xmm, imm8. |
AntonLapounov
approved these changes
Apr 19, 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.
Follow up to #127094
The instruction was added a while ago but only started being utilized in the above PR. However, the instruction needs to be
MRrather thanRMencoded or it can cause invalid results in some scenarios.