mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-10 02:36:06 +00:00
Update size of inst correctly with segment override.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57414 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b5cf048fdf
commit
d21a6305ea
@ -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…
x
Reference in New Issue
Block a user