OSDN Git Service

[X86] Ignore bits 2:0 of the modrm byte when disassembling lfence, mfence, and sfence.
authorCraig Topper <craig.topper@intel.com>
Sat, 20 Jun 2020 05:18:53 +0000 (22:18 -0700)
committerCraig Topper <craig.topper@intel.com>
Sat, 20 Jun 2020 05:24:24 +0000 (22:24 -0700)
commit0dda5e4ce2924e59a19f1e466f34a92c0c1638f7
treec1de0e3db5e8d86c6061e5e88b57c053b0d86bcc
parent2a4317bfb319e3ef26bf690e35b00be176bcd37f
[X86] Ignore bits 2:0 of the modrm byte when disassembling lfence, mfence, and sfence.

These are documented as using modrm byte of 0xe8, 0xf0, and 0xf8
respectively. But hardware ignore bits 2:0. So 0xe9-0xef is treated
the same as 0xe8. Similar for the other two.

Fixing this required adding 8 new formats to the X86 instructions
to convey this information. Could have gotten away with 3, but
adding all 8 made for a more logical conversion from format to
modrm encoding.

I renumbered the format encodings to keep the register modrm
formats grouped together.
llvm/lib/Target/X86/MCTargetDesc/X86BaseInfo.h
llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
llvm/lib/Target/X86/X86InstrFormats.td
llvm/lib/Target/X86/X86InstrSSE.td
llvm/test/MC/Disassembler/X86/x86-32.txt
llvm/tools/llvm-exegesis/lib/X86/Target.cpp
llvm/utils/TableGen/X86RecognizableInstr.cpp
llvm/utils/TableGen/X86RecognizableInstr.h