diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2025-09-27 11:18:33 +0100 |
|---|---|---|
| committer | Jacob Young <jacobly0@users.noreply.github.com> | 2025-09-27 18:30:52 -0400 |
| commit | 611c38e6daffc18bc044ebb1e20d161b4ef757f2 (patch) | |
| tree | f825f464e0bfcfdaf3d4894a7006af8edfb62dfd /test | |
| parent | 77fca1652fce295fe0dd7c97432c23b0c4483724 (diff) | |
| download | zig-611c38e6daffc18bc044ebb1e20d161b4ef757f2.tar.gz zig-611c38e6daffc18bc044ebb1e20d161b4ef757f2.zip | |
x86_64: fix unencodable `rem` lowerings
The memory operand might use one of the extended GPRs R8 through R15 and
hence require a REX prefix, but having a REX prefix makes the high-byte
register AH unencodeable as the src operand. This latent bug was exposed
by this branch, presumably because `select` now happens to be putting
something in an extended GPR instead of a legacy GPR.
In theory this could be fixed with minimal cost by introducing a way to
communicate to `select` that neither the destination memory nor the
other temporary can be in an extended GPR. However, I just went for the
simple solution which comes at a cost of one trivial instruction: copy
the remainder from AH to AL, and *then* copy AL to the destination.
Diffstat (limited to 'test')
0 files changed, 0 insertions, 0 deletions
