forked from OSchip/llvm-project
Update size of inst correctly with segment override.
llvm-svn: 57414
This commit is contained in:
parent
de9812de43
commit
46a9c01fff
|
@ -420,6 +420,8 @@ void Emitter::emitInstruction(const MachineInstr &MI,
|
|||
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.
|
||||
|
|
|
@ -2668,6 +2668,16 @@ 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.
|
||||
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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue