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

pulley: Implement a new br_table instruction #9659

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

alexcrichton
Copy link
Member

This is intended to match WebAssembly's br_table and Cranelift's version as well. This is implemented as a new br_table32 opcode where a 32-bit number of branch targets are encoded after br_table32 all as a PcRelOffset, a 32-bit offset. This helps bake in a more "macro opcode" into the interpreter rather than a handful of more primitive opcodes that would achieve the same result with loads/indirect jumps/comparisons/etc.

@alexcrichton alexcrichton requested review from a team as code owners November 22, 2024 20:39
@alexcrichton alexcrichton requested review from abrown and pchickey and removed request for a team November 22, 2024 20:39
@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator isle Related to the ISLE domain-specific language pulley Issues related to the Pulley interpreter labels Nov 22, 2024
Copy link

Subscribe to Label Action

cc @cfallin, @fitzgen

This issue or pull request has been labeled: "cranelift", "isle", "pulley"

Thus the following users have been cc'd because of the following labels:

  • cfallin: isle
  • fitzgen: isle, pulley

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

This is intended to match WebAssembly's `br_table` and Cranelift's
version as well. This is implemented as a new `br_table32` opcode where
a 32-bit number of branch targets are encoded after `br_table32` all as
a `PcRelOffset`, a 32-bit offset. This helps bake in a more "macro
opcode" into the interpreter rather than a handful of more primitive
opcodes that would achieve the same result with loads/indirect
jumps/comparisons/etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cranelift Issues related to the Cranelift code generator isle Related to the ISLE domain-specific language pulley Issues related to the Pulley interpreter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant