mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-19 04:29:21 +00:00
Don't forget to update the current operand when getting the size of an instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50007 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bd3401fa98
commit
546e36a2c1
@ -2670,6 +2670,7 @@ static unsigned GetInstSizeWithDesc(const MachineInstr &MI,
|
|||||||
|
|
||||||
case X86II::AddRegFrm:
|
case X86II::AddRegFrm:
|
||||||
++FinalSize;
|
++FinalSize;
|
||||||
|
++CurOp;
|
||||||
|
|
||||||
if (CurOp != NumOps) {
|
if (CurOp != NumOps) {
|
||||||
const MachineOperand &MO1 = MI.getOperand(CurOp++);
|
const MachineOperand &MO1 = MI.getOperand(CurOp++);
|
||||||
@ -2696,16 +2697,20 @@ static unsigned GetInstSizeWithDesc(const MachineInstr &MI,
|
|||||||
++FinalSize;
|
++FinalSize;
|
||||||
FinalSize += sizeRegModRMByte();
|
FinalSize += sizeRegModRMByte();
|
||||||
CurOp += 2;
|
CurOp += 2;
|
||||||
if (CurOp != NumOps)
|
if (CurOp != NumOps) {
|
||||||
|
++CurOp;
|
||||||
FinalSize += sizeConstant(X86InstrInfo::sizeOfImm(Desc));
|
FinalSize += sizeConstant(X86InstrInfo::sizeOfImm(Desc));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case X86II::MRMDestMem: {
|
case X86II::MRMDestMem: {
|
||||||
++FinalSize;
|
++FinalSize;
|
||||||
FinalSize += getMemModRMByteSize(MI, CurOp, IsPIC, Is64BitMode);
|
FinalSize += getMemModRMByteSize(MI, CurOp, IsPIC, Is64BitMode);
|
||||||
CurOp += 5;
|
CurOp += 5;
|
||||||
if (CurOp != NumOps)
|
if (CurOp != NumOps) {
|
||||||
|
++CurOp;
|
||||||
FinalSize += sizeConstant(X86InstrInfo::sizeOfImm(Desc));
|
FinalSize += sizeConstant(X86InstrInfo::sizeOfImm(Desc));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2713,8 +2718,10 @@ static unsigned GetInstSizeWithDesc(const MachineInstr &MI,
|
|||||||
++FinalSize;
|
++FinalSize;
|
||||||
FinalSize += sizeRegModRMByte();
|
FinalSize += sizeRegModRMByte();
|
||||||
CurOp += 2;
|
CurOp += 2;
|
||||||
if (CurOp != NumOps)
|
if (CurOp != NumOps) {
|
||||||
|
++CurOp;
|
||||||
FinalSize += sizeConstant(X86InstrInfo::sizeOfImm(Desc));
|
FinalSize += sizeConstant(X86InstrInfo::sizeOfImm(Desc));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case X86II::MRMSrcMem: {
|
case X86II::MRMSrcMem: {
|
||||||
@ -2722,8 +2729,10 @@ static unsigned GetInstSizeWithDesc(const MachineInstr &MI,
|
|||||||
++FinalSize;
|
++FinalSize;
|
||||||
FinalSize += getMemModRMByteSize(MI, CurOp+1, IsPIC, Is64BitMode);
|
FinalSize += getMemModRMByteSize(MI, CurOp+1, IsPIC, Is64BitMode);
|
||||||
CurOp += 5;
|
CurOp += 5;
|
||||||
if (CurOp != NumOps)
|
if (CurOp != NumOps) {
|
||||||
|
++CurOp;
|
||||||
FinalSize += sizeConstant(X86InstrInfo::sizeOfImm(Desc));
|
FinalSize += sizeConstant(X86InstrInfo::sizeOfImm(Desc));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2732,6 +2741,7 @@ static unsigned GetInstSizeWithDesc(const MachineInstr &MI,
|
|||||||
case X86II::MRM4r: case X86II::MRM5r:
|
case X86II::MRM4r: case X86II::MRM5r:
|
||||||
case X86II::MRM6r: case X86II::MRM7r:
|
case X86II::MRM6r: case X86II::MRM7r:
|
||||||
++FinalSize;
|
++FinalSize;
|
||||||
|
++CurOp;
|
||||||
FinalSize += sizeRegModRMByte();
|
FinalSize += sizeRegModRMByte();
|
||||||
|
|
||||||
if (CurOp != NumOps) {
|
if (CurOp != NumOps) {
|
||||||
|
Loading…
Reference in New Issue
Block a user