-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
s390x: Support tail calls #9052
Conversation
Subscribe to Label Action
This issue or pull request has been labeled: "cranelift", "cranelift:area:machinst", "isle", "wasmtime:api", "wasmtime:config"
Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
Label Messager: wasmtime:configIt looks like you are changing Wasmtime's configuration options. Make sure to
To modify this label's message, edit the To add new label messages or remove existing label messages, 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.
Nice!
I didn't evaluate the details of the calling convention, as s390x isn't my area of expertise, but everything looks great in general, and I was very pleased to see the updates to the runtests and fuzzgen. Couple nitpick-y suggestions below, but I think this is basically good to go.
Thanks, Ulrich!!
&MemArg::InitialSPOffset { off } => MemArg::InitialSPOffset { off: off + offset }, | ||
&MemArg::NominalSPOffset { off } => MemArg::NominalSPOffset { off: off + offset }, | ||
&MemArg::SlotOffset { off } => MemArg::SlotOffset { off: off + offset }, | ||
_ => unreachable!(), |
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 cases is this matching? I think it might be better to explicitly list them, rather than using _
, so that if more MemArg
variants are added in the future we don't forget to consider/update this case.
pub struct EmitState { | ||
pub(crate) initial_sp_offset: i64, | ||
pub(crate) nominal_sp_offset: u32, |
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.
Can we add some documentation for what the nominal SP is and what its relation to the actual SP is? This was something that I always forgot the nitty-gritty details of in the old system, so if we are bringing part of it back, I think it would be helpful to have comments spelling those things out.
/// Get the return area pointer register. | ||
pub fn ret_area_ptr(&self) -> Reg { | ||
self.ret_area_ptr.unwrap() | ||
} |
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 don't always have a return area pointer, so I think this should return an Option<Reg>
and let callers do the unwrap if they have knowledge of why it definitely exists in their specific case.
/// Get the return area pointer register. | |
pub fn ret_area_ptr(&self) -> Reg { | |
self.ret_area_ptr.unwrap() | |
} | |
/// Get the return area pointer register, if any. | |
pub fn ret_area_ptr(&self) -> Option<Reg> { | |
self.ret_area_ptr | |
} |
;; Incoming return area pointer. | ||
(decl abi_ret_area_ptr () Reg) | ||
(extern constructor abi_ret_area_ptr abi_ret_area_ptr) |
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.
And then this external constructor could be called unwrap_abi_ret_area_ptr
or some such.
( | ||
false, | ||
true, |
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.
\o/
5141997
to
7de7f55
Compare
This adds support for a newly defined tail-call ABI for s390x as well as supporting tail calls themselves. We now use the tail-call ABI by default for Wasmtime, and enable tail calls by default. This also allows getting rid of a number of special case and test exclusions for s390x. Fixes: bytecodealliance#6530
7de7f55
to
5286fca
Compare
Thanks for the review, @fitzgen ! The latest version should address all review comments. |
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.
Thanks!
This adds support for a newly defined tail-call ABI for s390x as well as supporting tail calls themselves.
We now use the tail-call ABI by default for Wasmtime, and enable tail calls by default.
This also allows getting rid of a number of special case and test exclusions for s390x.
Fixes: #6530