Clarify WASM shuffle/swizzle codegen comments#130934
Merged
tannergooding merged 1 commit intoJul 17, 2026
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 5 pipeline(s). 10 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates explanatory comments in the WASM SIMD shuffle/swizzle code paths in the JIT, clarifying how masks map to i8x16.shuffle / i8x16.swizzle and removing redundant commentary.
Changes:
- Reword the Swizzle-contained-mask comment in
genHWIntrinsic(WASM codegen) to avoid attributing behavior to a specific helper. - Add a lead-in comment in
gtNewSimdShuffleNode(WASM lowering branch) describing element-to-byte-index expansion fori8x16.swizzle, and remove a now-redundant inline comment.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/jit/hwintrinsiccodegenwasm.cpp | Comment clarification for WASM Swizzle lowering to i8x16.shuffle. |
| src/coreclr/jit/gentree.cpp | Adds/cleans up comments documenting WASM shuffle-to-swizzle mask expansion semantics. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 1
adamperlin
approved these changes
Jul 17, 2026
tannergooding
enabled auto-merge (squash)
July 17, 2026 01:31
Open
3 tasks
Contributor
|
/ba-g infra failures |
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.
Post-merge follow-up to #130850, addressing three review comments from @adamperlin.
hwintrinsiccodegenwasm.cpp: reword the contained-mask Swizzle->i8x16.shuffleremark. On WasmgenConsumeMultiOpOperandsonly updates liveness and doesn't touch the value stack, so the comment now says "prior codegen left the source on the value stack once" rather than attributing it togenConsumeMultiOpOperands.gentree.cpp(TARGET_WASMShuffle-lowering branch): add a lead-in comment describing the element->byte-index expansion -- each element-granular selector expands intoelementSizeconsecutive byte indices fori8x16.swizzle, and an out-of-range selector becomes0xFFbytes so swizzle's nativeindex >= 16 -> 0behavior zero-fills that element. Dropped the now-redundant inline else-block comment.The third comment (
lowerwasm.cpp, feeding a constant-zero second operand toi8x16.shuffleinstead of the source twice) is addressed in the thread rather than in code: alocal.getof the existing source is smaller than materializing a 16-bytev128.constzero, and it can't remove the special case since the Swizzle node is 2-operand (source, mask->immediate) with no second-vector slot.Comment-only; no functional change.
Note
This PR description was drafted by Copilot on behalf of @tannergooding.