-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[RyuJIT Wasm] Implement i64/f32/f64 loads and adds #121933
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
Conversation
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
|
@dotnet/jit-contrib |
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 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 |
SingleAccretion
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.
LGTM with one comment. Nice!
AndyAyersMS
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.
Let's merge this and I will fix up my control flow PR to build on it.
My first JIT PR so I'm keeping it simple.