MarinPostma opened PR #9751 from MarinPostma:aarch64-call
to bytecodealliance:main
:
Implement the following MASM instruction for the aarch64 platform:
- call
- address_at_vmctx
- trapz
I initially planned to only implement call, but implementing the tests uncovered the necessity to implement the other two as prerequisite for indirect calls.
Right now the calling convention is hardcoded to SystemV, but maybe we also want to support AppleAarch64?
#8321
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
MarinPostma requested wasmtime-compiler-reviewers for a review on PR #9751.
MarinPostma requested abrown for a review on PR #9751.
MarinPostma requested fitzgen for a review on PR #9751.
MarinPostma requested wasmtime-core-reviewers for a review on PR #9751.
MarinPostma updated PR #9751.
saulecabrera commented on PR #9751:
I can help taking a look at this one.
saulecabrera requested saulecabrera for a review on PR #9751.
github-actions[bot] commented on PR #9751:
Subscribe to Label Action
cc @saulecabrera
<details>
This issue or pull request has been labeled: "winch"Thus the following users have been cc'd because of the following labels:
- saulecabrera: winch
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
saulecabrera submitted PR review:
Generally looks great, thanks. Left some inline nitpicks.
saulecabrera created PR review comment:
Would you mind adding some comments to these methods?
saulecabrera created PR review comment:
Right now the calling convention is hardcoded to SystemV, but maybe we also want to support AppleAarch64?
I see why this might be confusing. Even though the
CallConv
is hard coded here, there are two things to note:
- All the infrastructure to handle the calling convention differences, is handled very early on in the compilation process in Winch (and in Cranelift as well) e.g., when constructing the signature for the callee, at that point, you'll note that Winch correctly handles the default and apple-aarch64 calling conventions.
- Winch relies on Cranelift's binary emission infrastructure, and in this concrete case, as you can note, you're constructing a
CallInfo::empty()
, which signals that none of the other Cranelift-specific invariants must be taken into account when emitting calls (some of them depend on the calling convention that is passed here).I've opened https://github.com/bytecodealliance/wasmtime/pull/9757 to refactor call emission a bit with the hope of making this part more consistent.
saulecabrera created PR review comment:
/// Trap if `rn` is zero.
MarinPostma submitted PR review.
MarinPostma created PR review comment:
That refactor makes a lot of sense to me :+1:
MarinPostma updated PR #9751.
MarinPostma submitted PR review.
MarinPostma created PR review comment:
fixed in f1a56f1
MarinPostma submitted PR review.
MarinPostma created PR review comment:
fixed in f1a56f1
MarinPostma submitted PR review.
MarinPostma created PR review comment:
updated in f4a6cf7
MarinPostma updated PR #9751.
MarinPostma updated PR #9751.
MarinPostma requested saulecabrera for a review on PR #9751.
saulecabrera commented on PR #9751:
There are some failures in CI -- I'm trying to figure out if they are related to your changes or not.
saulecabrera submitted PR review.
saulecabrera created PR review comment:
I'm not entirely sure if this is the source of the failure, but here you need to specify
;;! test = "winch"
Else this will use Cranelift
MarinPostma updated PR #9751.
MarinPostma submitted PR review.
MarinPostma created PR review comment:
Some submodule update sneaked into one of my commits. That's what's messing with the CI, I'll fix that tommorow
MarinPostma updated PR #9751.
MarinPostma commented on PR #9751:
Alright, I updated the submodule, ci looks good now
saulecabrera submitted PR review:
Thanks!
saulecabrera merged PR #9751.
Last updated: Dec 23 2024 at 12:05 UTC