mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
lower ARM::MOVi32imm properly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84583 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
292df8eb1f
commit
161dcbf799
@ -1413,9 +1413,43 @@ void ARMAsmPrinter::printInstructionThroughMCStreamer(const MachineInstr *MI) {
|
||||
}
|
||||
return;
|
||||
}
|
||||
// FIXME: Also MOVi32imm.
|
||||
case ARM::MOVi32imm: { // FIXME: Remove asmstring from td file.
|
||||
// This is a hack that lowers as a two instruction sequence.
|
||||
unsigned DstReg = MI->getOperand(0).getReg();
|
||||
unsigned ImmVal = (unsigned)MI->getOperand(1).getImm();
|
||||
|
||||
{
|
||||
MCInst TmpInst;
|
||||
TmpInst.setOpcode(ARM::MOVi16);
|
||||
TmpInst.addOperand(MCOperand::CreateReg(DstReg)); // dstreg
|
||||
TmpInst.addOperand(MCOperand::CreateImm(ImmVal & 65535)); // lower16(imm)
|
||||
|
||||
// Predicate.
|
||||
TmpInst.addOperand(MCOperand::CreateImm(MI->getOperand(2).getImm()));
|
||||
TmpInst.addOperand(MCOperand::CreateReg(MI->getOperand(3).getReg()));
|
||||
|
||||
printMCInst(&TmpInst);
|
||||
O << '\n';
|
||||
}
|
||||
|
||||
{
|
||||
MCInst TmpInst;
|
||||
TmpInst.setOpcode(ARM::MOVTi16);
|
||||
TmpInst.addOperand(MCOperand::CreateReg(DstReg)); // dstreg
|
||||
TmpInst.addOperand(MCOperand::CreateReg(DstReg)); // srcreg
|
||||
TmpInst.addOperand(MCOperand::CreateImm(ImmVal >> 16)); // upper16(imm)
|
||||
|
||||
// Predicate.
|
||||
TmpInst.addOperand(MCOperand::CreateImm(MI->getOperand(2).getImm()));
|
||||
TmpInst.addOperand(MCOperand::CreateReg(MI->getOperand(3).getReg()));
|
||||
|
||||
printMCInst(&TmpInst);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// FIXME: Handle t2MOVi32imm also.
|
||||
}
|
||||
|
||||
MCInst TmpInst;
|
||||
|
Loading…
Reference in New Issue
Block a user