[Wasm RyuJIT] Implement 8 and 16-bit loads/stores; implement indirect loads/stores#123021
Merged
kg merged 6 commits intodotnet:mainfrom Jan 16, 2026
Merged
[Wasm RyuJIT] Implement 8 and 16-bit loads/stores; implement indirect loads/stores#123021kg merged 6 commits intodotnet:mainfrom
kg merged 6 commits intodotnet:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements 8-bit and 16-bit load instructions for WebAssembly RyuJIT, along with support for indirect memory loads (GT_IND nodes). The changes add four new load instruction variants (signed and unsigned 8-bit and 16-bit) and the codegen infrastructure to handle indirect memory accesses through the GT_IND intermediate representation node.
Key changes:
- Added four new WebAssembly load instructions (i32.load8_s, i32.load8_u, i32.load16_s, i32.load16_u) with correct opcodes per the WebAssembly specification
- Extended ins_Load() to map TYP_BYTE, TYP_UBYTE, TYP_SHORT, and TYP_USHORT to the appropriate load instructions
- Implemented genCodeForIndir() for WASM following patterns from other architectures, correctly using genConsumeAddress() to place the address on the value stack before emitting the load instruction
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/coreclr/jit/instrswasm.h | Adds four new load instruction definitions for 8-bit and 16-bit integer loads with correct WebAssembly opcodes (0x2C-0x2F) |
| src/coreclr/jit/instr.cpp | Extends ins_Load() to map byte and short types to the new load instructions |
| src/coreclr/jit/codegenwasm.cpp | Adds GT_IND case handler and implements genCodeForIndir() to generate code for indirect memory loads |
Address PR feedback
Member
Author
|
Added STOREIND while addressing PR feedback since it's similar to IND and a common superpmi failure. |
AndyAyersMS
approved these changes
Jan 15, 2026
Member
|
Failure is a generic GC hole assert, almost certainly unrelated. |
Member
Author
|
Didn't see the approval, thanks for checking the failure! |
Member
Author
|
/ba-g unrelated GC hole |
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.
Not sure my IND implementation is right.
Also sets max unchecked null object offset to 0 to ensure we get more null checks where they belong.