[llvm-commits] [llvm] r57414 - in /llvm/trunk/lib/Target/X86: X86CodeEmitter.cpp X86InstrInfo.cpp
Anton Korobeynikov
asl at math.spbu.ru
Sun Oct 12 03:30:13 PDT 2008
Author: asl
Date: Sun Oct 12 05:30:11 2008
New Revision: 57414
URL: http://llvm.org/viewvc/llvm-project?rev=57414&view=rev
Log:
Update size of inst correctly with segment override.
Modified:
llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp
llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
Modified: llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp?rev=57414&r1=57413&r2=57414&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp Sun Oct 12 05:30:11 2008
@@ -420,6 +420,8 @@
case X86II::GS:
MCE.emitByte(0x65);
break;
+ default: assert(0 && "Invalid segment!");
+ case 0: break; // No segment override!
}
// Emit the repeat opcode prefix as needed.
Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=57414&r1=57413&r2=57414&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Sun Oct 12 05:30:11 2008
@@ -2668,6 +2668,16 @@
// Emit the lock opcode prefix as needed.
if (Desc->TSFlags & X86II::LOCK) ++FinalSize;
+ // Emit segment overrid opcode prefix as needed.
+ switch (Desc->TSFlags & X86II::SegOvrMask) {
+ case X86II::FS:
+ case X86II::GS:
+ ++FinalSize;
+ break;
+ default: assert(0 && "Invalid segment!");
+ case 0: break; // No segment override!
+ }
+
// Emit the repeat opcode prefix as needed.
if ((Desc->TSFlags & X86II::Op0Mask) == X86II::REP) ++FinalSize;
More information about the llvm-commits
mailing list