saulecabrera opened PR #10312 from saulecabrera:winch-aarch64-abi
to bytecodealliance:main
:
This commit finalizes the ABI integration between Winch and Cranelift, notably:
- Updates the Cranelift ABI to ensure that all the Winch register clobbers are taken into account.
- Updates the Winch ABI to treat x28 as callee-saved, since it's used as the shadow stack pointer.
The alternative to treating x28 as callee-saved is to treat it as caller-saved and save it when required e.g., at call-sites, even though this approach works, it's probably more efficient to perform a store/pop once per function, to minimize the number of move instructions required.
There are still some changes needed in order to fully enable running spec tests for aarch64, however, this change is one step further. If interested, you can run the call.wast test via:
cargo run -- wast -Ccompiler=winch tests/spec_testsuite/call_indirect.wast
<!--
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
-->
saulecabrera requested wasmtime-compiler-reviewers for a review on PR #10312.
saulecabrera requested fitzgen for a review on PR #10312.
saulecabrera edited PR #10312:
This commit finalizes the ABI integration between Winch and Cranelift, notably:
- Updates the Cranelift ABI to ensure that all the Winch register clobbers are taken into account.
- Updates the Winch ABI to treat x28 as callee-saved, since it's used as the shadow stack pointer.
The alternative to treating x28 as callee-saved is to treat it as caller-saved and save it when required e.g., at call-sites, even though this approach works, it's probably more efficient to perform a store/pop once per function, to minimize the number of move instructions required.
There are still some changes needed in order to fully enable running spec tests for aarch64, however, this change is one step further. If interested, you can run the call.wast test via:
cargo run -- wast -Ccompiler=winch tests/spec_testsuite/call_indirect.wast
<!--
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
-->
saulecabrera edited PR #10312:
This commit finalizes the ABI integration between Winch and Cranelift, notably:
- Updates the Cranelift ABI to ensure that all the Winch register clobbers are taken into account.
- Updates the Winch ABI to treat x28 as callee-saved, since it's used as the shadow stack pointer.
The alternative to treating x28 as callee-saved is to treat it as caller-saved and save it when required e.g., at call-sites, even though this approach works, it's probably more efficient to perform a store/pop once per function, to minimize the number of move instructions required.
There are still some changes needed in order to fully enable running spec tests for aarch64, however, this change is one step further. If interested, you can run the call.wast test via:
cargo run -- wast -Ccompiler=winch tests/spec_testsuite/call.wast
<!--
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
-->
saulecabrera updated PR #10312.
saulecabrera requested wasmtime-core-reviewers for a review on PR #10312.
fitzgen submitted PR review.
alexcrichton merged PR #10312.
Last updated: Apr 18 2025 at 11:03 UTC