-
Notifications
You must be signed in to change notification settings - Fork 1.4k
x64: Migrate div instructions to the new assembler #10820
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
Conversation
Subscribe to Label Action
This issue or pull request has been labeled: "cranelift", "cranelift:area:x64", "cranelift:meta", "winch"
Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
pub fn trap() -> Operand { | ||
Operand { | ||
implicit: true, | ||
..Operand::from(Location::trap) | ||
} | ||
} |
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.
What if instead of "trap
as an Operand
" we add a field like Inst::trap
? I'm concerned that trap codes aren't really operands after all and that we already have a TrapCode
hidden away in the Amode
with all of its own machinery. Seems like it would be better to:
- define all instructions that can trap with something like
inst(...).can_trap()
- decide whether we truly need to pass around trap codes in ISLE or if we can define them earlier, e.g.,
.can_trap(242)
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.
Tried it out and I like it better too 👍
This mostly required adding a new kind of operand representing a `TrapCode` and plumbing around a few bits and bobs to ensure that this compile-time-only-abstraction does not need to be accounted for in all the encoding bits.
Reduces the size of `KnownOffset` so `Option<KnownOffset>` doesn't have such a high alignment or size, greatly shrinking the size of the instruction and prevents the changes to `Div` from increasing the size of the overall `Inst` enum. In fact it now shrinks!
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!
This mostly required adding a new kind of operand representing a
TrapCode
and plumbing around a few bits and bobs to ensure that this compile-time-only-abstraction does not need to be accounted for in all the encoding bits.