2009-10-20 03:56:26 +08:00
|
|
|
//===-- ARMInstPrinter.h - Convert ARM MCInst to assembly syntax ----------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This class prints an ARM MCInst to a .s file.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef ARMINSTPRINTER_H
|
|
|
|
#define ARMINSTPRINTER_H
|
|
|
|
|
|
|
|
#include "llvm/MC/MCInstPrinter.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
class MCOperand;
|
|
|
|
|
|
|
|
class ARMInstPrinter : public MCInstPrinter {
|
2009-10-20 05:21:39 +08:00
|
|
|
bool VerboseAsm;
|
2009-10-20 03:56:26 +08:00
|
|
|
public:
|
2009-10-20 05:21:39 +08:00
|
|
|
ARMInstPrinter(raw_ostream &O, const MCAsmInfo &MAI, bool verboseAsm)
|
|
|
|
: MCInstPrinter(O, MAI), VerboseAsm(verboseAsm) {}
|
2009-10-20 03:56:26 +08:00
|
|
|
|
|
|
|
virtual void printInst(const MCInst *MI);
|
|
|
|
|
|
|
|
// Autogenerated by tblgen.
|
|
|
|
void printInstruction(const MCInst *MI);
|
|
|
|
static const char *getRegisterName(unsigned RegNo);
|
|
|
|
|
|
|
|
|
|
|
|
void printOperand(const MCInst *MI, unsigned OpNo,
|
2009-10-20 04:59:55 +08:00
|
|
|
const char *Modifier = 0);
|
2009-10-20 03:56:26 +08:00
|
|
|
|
2009-10-20 05:21:39 +08:00
|
|
|
void printSOImmOperand(const MCInst *MI, unsigned OpNum);
|
2009-10-20 08:40:56 +08:00
|
|
|
void printSOImm2PartOperand(const MCInst *MI, unsigned OpNum);
|
2009-10-20 05:21:39 +08:00
|
|
|
|
2009-10-20 08:40:56 +08:00
|
|
|
void printSORegOperand(const MCInst *MI, unsigned OpNum);
|
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 ,
llvm-svn: 84543
2009-10-20 05:57:05 +08:00
|
|
|
void printAddrMode2Operand(const MCInst *MI, unsigned OpNum);
|
2009-10-20 03:56:26 +08:00
|
|
|
void printAddrMode2OffsetOperand(const MCInst *MI, unsigned OpNum) {}
|
|
|
|
void printAddrMode3Operand(const MCInst *MI, unsigned OpNum) {}
|
|
|
|
void printAddrMode3OffsetOperand(const MCInst *MI, unsigned OpNum) {}
|
|
|
|
void printAddrMode4Operand(const MCInst *MI, unsigned OpNum,
|
add register list and hacked up addrmode #4 support, we now get this:
_main:
stmsp! sp!, {r7, lr}
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
ldmsp! sp!, {r7, pc}
Note the unhappy ldm/stm because of modifiers being ignored.
llvm-svn: 84546
2009-10-20 06:09:23 +08:00
|
|
|
const char *Modifier = 0);
|
2009-10-20 03:56:26 +08:00
|
|
|
void printAddrMode5Operand(const MCInst *MI, unsigned OpNum,
|
|
|
|
const char *Modifier = 0) {}
|
|
|
|
void printAddrMode6Operand(const MCInst *MI, unsigned OpNum) {}
|
|
|
|
void printAddrModePCOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
const char *Modifier = 0) {}
|
|
|
|
void printBitfieldInvMaskImmOperand (const MCInst *MI, unsigned OpNum) {}
|
|
|
|
|
|
|
|
void printThumbITMask(const MCInst *MI, unsigned OpNum) {}
|
|
|
|
void printThumbAddrModeRROperand(const MCInst *MI, unsigned OpNum) {}
|
|
|
|
void printThumbAddrModeRI5Operand(const MCInst *MI, unsigned OpNum,
|
|
|
|
unsigned Scale) {}
|
|
|
|
void printThumbAddrModeS1Operand(const MCInst *MI, unsigned OpNum) {}
|
|
|
|
void printThumbAddrModeS2Operand(const MCInst *MI, unsigned OpNum) {}
|
|
|
|
void printThumbAddrModeS4Operand(const MCInst *MI, unsigned OpNum) {}
|
|
|
|
void printThumbAddrModeSPOperand(const MCInst *MI, unsigned OpNum) {}
|
|
|
|
|
|
|
|
void printT2SOOperand(const MCInst *MI, unsigned OpNum) {}
|
|
|
|
void printT2AddrModeImm12Operand(const MCInst *MI, unsigned OpNum) {}
|
|
|
|
void printT2AddrModeImm8Operand(const MCInst *MI, unsigned OpNum) {}
|
|
|
|
void printT2AddrModeImm8s4Operand(const MCInst *MI, unsigned OpNum) {}
|
|
|
|
void printT2AddrModeImm8OffsetOperand(const MCInst *MI, unsigned OpNum) {}
|
|
|
|
void printT2AddrModeSoRegOperand(const MCInst *MI, unsigned OpNum) {}
|
|
|
|
|
2009-10-20 08:42:49 +08:00
|
|
|
void printPredicateOperand(const MCInst *MI, unsigned OpNum);
|
2009-10-20 03:56:26 +08:00
|
|
|
void printSBitModifierOperand(const MCInst *MI, unsigned OpNum) {}
|
add register list and hacked up addrmode #4 support, we now get this:
_main:
stmsp! sp!, {r7, lr}
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
ldmsp! sp!, {r7, pc}
Note the unhappy ldm/stm because of modifiers being ignored.
llvm-svn: 84546
2009-10-20 06:09:23 +08:00
|
|
|
void printRegisterList(const MCInst *MI, unsigned OpNum);
|
2009-10-20 03:56:26 +08:00
|
|
|
void printCPInstOperand(const MCInst *MI, unsigned OpNum,
|
2009-10-20 06:33:05 +08:00
|
|
|
const char *Modifier);
|
2009-10-20 03:56:26 +08:00
|
|
|
void printJTBlockOperand(const MCInst *MI, unsigned OpNum) {}
|
|
|
|
void printJT2BlockOperand(const MCInst *MI, unsigned OpNum) {}
|
|
|
|
void printTBAddrMode(const MCInst *MI, unsigned OpNum) {}
|
|
|
|
void printNoHashImmediate(const MCInst *MI, unsigned OpNum) {}
|
2009-10-20 06:23:04 +08:00
|
|
|
|
|
|
|
void printPCLabel(const MCInst *MI, unsigned OpNum);
|
|
|
|
// FIXME: Implement.
|
2009-10-20 03:56:26 +08:00
|
|
|
void PrintSpecial(const MCInst *MI, const char *Kind) {}
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|