jameysharp opened PR #8403 from jameysharp:simplify-aarch64-constants
to bytecodealliance:main
:
While reviewing #8393 I found the existing
load_constant64_full
function nearly incomprehensible, so I rewrote it. Besides having many fewer cases now, this should also fix part of the bug that #8393 addresses, but that PR fixes other issues as well.This PR changes the operand size that we emit for some cases from 32-bit to 64-bit. In those cases, the operand size doesn't matter because we want the upper 32 bits to be zero. We set them that way with the initial instruction: widening
movz
from 32-bit to 64-bit doesn't change anything. And we preserve the upper bits with subsequentmovk
instructions, instead of zeroing them, but they were already zero.
jameysharp requested elliottt for a review on PR #8403.
jameysharp requested wasmtime-compiler-reviewers for a review on PR #8403.
github-actions[bot] commented on PR #8403:
Subscribe to Label Action
cc @cfallin, @fitzgen
<details>
This issue or pull request has been labeled: "cranelift", "cranelift:area:aarch64", "isle"Thus the following users have been cc'd because of the following labels:
- cfallin: isle
- fitzgen: isle
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
jameysharp updated PR #8403.
jameysharp commented on PR #8403:
#8393 landed so I've rebased this.
Also, I've switched to an implementation which I believe generates exactly the same instructions as the prior implementation in all cases. There are some choices we could make which would synthesize the same constants using a different sequence of instructions, but in almost all cases we'd produce the same number of instructions, so it doesn't make much difference. This algorithm is simple and produces readable disassembly listings so we might as well preserve the existing behavior.
elliottt submitted PR review:
Awesome!
jameysharp has enabled auto merge for PR #8403.
jameysharp merged PR #8403.
Last updated: Dec 23 2024 at 12:05 UTC