-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve
storeN
instruction encoding with immediates (#1194)
* replace utility method with map_const method * add Wrap utility trait for translator * apply rustfmt * improve encoding of wrapping istore instructions This gets rid of unnecessary allocated function local constants for the immediates of wrapping istore instructions by integrating the wrapping in the translator. Before this commit the translator did not wrap the `value` to store before trying to use it and eventually convert it into a function local constant. For instructions such as i32_store8 (and more) this will never again allocate function local constants now because the wrapped i8 always fits in the `Instruction::I32Store8` instruction's `value` field, etc.. * clean-up use loop * add test_store_wrap_imm test method * use new test method for i32_store8 translation test * use for loops in tests instead of repeating code * improve i32_store8 translation tests with immediate ptr+offset * clean-up test code a bit * fix last remaining i32_store8 translation tests * update translation tests for i32_store16 * update translation tests for i64_store8 * update translation tests for i64_store16 * fix store_offset16_imm based translation tests * extend values for some at_imm translation tests * test both mem0 and mem1 in test_store_at_overflow * update translation tests for i64_store32
- Loading branch information
Showing
9 changed files
with
601 additions
and
292 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.