[RyuJIT Wasm] Implement i64/f32/f64 loads and adds#121933
Merged
kg merged 14 commits intodotnet:mainfrom Nov 26, 2025
Merged
Conversation
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Member
Author
|
@dotnet/jit-contrib |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements basic arithmetic operations (loads and adds) for i64, f32, and f64 types in the RyuJIT WebAssembly backend. The changes enable the JIT compiler to generate WebAssembly instructions for these fundamental operations across 64-bit integers, 32-bit floats, and 64-bit floats.
- Implements register validation functions for integer and float registers based on WASM value types
- Adds WASM instruction definitions for i64/f32/f64 load and add operations
- Updates code generation to handle typed binary operations using a new helper function
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/jit/targetwasm.h | Replaces NYI stubs with actual implementations of register validation functions that check WASM value types (I32, I64, F32, F64) |
| src/coreclr/jit/instrswasm.h | Adds instruction definitions for i64_load, f32_load, f64_load, i64_add, f32_add, and f64_add with their corresponding opcodes |
| src/coreclr/jit/instr.cpp | Extends ins_Load to support TYP_LONG, TYP_FLOAT, and TYP_DOUBLE by mapping them to appropriate WASM load instructions |
| src/coreclr/jit/codegenwasm.cpp | Introduces OperAndType helper to combine operation and type into a switch value, refactors genCodeForBinary to handle GT_ADD for INT, LONG, FLOAT, and DOUBLE types |
| src/coreclr/jit/lower.cpp | Adds workaround for NumSegments being 0 on WASM to prevent crashes when creating GT_PUTARG_STK nodes |
jakobbotsch
reviewed
Nov 24, 2025
3 tasks
SingleAccretion
approved these changes
Nov 26, 2025
Contributor
SingleAccretion
left a comment
There was a problem hiding this comment.
LGTM with one comment. Nice!
AndyAyersMS
approved these changes
Nov 26, 2025
Member
AndyAyersMS
left a comment
There was a problem hiding this comment.
Let's merge this and I will fix up my control flow PR to build on it.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
My first JIT PR so I'm keeping it simple.