Bug 12971 – Missing REX prefix for 8 bit register access

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
All
Creation time
2014-06-23T20:36:00Z
Last change time
2015-06-17T21:04:18Z
Keywords
iasm, pull, wrong-code
Assigned to
nobody
Creator
safety0ff.bugz
See also
https://issues.dlang.org/show_bug.cgi?id=9965

Comments

Comment #0 by safety0ff.bugz — 2014-06-23T20:36:59Z
asm { naked; AND SIL, 1; } Gets translated to and DH, 1;
Comment #1 by blah38621 — 2014-06-23T21:29:24Z
As a bit more information, this is caused by a missing REX prefix, and also applies to OR, XOR, AND, ADD, SUB, and a few other instructions that use op-code 0x80 as their (I know there's a name for the set, but I can't remember it or find it anywhere :( ) I believe it is also limited to the r8, imm8 version of the op-codes.
Comment #2 by safety0ff.bugz — 2014-06-26T06:21:54Z
SIL is broken beyond recognition: SHR SIL, 1; // DMD outputs SHR DH, 1 movzx CX, SIL; // movzbw CX, DH
Comment #3 by safety0ff.bugz — 2014-12-07T22:29:24Z
Likely affects SPL, BPL, SIL and DIL since they all require REX.
Comment #4 by safety0ff.bugz — 2015-04-04T22:10:11Z
Comment #5 by github-bugzilla — 2015-04-08T21:58:28Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/c056b9dd2dfb6f03e0a3cb0c98c0c85b64dfe5d8 Fix issue 12971 - Missing REX prefix for 8 bit register access https://github.com/D-Programming-Language/dmd/commit/0bd6aad8f49221886275bc965d8bd25a0160e7a2 Merge pull request #4554 from WalterWaldron/fix12971 Fix issue 12971 - Missing REX prefix for 8 bit register access
Comment #6 by github-bugzilla — 2015-06-17T21:04:18Z