Stream: git-wasmtime

Topic: wasmtime / PR #9994 pulley: Add more addressing modes for...


view this post on Zulip Wasmtime GitHub notifications bot (Jan 13 2025 at 16:58):

alexcrichton opened PR #9994 from alexcrichton:pulley-wasm-addressing-modes to bytecodealliance:main:

This commit adds a new "g32" addressing mode to Pulley that matches the pattern emitted by Cranelift for 32-bit wasm guests running on hosts. The general idea here is that this addressing mode encompasses an addition of a host-width value to a zero-extended (optionally) 32-bit value. On 32-bit hosts there's no zero-extension but on 64-bit hosts there's a zero-extension. The wasm address is always 32-bits though which enables using a single instruction for both 32 and 64-bit hosts.

New "g32" loads and stores are added to Pulley with varying sizes and options according to what seems to be common in wasm. The disas test suite was updated to showcase using these instructions for wasm loads/stores on 32 and 64-bit hosts.

An additional change in this commit is to deduplicate the 32/64-bit bounds-check macro-ops. The trick in this commit works for those as well meaning that only a single instruction is needed instead of one-per-host-pointer-width. Additionally the load of the bound from the VMContext is folded into the bounds check itself as it was found that this was always present anyway before the bounds check.

Overall this shrinks the size of spidermonkey.cwasm from 21M to 20M and the runtime of pulldown-cmark, bz2, and spidermonkey on Sightglass have all been reduced by 10%. Not as big wins as I was hoping for but alas.

<!--
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 (Jan 13 2025 at 16:58):

alexcrichton requested cfallin for a review on PR #9994.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 13 2025 at 16:58):

alexcrichton requested wasmtime-compiler-reviewers for a review on PR #9994.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 13 2025 at 16:58):

alexcrichton requested fitzgen for a review on PR #9994.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 13 2025 at 16:58):

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

view this post on Zulip Wasmtime GitHub notifications bot (Jan 13 2025 at 16:58):

alexcrichton requested wasmtime-default-reviewers for a review on PR #9994.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 13 2025 at 18:15):

alexcrichton updated PR #9994.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 13 2025 at 18:47):

github-actions[bot] commented on PR #9994:

Subscribe to Label Action

cc @cfallin, @fitzgen

<details>
This issue or pull request has been labeled: "cranelift", "isle", "pulley"

Thus the following users have been cc'd because of the following labels:

To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.

Learn more.
</details>

view this post on Zulip Wasmtime GitHub notifications bot (Jan 13 2025 at 20:06):

fitzgen submitted PR review:

Nice!

view this post on Zulip Wasmtime GitHub notifications bot (Jan 13 2025 at 20:54):

alexcrichton updated PR #9994.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 13 2025 at 20:54):

alexcrichton has enabled auto merge for PR #9994.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 13 2025 at 21:24):

alexcrichton merged PR #9994.


Last updated: Jan 24 2025 at 00:11 UTC