Add Wasm32 ISA and PackedSimd ISA#129140
Open
adamperlin wants to merge 2 commits into
Open
Conversation
…28 definitions for Wasm
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the CoreCLR JIT/EE instruction-set model to include a Wasm32 architecture with WasmBase, PackedSimd, and a synthetic Vector128 ISA, and wires those through the existing ThunkGenerator-driven codegen outputs (managed + native) including ReadyToRun (R2R) instruction set values. It also bumps the JIT/EE interface GUID as required when ISA definitions change.
Changes:
- Add
Wasm32 -> TARGET_WASMmapping in the thunk generator to produce correct#ifdef TARGET_WASMguards. - Define Wasm32 ISAs (
WasmBase,PackedSimd,Vector128) + implication rules inInstructionSetDesc.txt, updatingNEXT_AVAILABLE_R2R_BIT. - Regenerate/update managed and native instruction set enums/mappings (CorInfo + R2R) and bump
JITEEVersionIdentifier.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/tools/Common/JitInterface/ThunkGenerator/InstructionSetGenerator.cs | Maps Wasm32 to WASM so generated native guards use TARGET_WASM. |
| src/coreclr/tools/Common/JitInterface/ThunkGenerator/InstructionSetDesc.txt | Adds Wasm32 ISA definitions + implication chain and reserves R2R bits 91–92. |
| src/coreclr/tools/Common/JitInterface/CorInfoInstructionSet.cs | Adds Wasm32 ISA enums and implication/lookup support in the managed JIT interface model. |
| src/coreclr/tools/Common/Internal/Runtime/ReadyToRunInstructionSetHelper.cs | Maps Wasm32 instruction sets to R2R instruction sets (with Vector128 remaining non-R2R). |
| src/coreclr/tools/Common/Internal/Runtime/ReadyToRunInstructionSet.cs | Adds WasmBase=91 and PackedSimd=92 to the managed R2R enum. |
| src/coreclr/inc/readytoruninstructionset.h | Adds READYTORUN_INSTRUCTION_WasmBase=91 and ..._PackedSimd=92 to the native R2R enum. |
| src/coreclr/inc/jiteeversionguid.h | Updates the JIT/EE interface GUID to reflect the ISA contract change. |
| src/coreclr/inc/corinfoinstructionset.h | Adds TARGET_WASM instruction set IDs, validation, string conversion, and R2R mapping. |
Comment on lines
1492
to
+1501
| switch (targetArch) | ||
| { | ||
| case TargetArchitecture.ARM64: | ||
| platformIntrinsicNamespace = "System.Runtime.Intrinsics.Arm"; | ||
| break; | ||
|
|
||
| case TargetArchitecture.Wasm32: | ||
| platformIntrinsicNamespace = "System.Runtime.Intrinsics.Wasm"; | ||
| break; | ||
|
|
f41338c to
71d3c13
Compare
Comment on lines
+98
to
+102
| else if (architecture is TargetArchitecture.Wasm32) | ||
| { | ||
| // TODO-WASM: return the correct intrinsic id once xplat intrinsics are implemented. | ||
| return ""; | ||
| } |
Comment on lines
28
to
+29
| ; The ISA definitions should also be mapped to `hwintrinsicIsaRangeArray` in hwintrinsic.cpp. | ||
| ; NEXT_AVAILABLE_R2R_BIT = 91 | ||
| ; NEXT_AVAILABLE_R2R_BIT = 93 |
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.
Adds ISA definitions for
WasmBase,PackedSimd, andVector128. SIMD support won't be utilized yet, but this is a precursor to ongoing SIMD work.