-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
riscv64: Remove support for fixed offset jumps from Jump instructions #6988
Merged
alexcrichton
merged 6 commits into
bytecodealliance:main
from
afonso360:riscv-cleanup-jal
Sep 11, 2023
Merged
riscv64: Remove support for fixed offset jumps from Jump instructions #6988
alexcrichton
merged 6 commits into
bytecodealliance:main
from
afonso360:riscv-cleanup-jal
Sep 11, 2023
Conversation
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 is mostly a personal preference. It emits the exact same code.
Replaces it with `Fallthrough` which works the same way with a fixed offset of 0.
It is now only used for `CondBr`
afonso360
added
the
cranelift:area:riscv64
Issues related to the RISC-V 64 backend.
label
Sep 10, 2023
github-actions
bot
added
cranelift
Issues related to the Cranelift code generator
isle
Related to the ISLE domain-specific language
labels
Sep 10, 2023
Subscribe to Label Action
This issue or pull request has been labeled: "cranelift", "cranelift:area:riscv64", "isle"
Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
alexcrichton
approved these changes
Sep 11, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
alexcrichton
pushed a commit
that referenced
this pull request
Sep 12, 2023
…#6988) * riscv64: Use `MachLabel` for Jal * riscv64: Use `Inst::gen_jump` for jumps This is mostly a personal preference. It emits the exact same code. * riscv64: Use VecMachLabel on BrTable * riscv64: Remove `BranchTarget::Offset` arm Replaces it with `Fallthrough` which works the same way with a fixed offset of 0. * riscv64: Rename `BranchTarget` It is now only used for `CondBr` * riscv64: Panic on fallthrough taken target in condbr
eduardomourar
pushed a commit
to eduardomourar/wasmtime
that referenced
this pull request
Sep 13, 2023
…bytecodealliance#6988) * riscv64: Use `MachLabel` for Jal * riscv64: Use `Inst::gen_jump` for jumps This is mostly a personal preference. It emits the exact same code. * riscv64: Use VecMachLabel on BrTable * riscv64: Remove `BranchTarget::Offset` arm Replaces it with `Fallthrough` which works the same way with a fixed offset of 0. * riscv64: Rename `BranchTarget` It is now only used for `CondBr` * riscv64: Panic on fallthrough taken target in condbr
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
cranelift:area:riscv64
Issues related to the RISC-V 64 backend.
cranelift
Issues related to the Cranelift code generator
isle
Related to the ISLE domain-specific language
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.
👋 Hey,
This PR removes fixed offset jumps from some instructions in the RISC-V backend. Fixed offset jumps were replaced with labels in #6955. But we still have support for them.
Currently all branch instructions use the
BranchTarget
struct, that allows a label based jump, or a fixed offset jump.This PR does the following changes:
Jal
now takes a singleMachLabel
as it's targetBrTable
similarly now takes aVec<MachLabel>
CondBr
still usesBranchTarget
, but it can only do a label jump, or fallthrough. It can no longer do a fixed offset jumpSince
BranchTarget
is now only used inCondBr
, I've renamed itCondBrTarget
.