-
Notifications
You must be signed in to change notification settings - Fork 316
Wasmi IR v3.0 #1650
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
Open
Robbepop
wants to merge
165
commits into
main
Choose a base branch
from
rf-wasmi-ir-3.0
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Wasmi IR v3.0 #1650
Conversation
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
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1650 +/- ##
==========================================
- Coverage 70.65% 68.71% -1.95%
==========================================
Files 179 199 +20
Lines 15243 15668 +425
==========================================
- Hits 10770 10766 -4
- Misses 4473 4902 +429 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This was referenced Sep 2, 2025
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.
Closes #1642.
New Wasmi IR bytecode that stores immediates inline instead of relying on function local constants.
This new Wasmi IR is generated via
build.rs
script and thus out of the box way more consistent than its precursor.The new IR supports encoding the instruction stream into a byte stream and decode it from a byte stream back into instructions.
The following features are supported:
enum Op
: type similar to Wasmi's currentInstruction
typeenum OpCode
:Op
discriminants encoded asu16
- helps with threaded code encodingEncode
&Decode
: safe encoding ofOp
(and its components) andunsafe
but efficient decoding ofOp
.Encoder
andDecoder
traits that are going to be implemented in thewasmi
crate by respective types.Unblocks the following issues:
wasmi_ir
: see ifbuild.rs
script is more efficient thanmacro_rules
for codegen #1485: as this is based onbuild.rs
codegen we found this to be roughly twice as fast as our current macro approach for fresh builds.Decode
allows to more easily share signatures.wasmi_ir
: Add properIrEncoder
to encodeInstruction
s as bytes #1324ToDos
simd
operators.v128.load memarg
:(i32) -> (v128)
v128.store memarg
:(i32 v128) -> ()
v128.load8x8_s memarg
:(i32) -> (v128)
v128.load8x8_u memarg
:(i32) -> (v128)
v128.load16x4_s memarg
:(i32) -> (v128)
v128.load16x4_u memarg
:(i32) -> (v128)
v128.load32x2_s memarg
:(i32) -> (v128)
v128.load32x2_u memarg
:(i32) -> (v128)
v128.load8_splat memarg
:(i32) -> (v128)
v128.load16_splat memarg
:(i32) -> (v128)
v128.load32_splat memarg
:(i32) -> (v128)
v128.load64_splat memarg
:(i32) -> (v128)
v128.load8_lane memarg laneidx
:(i32 v128) -> (v128)
v128.load16_lane memarg laneidx
:(i32 v128) -> (v128)
v128.load32_lane memarg laneidx
:(i32 v128) -> (v128)
v128.load64_lane memarg laneidx
:(i32 v128) -> (v128)
v128.store8_lane memarg laneidx
:(i32 v128) -> ()
v128.store16_lane memarg laneidx
:(i32 v128) -> ()
v128.store32_lane memarg laneidx
:(i32 v128) -> ()
v128.store64_lane memarg laneidx
:(i32 v128) -> ()
v128.load32_zero memarg
:(i32) -> (v128)
v128.load64_zero memarg
:(i32) -> (v128)
relaxed-simd
operators.I16x8RelaxedDotI8x16I7x16S
I32x4RelaxedDotI8x16I7x16AddS
F32x4RelaxedMadd
F32x4RelaxedNmadd
F64x2RelaxedMadd
F64x2RelaxedNmadd