diff options
author | Bill Wendling <isanbard@gmail.com> | 2009-05-28 23:40:46 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2009-05-28 23:40:46 +0000 |
commit | 2e09bd3d34a24454d774e5f3ee6865de0914205a (patch) | |
tree | 02fc695847ecb19cac977e644f8bc8b0e823ac15 /llvm/lib/Target/X86/X86InstrInfo.cpp | |
parent | d6ab8744dc68e7dec176a5899e1d68a4a8de91f0 (diff) | |
download | bcm5719-llvm-2e09bd3d34a24454d774e5f3ee6865de0914205a.tar.gz bcm5719-llvm-2e09bd3d34a24454d774e5f3ee6865de0914205a.zip |
The MONITOR and MWAIT instructions have insufficient information for
decoding. Essentially, they both map to the same column in the "opcode
extensions for one- and two-byte opcodes" table in the x86 manual. The RawFrm
complicates decoding this.
Instead, use opcode 0x01, prefix 0x01, and form MRM1r. Then have the code
emitter special case these, a la [SML]FENCE.
llvm-svn: 72556
Diffstat (limited to 'llvm/lib/Target/X86/X86InstrInfo.cpp')
-rw-r--r-- | llvm/lib/Target/X86/X86InstrInfo.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/llvm/lib/Target/X86/X86InstrInfo.cpp b/llvm/lib/Target/X86/X86InstrInfo.cpp index 5fca9c71c9d..2cd3733f0fb 100644 --- a/llvm/lib/Target/X86/X86InstrInfo.cpp +++ b/llvm/lib/Target/X86/X86InstrInfo.cpp @@ -2885,7 +2885,7 @@ static unsigned GetInstSizeWithDesc(const MachineInstr &MI, // Emit the lock opcode prefix as needed. if (Desc->TSFlags & X86II::LOCK) ++FinalSize; - // Emit segment overrid opcode prefix as needed. + // Emit segment override opcode prefix as needed. switch (Desc->TSFlags & X86II::SegOvrMask) { case X86II::FS: case X86II::GS: @@ -2943,7 +2943,7 @@ static unsigned GetInstSizeWithDesc(const MachineInstr &MI, case X86II::T8: // 0F 38 ++FinalSize; break; - case X86II::TA: // 0F 3A + case X86II::TA: // 0F 3A ++FinalSize; break; } @@ -3087,11 +3087,15 @@ static unsigned GetInstSizeWithDesc(const MachineInstr &MI, case X86II::MRM4r: case X86II::MRM5r: case X86II::MRM6r: case X86II::MRM7r: ++FinalSize; - // Special handling of lfence and mfence. if (Desc->getOpcode() == X86::LFENCE || - Desc->getOpcode() == X86::MFENCE) + Desc->getOpcode() == X86::MFENCE) { + // Special handling of lfence and mfence; FinalSize += sizeRegModRMByte(); - else { + } else if (Desc->getOpcode() == X86::MONITOR || + Desc->getOpcode() == X86::MWAIT) { + // Special handling of monitor and mwait. + FinalSize += sizeRegModRMByte() + 1; // +1 for the opcode. + } else { ++CurOp; FinalSize += sizeRegModRMByte(); } |