alexcrichton requested wasmtime-compiler-reviewers for a review on PR #9858.
alexcrichton requested abrown for a review on PR #9858.
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 anoffset8
mode in addition to the preexistingoffset32
mode. Empirically this commit shrinksspidermonkey.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:
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-core-reviewers for a review on PR #9858.
alexcrichton requested fitzgen for a review on PR #9858.
alexcrichton requested wasmtime-default-reviewers for a review on PR #9858.
fitzgen submitted PR review:
LGTM. Agree with both intuitions, looking forward to seeing empirical evidence.
alexcrichton updated PR #9858.
alexcrichton has enabled auto merge for PR #9858.
alexcrichton merged PR #9858.
Last updated: Dec 23 2024 at 12:05 UTC