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

Try to remove Instruction::branch_{i32,i64}_{nez,eqz} #800

Closed
Robbepop opened this issue Nov 24, 2023 · 0 comments · Fixed by #805
Closed

Try to remove Instruction::branch_{i32,i64}_{nez,eqz} #800

Robbepop opened this issue Nov 24, 2023 · 0 comments · Fixed by #805
Labels
cleanup Cleans up some region of the codebase. register-machine A work item for the register-machine engine.

Comments

@Robbepop
Copy link
Member

With recent refactoring and improvements to the register-machine wasmi engine we ended up having

  • Instruction::branch_i32_eqz
  • Instruction::branch_i32_nez
  • Instruction::branch_i64_eqz
  • Instruction::branch_i64_nez

Which are superseeded by the also existing:

  • Instruction::branch_i32_eq_imm16
  • Instruction::branch_i32_ne_imm16
  • Instruction::branch_i64_eq_imm16
  • Instruction::branch_i64_ne_imm16

The only downside is that the latter 4 instructions cannot deal with 32-bit BranchOffset and use a 16-bit BranchOffset instead, however, given that I have not yet encountered a single Wasm program that even comes close to approach this limit I think it is okay to ditch reliance on 32-bit BranchOffset.

Removing the 4 superseeded instructions would clean up the engine a bit.

@Robbepop Robbepop added cleanup Cleans up some region of the codebase. register-machine A work item for the register-machine engine. labels Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Cleans up some region of the codebase. register-machine A work item for the register-machine engine.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant