alexcrichton requested cfallin for a review on PR #9986.
alexcrichton requested wasmtime-compiler-reviewers for a review on PR #9986.
alexcrichton requested wasmtime-default-reviewers for a review on PR #9986.
alexcrichton opened PR #9986 from alexcrichton:pulley-xzero-xone
to bytecodealliance:main
:
This commit adds a special instruction for setting a register to the value 0 or the value 1. This extends to the full width of the register and accounts for the majority of all
xconst
instructions found inspidermonkey.cwasm
. It's not a major size decrease, but helps a bit.<!--
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
-->
github-actions[bot] commented on PR #9986:
Subscribe to Label Action
cc @fitzgen
<details>
This issue or pull request has been labeled: "cranelift", "pulley"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>
cfallin submitted PR review:
Seems reasonable. Does adding
-1
too help any more with code size? I imagine it could appear with and-masks and such relatively often...
alexcrichton commented on PR #9986:
Looking at
spidermonkey.cwasm
before and after this PR:
- Before: 119494 instances of
xconst*
instructions- After: 58502 instances of
xconst*
instructionsThe most common instances of constants were:
- Before: 41014
0
, 199791
- After: 3091
-4294967296
, 304132
My guess is that
-1
is folded into instructions commonly and doesn't show up as a dedicatedxconst
. The main use forxconst
right now I think is to store a constant to memory or pass it as an ABI argument. I should probably look into adding macro-instructions for the former case...In any case though at least for spidermonkey adding
-1
I don't think will help too too much.
alexcrichton updated PR #9986.
alexcrichton requested wasmtime-core-reviewers for a review on PR #9986.
alexcrichton updated PR #9986.
alexcrichton requested dicej for a review on PR #9986.
alexcrichton has enabled auto merge for PR #9986.
alexcrichton merged PR #9986.
Last updated: Jan 24 2025 at 00:11 UTC