alexcrichton requested fitzgen for a review on PR #9863.
alexcrichton opened PR #9863 from alexcrichton:pulley-br-with-imm
to bytecodealliance:main
:
This commit adds a large number of new
br_if_x*
instructions which compare with an immediate instead of comparing two registers. This is pretty common in wasm/compiled code where, for example, loop upper bounds are often constants. This helps compress code slightly while fusing more instructions together.The main cost of this is that the number of opcodes added here is quite large. Like with previous immediate-taking opcodes both 8 and 32-bit variants of immediates are added for all comparisons. Additionally unlike the previous set of branch-and-compare instructions it's required to add instructions for
>
and>=
because the operands cannot be swapped to invert the condition, further increasing the number of opcodes added.This is a mild size reduction on
spidermonkey.cwasm
from 29M to 28M but it's mostly expected to be a performance win for interpreted loops.<!--
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-compiler-reviewers for a review on PR #9863.
alexcrichton requested wasmtime-core-reviewers for a review on PR #9863.
alexcrichton requested wasmtime-default-reviewers for a review on PR #9863.
fitzgen submitted PR review.
fitzgen merged PR #9863.
Last updated: Dec 23 2024 at 13:07 UTC