forked from OSchip/llvm-project
Copy segment register when optimizing to MOV8ao8/MOV16ao16/MOV32ao32.
llvm-svn: 199365
This commit is contained in:
parent
35da3d190a
commit
a9d2c67cc2
|
@ -323,15 +323,16 @@ static void SimplifyShortMoveForm(X86AsmPrinter &Printer, MCInst &Inst,
|
||||||
if (Absolute &&
|
if (Absolute &&
|
||||||
(Inst.getOperand(AddrBase + 0).getReg() != 0 ||
|
(Inst.getOperand(AddrBase + 0).getReg() != 0 ||
|
||||||
Inst.getOperand(AddrBase + 2).getReg() != 0 ||
|
Inst.getOperand(AddrBase + 2).getReg() != 0 ||
|
||||||
Inst.getOperand(AddrBase + 4).getReg() != 0 ||
|
|
||||||
Inst.getOperand(AddrBase + 1).getImm() != 1))
|
Inst.getOperand(AddrBase + 1).getImm() != 1))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// If so, rewrite the instruction.
|
// If so, rewrite the instruction.
|
||||||
MCOperand Saved = Inst.getOperand(AddrOp);
|
MCOperand Saved = Inst.getOperand(AddrOp);
|
||||||
|
MCOperand Seg = Inst.getOperand(AddrBase + 4);
|
||||||
Inst = MCInst();
|
Inst = MCInst();
|
||||||
Inst.setOpcode(Opcode);
|
Inst.setOpcode(Opcode);
|
||||||
Inst.addOperand(Saved);
|
Inst.addOperand(Saved);
|
||||||
|
Inst.addOperand(Seg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned getRetOpcode(const X86Subtarget &Subtarget)
|
static unsigned getRetOpcode(const X86Subtarget &Subtarget)
|
||||||
|
|
Loading…
Reference in New Issue