-
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
AArch64: Migrate calls and returns to ISLE. #4788
Conversation
Subscribe to Label Action
This issue or pull request has been labeled: "cranelift", "cranelift:area:aarch64", "cranelift:area:machinst", "cranelift:area:x64", "isle"
Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
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.
This all looks great to me! I just had a couple of non-blocking questions 👍
(decl lower_return (Range ValueSlice) InstOutput) | ||
(rule (lower_return (range_empty) _) (output_none)) | ||
(rule (lower_return (range_unwrap head tail) args) | ||
(let ((_ Unit (copy_to_regs (retval head) (value_slice_get args head)))) | ||
(lower_return tail args))) |
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.
Not at all blocking, but I wonder what a better name for this would be now that it's shared between multiple backends.
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.
We can definitely think more about this -- it also felt a little strange to put it in prelude.isle
to be honest; it seems more like we need a library of "common lowering helpers" that is separate from the language and ISLE-binding prelude proper. But, we can refine more in subsequent PRs!
; orr x0, xzr, #4294967295 | ||
; movn x0, #0 |
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 caused this change?
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.
The returns are going through a different path now, so the immediate handling is a little different; but this is still correct I think (movn x0, #0
generates all-ones, which for an i32
func is the same as u32::MAX
in the return register).
This borrows some machinery from x64 and makes it common. The order of setup for on-stack args is reversed now, but that seems OK if it means we can share more code!