elliottt opened PR #8056 from elliottt:trevor/cranelift-calling-winch to bytecodealliance:main:
Add a
Winchcalling convention to cranelift that has no callee saves, and
clobbers everything. This will enable us to use thewasmtime-craneliftgenerated
trampolines in thewasmtime-winchcrate.<!--
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
-->
elliottt updated PR #8056.
elliottt edited PR #8056:
Add a
Winchcalling convention to cranelift that has no callee saves, and clobbers everything. This will enable us to use thewasmtime-craneliftgenerated trampolines in thewasmtime-winchcrate.<!--
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
-->
elliottt has marked PR #8056 as ready for review.
elliottt requested cfallin for a review on PR #8056.
elliottt requested wasmtime-compiler-reviewers for a review on PR #8056.
elliottt edited PR #8056:
Add a
Winchcalling convention to cranelift that has no callee saves, and clobbers everything. This will enable us to use thewasmtime-craneliftgenerated trampolines in thewasmtime-winchcrate.I've enabled fuzzing for this calling convention, as well as added clif tests for the
x64andaarch64backends. I've explicitly disabled support inriscv64ands390x, as it's not currently possible to target either of those architectures with winch.<!--
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
-->
alexcrichton submitted PR review.
alexcrichton submitted PR review.
alexcrichton created PR review comment:
Could this be shared with
tail_clobbersabove as something likepreg_set_all()?
alexcrichton created PR review comment:
Like x64, could the shared bits with tail be factored to a helper constant/function?
elliottt submitted PR review.
elliottt created PR review comment:
My worry was that we've been discussing adding callee saves back to the tail calling convention, and I didn't want that change to accidentally undo this one.
alexcrichton submitted PR review.
alexcrichton created PR review comment:
Oh sure, so not literally sharing the name "tail" but something like a helper function that both tail/winch call, and one day tail will stop calling it
elliottt submitted PR review.
elliottt created PR review comment:
That works!
elliottt updated PR #8056.
elliottt updated PR #8056.
elliottt merged PR #8056.
Last updated: Dec 13 2025 at 19:03 UTC