Bug 18737 - Wrong memory operand size for x86 GATHER/SCATTER instructions
Summary: Wrong memory operand size for x86 GATHER/SCATTER instructions
Status: ASSIGNED
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (show other bugs)
Version: 2.24
: P2 normal
Target Milestone: ---
Assignee: Alexander Fomin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-29 20:13 UTC by Michael Rolle
Modified: 2015-09-01 10:00 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Rolle 2015-07-29 20:13:01 UTC
gather/scatter instructions require a memory size to match the vector register size.  However, the memory size is actually the element size, according to Intel doc.  as will accept memory operand without a size specifier.

vgatherqps ymm30{k1},DWORD PTR [rcx+zmm31*4+0x400]  # Error: operand size mismatch for `vgatherqps'
vgatherqps ymm30{k1},YMMWORD PTR [rcx+zmm31*4+0x400]
vgatherqps ymm30{k1},[rcx+zmm31*4+0x400]
vscatterqps DWORD PTR [rcx+zmm31*4+0x400]{k1},ymm30   # Error: operand size mismatch for `vscatterqps'
vscatterqps YMMWORD PTR [rcx+zmm31*4+0x400]{k1},ymm30
vscatterqps [rcx+zmm31*4+0x400]{k1},ymm30

If possible, why don't you accept both the vector size and the element size.  Otherwise, please change the vector size to the element size.

Does not produce incorrect code, but it is serious because it will not assemble a valid instruction according to the Intel doc.
Comment 1 Alexander Fomin 2015-09-01 10:00:07 UTC
> However, the memory size is actually the element size, according to Intel doc
Not sure what exactly you're talking about. We were not able to find anything related to a memory size directive as for Intel SDM 319433-023, August 2015.
Please provide a reference to Intel SDM. Thank you.