Skip to content
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

Rename instructions with immediate values + add ShiftAmount #1221

Merged
merged 7 commits into from
Oct 4, 2024

Conversation

Robbepop
Copy link
Member

@Robbepop Robbepop commented Oct 4, 2024

This PR looks bigs and scary but it does not introduce new instructions or change their encoding or semantics.
The new ShiftAmount abstractions improves type safety of Instruction.

  • Renames commutative instructions to better reflect if rhs or lhs is an immediate value.
  • Rename shift and rotate instructions with immediate shift amount to x_by, e.g. shl_by.
  • Remove unnecessary _lhs affix from shift and rotate instructions that have an immediate value.
  • Add new wasmi_ir::ShiftAmount abstraction.

We will begin to rename immediate variants of binary instructions to tell if `lhs` or `rhs` operand is the immediate by appending either `Rhs` or `Lhs`.
The new names are now mirroring their `lhs` immediate counterparts and make it more clear where the immediate is positioned.
Copy link

codecov bot commented Oct 4, 2024

Codecov Report

Attention: Patch coverage is 85.06151% with 85 lines in your changes missing coverage. Please review.

Project coverage is 81.34%. Comparing base (d22362a) to head (a2f3f4b).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crates/wasmi/src/engine/executor/instrs.rs 41.77% 46 Missing ⚠️
crates/wasmi/src/engine/translator/visit.rs 0.00% 38 Missing ⚠️
crates/wasmi/src/engine/executor/instrs/binary.rs 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1221      +/-   ##
==========================================
+ Coverage   81.30%   81.34%   +0.03%     
==========================================
  Files         303      303              
  Lines       25025    25032       +7     
==========================================
+ Hits        20347    20362      +15     
+ Misses       4678     4670       -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Robbepop Robbepop merged commit c66704b into main Oct 4, 2024
18 of 19 checks passed
@Robbepop Robbepop deleted the rf-rename-instr-imm-variants branch October 4, 2024 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant