[RyuJIT Wasm] Handle all codegen cases for PackedSimd.Shuffle#130991
Draft
adamperlin wants to merge 7 commits into
Draft
[RyuJIT Wasm] Handle all codegen cases for PackedSimd.Shuffle#130991adamperlin wants to merge 7 commits into
adamperlin wants to merge 7 commits into
Conversation
|
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
Adds/extends WebAssembly SIMD intrinsic lowering and codegen in CoreCLR RyuJIT, primarily to enable PackedSimd.Shuffle codegen and to move lane load/store intrinsics into the table-driven pipeline.
Changes:
- Add
LowerHWIntrinsicNativeShuffleto supportNI_PackedSimd_Shuffle(emit native shuffle for constant masks; rewrite non-constant masks to swizzle+swizzle+or). - Introduce
HW_Flag_HasImmediateOperandfor WASM and use it to drive lowering/codegen decisions (lane immediates, jump-table fallback, containment). - Reclassify/enable WASM lane load/store intrinsics as
HW_Category_MemoryLoad/MemoryStoreand update codegen +OperIsMemoryLoad/Storeto recognize WASM.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/jit/lowerwasm.cpp | Adds shuffle lowering; uses HasImmediateOperand to drive immediate-lane lowering and containment. |
| src/coreclr/jit/lower.h | Declares the new WASM lowering helper LowerHWIntrinsicNativeShuffle. |
| src/coreclr/jit/hwintrinsicwasm.cpp | Removes special-import handling for some lane-load intrinsics now handled table-driven; keeps immediate upper-bound logic for lane ops. |
| src/coreclr/jit/hwintrinsiclistwasm.h | Reclassifies lane load/store intrinsics to memory categories; adds immediate-operand flags for relevant intrinsics. |
| src/coreclr/jit/hwintrinsiccodegenwasm.cpp | Emits v128 immediates for shuffle; adds table-driven codegen for WASM memory load/store categories and jump-table support for lane memops. |
| src/coreclr/jit/hwintrinsic.h | Adds WASM HW_Flag_HasImmediateOperand, updates HasImmediateOperand, and adds shuffle imm-op position + immediate vector accessor. |
| src/coreclr/jit/gentree.cpp | Extends OperIsMemoryLoad/OperIsMemoryStore to include WASM. |
| src/coreclr/jit/codegenwasm.cpp | Removes NYI guard for SIMD16 store-indirect to allow emitting stores. |
Comment on lines
+921
to
+922
| // These intrinsics don't a required immediate operand | ||
| assert(!hasImmOp); |
Comment on lines
+1336
to
+1337
| // (v128, v128, lane_imm) | ||
| *imm1Pos = 3; |
Comment on lines
+1312
to
+1316
| GenTree* Lowering::LowerHWIntrinsicNativeShuffle(GenTreeHWIntrinsic* node) | ||
| { | ||
| assert(node->GetHWIntrinsicId() == NI_PackedSimd_Shuffle); | ||
|
|
||
| GenTree* op1 = node->Op(1); |
| case NI_PackedSimd_LoadScalarVector128: | ||
| case NI_PackedSimd_LoadWideningVector128: | ||
| { | ||
| // These intrinsics don't a required immediate operand |
Comment on lines
+1330
to
+1335
| // No extra work to do if the shuffle is a constant vector, it can be contained as an immediate and emitted. | ||
| if (shuffleMask->IsCnsVec()) | ||
| { | ||
| ContainCheckHWIntrinsic(node); | ||
| return node->gtNext; | ||
| } |
Comment on lines
+1336
to
+1337
| // (v128, v128, lane_imm) | ||
| *imm1Pos = 3; |
Open
3 tasks
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.
Stacked on #130822