Bug 12832 – asm movdqu accepts wrong operand size

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
All
Creation time
2014-06-01T01:58:58Z
Last change time
2020-08-19T23:15:58Z
Keywords
accepts-invalid, iasm, pull
Assigned to
No Owner
Creator
Martin Nowak

Comments

Comment #0 by code — 2014-06-01T01:58:58Z
void main() { ulong a; asm { movdqu XMM1, a; } }
Comment #1 by bugzilla — 2020-08-12T02:45:53Z
The MOVDQU instruction is: F3 0F 6F /r MOVDQU xmm1, xmm2/m128 Move unaligned packed integer values from xmm2/m128 to xmm1.
Comment #2 by bugzilla — 2020-08-12T04:32:35Z
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 by bugzilla — 2020-08-14T08:36:48Z
Comment #4 by dlang-bot — 2020-08-15T04:31:20Z
@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 by dlang-bot — 2020-08-19T23:15:58Z
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