Bug 15229 - objdump -d allows invalid avx2 vgatherdpd w/o vsib
Summary: objdump -d allows invalid avx2 vgatherdpd w/o vsib
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.24
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-05 09:49 UTC by Mikael Pettersson
Modified: 2022-11-24 08:05 UTC (History)
0 users

See Also:
Host:
Target: x86_64-*, i386-*
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mikael Pettersson 2013-03-05 09:49:31 UTC
I would expect an AVX2 VSIB-using instruction like VGATHERDPD to be flagged by objdump as invalid if its ModR/M is of a form that doesn't have a (V)SIB, but objdump instead disassembles it without complaint:

> cat vsib-test.s 
.text

# this should disassemble as "vgatherdpd %xmm2,(%rax,%xmm7,2),%xmm1"
.byte 0xc4,0xe2,0xe9,0x92,0x0c,0x78

# this should be flagged as invalid
.byte 0xc4,0xe2,0xe9,0x92,0x08
> gas/as-new -o vsib-test.o ../vsib-test.s
> binutils/objdump -d vsib-test.o

vsib-test.o:     file format elf64-x86-64


Disassembly of section .text:

0000000000000000 <.text>:
   0:   c4 e2 e9 92 0c 78       vgatherdpd %xmm2,(%rax,%xmm7,2),%xmm1
   6:   c4 e2 e9 92 08          vgatherdpd %xmm2,(%rax),%xmm1

That last instruction is invalid and will be rejected by gas if you try to assemble it.
Comment 1 Alan Modra 2022-11-24 08:05:34 UTC
Current output for the bad insn is
   6:	c4 e2 e9 92 08       	vgatherdpd %xmm2,(bad),%xmm1