Skip to content

[x86 disassembler] L bit in VEX prefix is not ignored properly #11048

Closed
@llvmbot

Description

@llvmbot
Bugzilla Link 10676
Resolution FIXED
Resolved on Nov 07, 2018 00:17
Version trunk
OS All
Blocks llvm/llvm-bugzilla-archive#10988
Reporter LLVM Bugzilla Contributor
CC @topperc

Extended Description

According to the "Intel® 64 and IA-32 Architectures Software Developer’s Manual
Volume 2 (2A & 2B): Instruction Set Reference, A-Z", p. 3-42:

ADDSD—Add Scalar Double-Precision Floating-Point Values
VEX.NDS.LIG.F2.0F.WIG 58 /r

"LIG" in the above spec is defined on p. 3-5:
If VEX.LIG is present in the opcode column: The VEX.L value is ignored.

With llvm-mc trunk revision 135913:
$ echo '0xc5 0xf3 0x58 0xc0'| ./llvm-mc -disassemble -triple="x86_64"
vaddsd %xmm0, %xmm1, %xmm0
$ echo '0xc5 0xf7 0x58 0xc0'| ./llvm-mc -disassemble -triple="x86_64"
vaddps %ymm0, %ymm1, %ymm0

Setting the 'L' bit changed the disassembly from vaddsd to vaddps, but it shouldn't have affected anything according to the docs.

Using the 3-byte VEX prefix has the same behavior:
$ echo '0xc4 0xc1 0x73 0x58 0xc0'| ./llvm-mc -disassemble -triple="x86_64"
vaddsd %xmm8, %xmm1, %xmm0
$ echo '0xc4 0xc1 0x77 0x58 0xc0'| ./llvm-mc -disassemble -triple="x86_64"
vaddps %ymm8, %ymm1, %ymm0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions