alexcrichton opened PR #7871 from alexcrichton:x64-mul
to bytecodealliance:main
:
This commit is inspired after reading over some code from #7865 and #7866. The goal of this commit was to refactor scalar multiplication-related instructions in the x64 backend to more closely align with their native instructions. Changes include:
- The
MulHi
instruction is renamed toMul
. This represents eithermul
orimul
producing a doublewide result.- A
Mul8
instruction was added to correspond toMul
for the 8-bit variants that produce a doublewide result in theAX
register rather than the other instructions which split betweenRAX
andRDX
.- The
UMulLo
instruction was removed as now it's covered byMul
- The
AluRmiROpcode::Mul
opcode was removed in favor of newIMul
andIMulImm
instructions. Register allocation and emission already had special cases forMul
which felt better as standalone instructions rather than putting in an existing variant.Lowerings using
imul
are not affected in general but theIMulImm
instruction has different register allocation behavior than before which allows the destination to have a different register than the first operand. Theumulhi
andsmulhi
instructions are also reimplemented with their 8-bit variants instead of extension-plus-16-bit variants.<!--
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 abrown for a review on PR #7871.
alexcrichton requested wasmtime-compiler-reviewers for a review on PR #7871.
fitzgen submitted PR review:
Nice!
fitzgen has enabled auto merge for PR #7871.
fitzgen has disabled auto merge for PR #7871.
alexcrichton updated PR #7871.
alexcrichton commented on PR #7871:
cc @abrown you mentioned that you were also taking a look at this, want me to hold off on merging for that?
alexcrichton updated PR #7871.
github-actions[bot] commented on PR #7871:
Subscribe to Label Action
cc @saulecabrera
<details>
This issue or pull request has been labeled: "cranelift", "cranelift:area:x64", "winch"Thus the following users have been cc'd because of the following labels:
- saulecabrera: winch
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
Nah, it's good to go now that @fitzgen looked at it.
abrown merged PR #7871.
Last updated: Nov 22 2024 at 17:03 UTC