D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 12832 - asm movdqu accepts wrong operand size
Summary: asm movdqu accepts wrong operand size
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 All
: P1 normal
Assignee: No Owner
URL:
Keywords: accepts-invalid, iasm, pull
Depends on:
Blocks:
 
Reported: 2014-06-01 01:58 UTC by Martin Nowak
Modified: 2020-08-19 23:15 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Martin Nowak 2014-06-01 01:58:58 UTC
void main()
{
    ulong a;
    asm { movdqu XMM1, a; }
}
Comment 1 Walter Bright 2020-08-12 02:45:53 UTC
The MOVDQU instruction is:

    F3 0F 6F /r MOVDQU xmm1, xmm2/m128

    Move unaligned packed integer values from xmm2/m128 to xmm1.
Comment 2 Walter Bright 2020-08-12 04:32:35 UTC
What's happening is in iasm.d the operand size is encoded into 5 bit flags, and there isn't room for another _128 bit, so the assembler just accepts any size.

The solution is to refactor the way operand sizes are encoded to accept more values.
Comment 3 Walter Bright 2020-08-14 08:36:48 UTC
Fix:

https://github.com/dlang/dmd/pull/11570
Comment 4 Dlang Bot 2020-08-15 04:31:20 UTC
@WalterBright updated dlang/dmd pull request #11570 "fix Issue 12832 - asm movdqu accepts wrong operand size" fixing this issue:

- fix Issue 12832 - asm movdqu accepts wrong operand size

https://github.com/dlang/dmd/pull/11570
Comment 5 Dlang Bot 2020-08-19 23:15:58 UTC
dlang/dmd pull request #11570 "fix Issue 12832 - asm movdqu accepts wrong operand size" was merged into master:

- 14e7cc917019d1016abaf23a59ebfe3deaed9ff5 by Walter Bright:
  fix Issue 12832 - asm movdqu accepts wrong operand size

https://github.com/dlang/dmd/pull/11570