-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Add wasm as SPMI target #122510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add wasm as SPMI target #122510
Conversation
Allow passing `-target wasm` when using a Wasm cross-jit.
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
There was a problem hiding this comment.
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 adds WebAssembly (WASM) as a valid SPMI (Super PMI - a JIT testing tool) target architecture, enabling cross-compilation support for wasm/wasm32/wasm64 targets. The changes extend the existing architecture enumeration, command-line parsing, and target matching logic to recognize WebAssembly platforms.
Key changes:
- Added WASM32 and WASM64 to the SPMI target architecture enumeration and classification functions
- Extended command-line parsing to accept "wasm", "wasm32", and "wasm64" as valid target values
- Updated architecture matching logic to support WASM32 (note: WASM64 support is incomplete)
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/tools/superpmi/superpmi-shared/spmiutil.h | Adds WASM32 and WASM64 enum values and updates 32-bit/64-bit architecture helper functions |
| src/coreclr/tools/superpmi/superpmi-shared/spmiutil.cpp | Adds TARGET_WASM32 and TARGET_WASM64 preprocessor conditionals for default architecture initialization |
| src/coreclr/tools/superpmi/superpmi/commandline.cpp | Updates help text and command-line validation to accept wasm/wasm32/wasm64 as target values |
| src/coreclr/tools/superpmi/superpmi/superpmi.cpp | Adds string-to-enum mapping for "wasm"/"wasm32" → WASM32 and "wasm64" → WASM64 |
| src/coreclr/tools/superpmi/superpmi/jitinstance.cpp | Refactors switch from IMAGE_FILE_MACHINE constants to CORINFO_ARCH constants and adds CORINFO_ARCH_WASM32 case |
|
@dotnet/jit-contrib PTAL Also a bit of support for Wasm64. Running (as jit) on a subset of codegen bring up tests: Failures (not shown) are mainly for tests with calls/byrefs/casts/unordered compares. |
|
Odd that CI skips superpmi runs for changes to superpmi sources. Probably need to adjust some triggers somewhere. |
|
/azp run runtime-coreclr superpmi-replay |
|
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
| static SPMI_TARGET_ARCHITECTURE SpmiTargetArchitecture = SPMI_TARGET_ARCHITECTURE_RISCV64; | ||
| #elif defined(TARGET_WASM32) | ||
| static SPMI_TARGET_ARCHITECTURE SpmiTargetArchitecture = SPMI_TARGET_ARCHITECTURE_WASM32; | ||
| #elif defined(TARGET_WASM64) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TARGET_WASM64 isn't defined. This is the first use in the repo; intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Odd, for some reason I thought it was. We can leave this part off for now.
adamperlin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me!
Allow passing
-target wasmwhen using a Wasm cross-jit.