[X86] Teach the disassembler to use %eiz/%riz instead of NoRegister when the SIB...
authorCraig Topper <craig.topper@intel.com>
Wed, 27 Jun 2018 19:03:36 +0000 (19:03 +0000)
committerCraig Topper <craig.topper@intel.com>
Wed, 27 Jun 2018 19:03:36 +0000 (19:03 +0000)
commit6bea2c7f9b2530a1ce247139d184954136dd16ff
tree53eecd61f59af6fed6b50e7d7b8d6e4bd2cbf9f4
parentbdeb880d14dfcc54b990cb32e0d0804bd24f70cf
[X86] Teach the disassembler to use %eiz/%riz instead of NoRegister when the SIB byte is present, but doesn't encode an index register and there was another shorter encoding that would achieve the same result.

The %eiz/%riz are dummy registers that force the encoder to emit a SIB byte when it normally wouldn't. By emitting them in the disassembly output we ensure that assembling the disassembler output would also produce a SIB byte.

This should match the behavior of objdump from binutils.

llvm-svn: 335768
llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp
llvm/test/MC/Disassembler/X86/x86-32.txt
llvm/test/MC/Disassembler/X86/x86-64.txt