alexcrichton opened PR #7010 from alexcrichton:typed-v128
to bytecodealliance:main
:
This commit adds a Rust type
V128
which corresponds to the wasmv128
type. This is intended to perhaps one day have accessors for lanes of various sizes but in the meantime only supports conversion back and forth betweenu128
. The intention of this type is to allow platforms to perform typed between to functions that take or returnv128
wasm values.Previously this was not implemented because it's a bit tricky ABI-wise. Typed functions work by passing arguments in registers which requires the calling convention to match in both Cranelift and in Rust. This should be the case for supported platforms and the default calling convention, especially now that the wasm calling convention is separate from the platform calling convention. This does mean, however, that this feature can only be supported on x86_64 and AArch64. Currently neither s390x nor RISC-V have a means of supporting the vector calling convention since the vector types aren't available on stable in Rust itself. This means that it's now unfortunately possible to write a Wasmtime embedding that compiles on x86_64 that doesn't compile on s390x for example, but given how niche this feature is that seems like an ok tradeoff for now and by the time it's a problem Rust might have native stable support for vector types on these platforms.
prtest:full
<!--
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 requested fitzgen for a review on PR #7010.
alexcrichton requested wasmtime-core-reviewers for a review on PR #7010.
alexcrichton updated PR #7010.
fitzgen submitted PR review.
fitzgen submitted PR review.
fitzgen created PR review comment:
Neat trick
fitzgen created PR review comment:
Shouldn't this be
cfg
ed the same way as theWasmTy
implementation forV128
is?
fitzgen created PR review comment:
// that a 128-bit representation is chosen here but it can't be passed directly // to WebAssembly, for example, and must instead be passed through an array-call trampoline.
right?
alexcrichton updated PR #7010.
alexcrichton has enabled auto merge for PR #7010.
alexcrichton updated PR #7010.
alexcrichton merged PR #7010.
Last updated: Nov 22 2024 at 16:03 UTC