Stream: git-wasmtime

Topic: wasmtime / PR #7010 Add support for `v128` to the typed f...


view this post on Zulip Wasmtime GitHub notifications bot (Sep 12 2023 at 21:04):

alexcrichton opened PR #7010 from alexcrichton:typed-v128 to bytecodealliance:main:

This commit adds a Rust type V128 which corresponds to the wasm v128 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 between u128. The intention of this type is to allow platforms to perform typed between to functions that take or return v128 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:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Sep 12 2023 at 21:05):

alexcrichton requested fitzgen for a review on PR #7010.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 12 2023 at 21:05):

alexcrichton requested wasmtime-core-reviewers for a review on PR #7010.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 12 2023 at 21:11):

alexcrichton updated PR #7010.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 13 2023 at 16:35):

fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 13 2023 at 16:35):

fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 13 2023 at 16:35):

fitzgen created PR review comment:

Neat trick

view this post on Zulip Wasmtime GitHub notifications bot (Sep 13 2023 at 16:35):

fitzgen created PR review comment:

Shouldn't this be cfged the same way as the WasmTy implementation for V128 is?

view this post on Zulip Wasmtime GitHub notifications bot (Sep 13 2023 at 16:35):

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?

view this post on Zulip Wasmtime GitHub notifications bot (Sep 13 2023 at 22:17):

alexcrichton updated PR #7010.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 13 2023 at 22:19):

alexcrichton has enabled auto merge for PR #7010.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 14 2023 at 15:16):

alexcrichton updated PR #7010.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 14 2023 at 16:44):

alexcrichton merged PR #7010.


Last updated: Dec 23 2024 at 13:07 UTC