shrayjaiswal050-design opened PR #14796 from shrayjaiswal050-design:fix/x64-i8-imul-imm to bytecodealliance:main:
Fixes #14660.
On x64, multiplying an i8 value by a constant currently uses mulb
and can load the constant from memory. This uses a 32-bit immediate
imul instead, which gives the same low-byte result.Byte loads remain byte-sized. Added tests for both operand orders,
wrapping results, negative constants, and inputs with unused upper bits.Tested on Windows x64:
- 623 x64/runtime filetests completed successfully
- 204 codegen unit tests passed
- Codegen formatting and git diff --check passed
shrayjaiswal050-design requested wasmtime-compiler-reviewers for a review on PR #14796.
shrayjaiswal050-design requested alexcrichton for a review on PR #14796.
github-actions[bot] added the label cranelift on PR #14796.
github-actions[bot] added the label cranelift:area:x64 on PR #14796.
:memo: alexcrichton submitted PR review.
:speech_balloon: alexcrichton created PR review comment:
Can this use the
precise-outputmode to get the full golden output listed here?
:speech_balloon: alexcrichton created PR review comment:
Could this perhaps have rules for
$I16as well since it seems equally applicable? Also -- are you sure this doesn't need to extend thexandyarguments appropriately? I forget the rules around multiplication and bits so I'm not sure myself
Last updated: Oct 31 2026 at 23:03 UTC