alexcrichton opened PR #10727 from alexcrichton:compile-away-pulley-simd to bytecodealliance:main:
This commit adds a new feature to Pulley which is used to reduce the compiled code size of the interpreter itself by disabling SIMD opcode interpretation at compile-time. The goal here is to be low-impact on Pulley itself to avoid needing
#[cfg]all over the place and to additionally avoid the need to redesign Pulley's opcode macro for use in various parts of Wasmtime.Methods are annotated with a custom macro in the interpreter which registers a
#[cfg]that either does the listed implementation or switches to an implementation that emits a trap if executed. This means that it's safe to execute mismatched code where SIMD was enabled at compile time but disabled at runtime, it just means the semantics may be a bit surprising to debug.Note that this SIMD is still enabled by default, and an explicit
--cfgviaRUSTFLAGSis required to compile-out the SIMD support. Cargo features aren't a great fit for this sort of feature so an explicit flag is used.<!--
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 wasmtime-default-reviewers for a review on PR #10727.
alexcrichton requested wasmtime-core-reviewers for a review on PR #10727.
alexcrichton requested pchickey for a review on PR #10727.
alexcrichton updated PR #10727.
github-actions[bot] commented on PR #10727:
Subscribe to Label Action
cc @fitzgen
<details>
This issue or pull request has been labeled: "pulley", "wasmtime:api", "wasmtime:docs"Thus the following users have been cc'd because of the following labels:
- fitzgen: pulley
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
alexcrichton commented on PR #10727:
I gathered some numbers in https://github.com/google/wasefire/issues/458#issuecomment-2851490398 and for that particular embedding this is a 10% reduction in text size when compiled with
--releaseand a 5% reduction in text size when compiled withopt-level=z
alexcrichton edited a comment on PR #10727:
I gathered some numbers in https://github.com/google/wasefire/issues/458#issuecomment-2851490398 and for that particular embedding this is a 10% reduction in text size (44k) when compiled with
--releaseand a 5% reduction in text size (14k) when compiled withopt-level=z
pchickey submitted PR review.
alexcrichton updated PR #10727.
alexcrichton has enabled auto merge for PR #10727.
alexcrichton updated PR #10727.
alexcrichton updated PR #10727.
alexcrichton has enabled auto merge for PR #10727.
alexcrichton merged PR #10727.
Last updated: Dec 06 2025 at 06:05 UTC