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)
commit30be10a06e1e6735a91826df63e1d0456cee7da2
treea792453a9dbb864307c2500b2a59acb83e546e0f
parentb87d142ba189d404b7eb60a2f81d27836e093b06
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198586 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/MCTargetDesc/X86BaseInfo.h
lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
lib/Target/X86/X86InstrFormats.td
test/MC/X86/x86-16.s