D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 12971 - Missing REX prefix for 8 bit register access
Summary: Missing REX prefix for 8 bit register access
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 All
: P1 major
Assignee: No Owner
URL:
Keywords: iasm, pull, wrong-code
Depends on:
Blocks:
 
Reported: 2014-06-23 20:36 UTC by safety0ff.bugz
Modified: 2015-06-17 21:04 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description safety0ff.bugz 2014-06-23 20:36:59 UTC
asm {
naked;
AND SIL, 1;
}

Gets translated to
and DH, 1;
Comment 1 Orvid King 2014-06-23 21:29:24 UTC
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 safety0ff.bugz 2014-06-26 06:21:54 UTC
SIL is broken beyond recognition:
SHR SIL, 1; // DMD outputs SHR DH, 1
movzx CX, SIL; // movzbw CX, DH
Comment 3 safety0ff.bugz 2014-12-07 22:29:24 UTC
Likely affects SPL, BPL, SIL and DIL since they all require REX.
Comment 5 github-bugzilla 2015-04-08 21:58:28 UTC
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 github-bugzilla 2015-06-17 21:04:18 UTC
Commits pushed to stable 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