Add OpSize16 bit, for instructions which need 0x66 prefix in 16-bit mode
authorCraig Topper <craig.topper@gmail.com>
Mon, 6 Jan 2014 06:02:58 +0000 (06:02 +0000)
committerCraig Topper <craig.topper@gmail.com>
Mon, 6 Jan 2014 06:02:58 +0000 (06:02 +0000)
commit7ceb54a2a168a60a10c8a49c2858db780ae5f970
tree45e8e50dc3c66c453dca667df5f58634be245eb7
parent13199b17f831cd5354e33d85bee6869ca7cb52d9
Add OpSize16 bit, for instructions which need 0x66 prefix in 16-bit mode

The 0x66 prefix toggles between 16-bit and 32-bit addressing mode.
So in 32-bit mode it is used to switch to 16-bit addressing mode for the
following instruction, while in 16-bit mode it's the other way round — it's
used to switch to 32-bit mode instead.

Thus, emit the 0x66 prefix byte for OpSize only in 32-bit (and 64-bit) mode,
and introduce a new OpSize16 bit which is used in 16-bit mode instead.

This is just the basic infrastructure for that change; a subsequent patch
will add the new OpSize16 bit to the 32-bit instructions that need it.

Patch from David Woodhouse.

llvm-svn: 198586
llvm/lib/Target/X86/MCTargetDesc/X86BaseInfo.h
llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
llvm/lib/Target/X86/X86InstrFormats.td
llvm/test/MC/X86/x86-16.s