Stream: git-wasmtime

Topic: wasmtime / PR #9858 pulley: Add offset8 integer loads/stores


view this post on Zulip Wasmtime GitHub notifications bot (Dec 18 2024 at 21:55):

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

view this post on Zulip Wasmtime GitHub notifications bot (Dec 18 2024 at 21:55):

alexcrichton requested abrown for a review on PR #9858.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 18 2024 at 21:55):

alexcrichton opened PR #9858 from alexcrichton:pulley-offset8 to bytecodealliance:main:

This commit extends the set of opcodes to load/stores from memory with integer registers. Previously the only addressing mode supported was a base register plus a 32-bit signed immediate. This immediate frequently doesn't need 32-bits though and can often fit in a much smaller range. Looking at spidermonkey.cwasm a large number of loads/stores can fit within an unsigned 8-bit integer instead so this commit adds an offset8 mode in addition to the preexisting offset32 mode. Empirically this commit shrinks spidermonkey.cwasm for pulley64 from 33M to 31M.

This notably, at this time, does not extend general addressing modes in Pulley nor does it extend all loads/stores. For example float/vector/big-endian loads and stores all continue to only support a 32-bit signed offset from the base pointer. This is done under the assumption that integer loads/stores dominate both performance/code-size, but this is not empirically proven just yet.

Additionally at this time the choice is being made to add an opcode-per-addressing-mode rather than having a single load opcode take a general addressing mode. The assumption here is that decoding a fully general addressing mode and processing it is probably slower at runtime than specializing opcodes per addressing mode. This is currently an unproven assumption however and the cost of this is increased complexity in the Cranelift backend as it has to have many branches for all loads/stores supported.

<!--
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 (Dec 18 2024 at 21:55):

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

view this post on Zulip Wasmtime GitHub notifications bot (Dec 18 2024 at 21:55):

alexcrichton requested fitzgen for a review on PR #9858.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 18 2024 at 21:55):

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

view this post on Zulip Wasmtime GitHub notifications bot (Dec 18 2024 at 23:03):

fitzgen submitted PR review:

LGTM. Agree with both intuitions, looking forward to seeing empirical evidence.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 18 2024 at 23:32):

alexcrichton updated PR #9858.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 18 2024 at 23:32):

alexcrichton has enabled auto merge for PR #9858.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 19 2024 at 00:04):

alexcrichton merged PR #9858.


Last updated: Dec 23 2024 at 12:05 UTC