mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
add addrmode2 support, getting us up to:
_main: stm , mov r7, sp sub sp, sp, #4 mov r0, #0 str r0, [sp] ldr r0, LCPI1_0 bl _printf ldr r0, [sp] mov sp, r7 ldm , git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84543 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6f99776f6c
commit
084f87d445
@ -77,3 +77,37 @@ void ARMInstPrinter::printSOImmOperand(const MCInst *MI, unsigned OpNum) {
|
||||
assert(MO.isImm() && "Not a valid so_imm value!");
|
||||
printSOImm(O, MO.getImm(), VerboseAsm, &MAI);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ARMInstPrinter::printAddrMode2Operand(const MCInst *MI, unsigned Op) {
|
||||
const MCOperand &MO1 = MI->getOperand(Op);
|
||||
const MCOperand &MO2 = MI->getOperand(Op+1);
|
||||
const MCOperand &MO3 = MI->getOperand(Op+2);
|
||||
|
||||
if (!MO1.isReg()) { // FIXME: This is for CP entries, but isn't right.
|
||||
printOperand(MI, Op);
|
||||
return;
|
||||
}
|
||||
|
||||
O << "[" << getRegisterName(MO1.getReg());
|
||||
|
||||
if (!MO2.getReg()) {
|
||||
if (ARM_AM::getAM2Offset(MO3.getImm())) // Don't print +0.
|
||||
O << ", #"
|
||||
<< (char)ARM_AM::getAM2Op(MO3.getImm())
|
||||
<< ARM_AM::getAM2Offset(MO3.getImm());
|
||||
O << "]";
|
||||
return;
|
||||
}
|
||||
|
||||
O << ", "
|
||||
<< (char)ARM_AM::getAM2Op(MO3.getImm())
|
||||
<< getRegisterName(MO2.getReg());
|
||||
|
||||
if (unsigned ShImm = ARM_AM::getAM2Offset(MO3.getImm()))
|
||||
O << ", "
|
||||
<< ARM_AM::getShiftOpcStr(ARM_AM::getAM2ShiftOpc(MO3.getImm()))
|
||||
<< " #" << ShImm;
|
||||
O << "]";
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ public:
|
||||
|
||||
void printSOImm2PartOperand(const MCInst *MI, unsigned OpNum) {}
|
||||
void printSORegOperand(const MCInst *MI, unsigned OpNum) {}
|
||||
void printAddrMode2Operand(const MCInst *MI, unsigned OpNum) {}
|
||||
void printAddrMode2Operand(const MCInst *MI, unsigned OpNum);
|
||||
void printAddrMode2OffsetOperand(const MCInst *MI, unsigned OpNum) {}
|
||||
void printAddrMode3Operand(const MCInst *MI, unsigned OpNum) {}
|
||||
void printAddrMode3OffsetOperand(const MCInst *MI, unsigned OpNum) {}
|
||||
|
Loading…
Reference in New Issue
Block a user