Skip to content

Add Wasm32 ISA and PackedSimd ISA - #129140

Merged
adamperlin merged 3 commits into
dotnet:mainfrom
adamperlin:adamperlin/packed-simd-instruction-desc
Jun 12, 2026
Merged

Add Wasm32 ISA and PackedSimd ISA#129140
adamperlin merged 3 commits into
dotnet:mainfrom
adamperlin:adamperlin/packed-simd-instruction-desc

Conversation

@adamperlin

Copy link
Copy Markdown
Contributor

Adds ISA definitions for WasmBase, PackedSimd, and Vector128. SIMD support won't be utilized yet, but this is a precursor to ongoing SIMD work.

CopilotAI review requested due to automatic review settings June 8, 2026 21:43
@github-actionsgithub-actionsBot added the area-crossgen2-coreclr only use for closed issues label Jun 8, 2026

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_WASM mapping in the thunk generator to produce correct #ifdef TARGET_WASM guards.
  • Define Wasm32 ISAs (WasmBase, PackedSimd, Vector128) + implication rules in InstructionSetDesc.txt, updating NEXT_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
FileDescription
src/coreclr/tools/Common/JitInterface/ThunkGenerator/InstructionSetGenerator.csMaps Wasm32 to WASM so generated native guards use TARGET_WASM.
src/coreclr/tools/Common/JitInterface/ThunkGenerator/InstructionSetDesc.txtAdds Wasm32 ISA definitions + implication chain and reserves R2R bits 91–92.
src/coreclr/tools/Common/JitInterface/CorInfoInstructionSet.csAdds Wasm32 ISA enums and implication/lookup support in the managed JIT interface model.
src/coreclr/tools/Common/Internal/Runtime/ReadyToRunInstructionSetHelper.csMaps Wasm32 instruction sets to R2R instruction sets (with Vector128 remaining non-R2R).
src/coreclr/tools/Common/Internal/Runtime/ReadyToRunInstructionSet.csAdds WasmBase=91 and PackedSimd=92 to the managed R2R enum.
src/coreclr/inc/readytoruninstructionset.hAdds READYTORUN_INSTRUCTION_WasmBase=91 and ..._PackedSimd=92 to the native R2R enum.
src/coreclr/inc/jiteeversionguid.hUpdates the JIT/EE interface GUID to reflect the ISA contract change.
src/coreclr/inc/corinfoinstructionset.hAdds TARGET_WASM instruction set IDs, validation, string conversion, and R2R mapping.

@adamperlin
adamperlinforce-pushed the adamperlin/packed-simd-instruction-desc branch from f41338c to 71d3c13CompareJune 8, 2026 23:43
@adamperlin
adamperlin marked this pull request as ready for review June 8, 2026 23:43
CopilotAI review requested due to automatic review settings June 8, 2026 23:43

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Comment threadsrc/coreclr/tools/Common/Compiler/InstructionSetSupport.cs
@adamperlin
adamperlin requested review from AndyAyersMS and kgJune 9, 2026 16:21
Comment threadsrc/coreclr/inc/corinfoinstructionset.h

@davidwrightondavidwrighton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll also want to adjust ConfigureInstructionSetSupport in InstructionSetHelpers.cs once you start to have an implementation, but this looks like a good starting point to get things in place to some extent.

@adamperlin

Copy link
Copy Markdown
ContributorAuthor

/ba-g previously filed failures + filed #129339

@adamperlin
adamperlin merged commit c6b1bd9 into dotnet:mainJun 12, 2026
109 of 114 checks passed
@adamperlin
adamperlin deleted the adamperlin/packed-simd-instruction-desc branch June 12, 2026 16:52
@pavelsavarapavelsavara added the arch-wasm WebAssembly architecture label Jun 16, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara
See info in area-owners.md if you want to be subscribed.

adamperlin added a commit that referenced this pull request Jun 16, 2026
This is a follow up to #129140, so there is some duplicated diff. This
PR enables `FEATURE_SIMD` and `FEATURE_HW_INTRINSICS` for `TARGET_WASM`
and stubs out the minimal necessary pieces of implementation using a new
`NYI_WASM_SIMD` macro and associated JitOption,
`NyiWasmSimdToR2RUnsupported` to prevent crossgen failures due to the
presence of intrinsics.
There are a few patterns that showed up commonly which required many
ifdef adjustments:
1. Assuming `!TARGET_XARCH` -> `TARGET_ARM64` if hardware intrinsics are
enabled (not the case anymore with wasm)
2. Assuming `FEATURE_HW_INTRINSICS` -> `FEATURE_MASKED_HW_INTRINSICS`
(not the case either for Wasm, as Wasm doesn't have any kind of mask
register).
Stub `HARDWARE_INTRINSIC` definitions were added for quite a few xplat
`Vector128` operations even though these will not be worked on until
further in the implementation plan, since the existence of these
intrinsics was assumed with `FEATURE_HARDWARE_INTRINSICS` in many
places.
---------
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@dotnet-milestone-botdotnet-milestone-botBot added this to the 11.0-preview6 milestone Jun 17, 2026
eiriktsarpalis pushed a commit that referenced this pull request Jul 15, 2026
Adds ISA definitions for `WasmBase`, `PackedSimd`, and `Vector128`. SIMD
support won't be utilized yet, but this is a precursor to ongoing SIMD
work.
eiriktsarpalis pushed a commit that referenced this pull request Jul 15, 2026
This is a follow up to #129140, so there is some duplicated diff. This
PR enables `FEATURE_SIMD` and `FEATURE_HW_INTRINSICS` for `TARGET_WASM`
and stubs out the minimal necessary pieces of implementation using a new
`NYI_WASM_SIMD` macro and associated JitOption,
`NyiWasmSimdToR2RUnsupported` to prevent crossgen failures due to the
presence of intrinsics.
There are a few patterns that showed up commonly which required many
ifdef adjustments:
1. Assuming `!TARGET_XARCH` -> `TARGET_ARM64` if hardware intrinsics are
enabled (not the case anymore with wasm)
2. Assuming `FEATURE_HW_INTRINSICS` -> `FEATURE_MASKED_HW_INTRINSICS`
(not the case either for Wasm, as Wasm doesn't have any kind of mask
register).
Stub `HARDWARE_INTRINSIC` definitions were added for quite a few xplat
`Vector128` operations even though these will not be worked on until
further in the implementation plan, since the existence of these
intrinsics was assumed with `FEATURE_HARDWARE_INTRINSICS` in many
places.
---------
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Jul 18, 2026
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-wasmWebAssembly architecturearea-crossgen2-coreclronly use for closed issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@adamperlin@kg@davidwrighton@pavelsavara