2009-10-19 19:56:26 +00: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-19 21:21:39 +00:00
|
|
|
bool VerboseAsm;
|
2009-10-19 19:56:26 +00:00
|
|
|
public:
|
2010-04-04 05:04:31 +00:00
|
|
|
ARMInstPrinter(const MCAsmInfo &MAI, bool verboseAsm)
|
|
|
|
: MCInstPrinter(MAI), VerboseAsm(verboseAsm) {}
|
2009-10-19 19:56:26 +00:00
|
|
|
|
2010-04-04 05:04:31 +00:00
|
|
|
virtual void printInst(const MCInst *MI, raw_ostream &O);
|
2009-10-19 19:56:26 +00:00
|
|
|
|
|
|
|
// Autogenerated by tblgen.
|
2010-04-04 04:47:45 +00:00
|
|
|
void printInstruction(const MCInst *MI, raw_ostream &O);
|
2009-10-19 19:56:26 +00:00
|
|
|
static const char *getRegisterName(unsigned RegNo);
|
|
|
|
|
|
|
|
|
2010-04-04 04:47:45 +00:00
|
|
|
void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O,
|
2009-10-19 20:59:55 +00:00
|
|
|
const char *Modifier = 0);
|
2009-10-19 19:56:26 +00:00
|
|
|
|
2010-04-04 04:47:45 +00:00
|
|
|
void printSOImmOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printSOImm2PartOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2009-10-19 21:21:39 +00:00
|
|
|
|
2010-04-04 04:47:45 +00:00
|
|
|
void printSORegOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printAddrMode2Operand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printAddrMode2OffsetOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
|
|
|
void printAddrMode3Operand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printAddrMode3OffsetOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
|
|
|
void printAddrMode4Operand(const MCInst *MI, unsigned OpNum, raw_ostream &O,
|
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84546 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 22:09:23 +00:00
|
|
|
const char *Modifier = 0);
|
2010-04-04 04:47:45 +00:00
|
|
|
void printAddrMode5Operand(const MCInst *MI, unsigned OpNum, raw_ostream &O,
|
2009-10-20 06:15:28 +00:00
|
|
|
const char *Modifier = 0);
|
2010-04-04 04:47:45 +00:00
|
|
|
void printAddrMode6Operand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printAddrMode6OffsetOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
|
|
|
void printAddrModePCOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O,
|
2009-10-20 06:22:33 +00:00
|
|
|
const char *Modifier = 0);
|
2010-03-10 18:59:38 +00:00
|
|
|
|
2010-04-04 04:47:45 +00:00
|
|
|
void printBitfieldInvMaskImmOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2009-11-19 06:57:41 +00:00
|
|
|
|
2010-04-04 04:47:45 +00:00
|
|
|
void printThumbS4ImmOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printThumbITMask(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printThumbAddrModeRROperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2009-10-19 19:56:26 +00:00
|
|
|
void printThumbAddrModeRI5Operand(const MCInst *MI, unsigned OpNum,
|
2010-04-04 04:47:45 +00:00
|
|
|
raw_ostream &O, unsigned Scale);
|
|
|
|
void printThumbAddrModeS1Operand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
|
|
|
void printThumbAddrModeS2Operand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
|
|
|
void printThumbAddrModeS4Operand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
|
|
|
void printThumbAddrModeSPOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2009-10-19 19:56:26 +00:00
|
|
|
|
2010-04-04 04:47:45 +00:00
|
|
|
void printT2SOOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printT2AddrModeImm12Operand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
|
|
|
void printT2AddrModeImm8Operand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
|
|
|
void printT2AddrModeImm8s4Operand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
|
|
|
void printT2AddrModeImm8OffsetOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
|
|
|
void printT2AddrModeImm8s4OffsetOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
|
|
|
void printT2AddrModeSoRegOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2009-10-19 19:56:26 +00:00
|
|
|
|
2010-04-04 04:47:45 +00:00
|
|
|
void printCPSOptionOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printMSRMaskOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printNegZeroOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printPredicateOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printMandatoryPredicateOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
|
|
|
void printSBitModifierOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
|
|
|
void printRegisterList(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printCPInstOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O,
|
2009-10-19 22:33:05 +00:00
|
|
|
const char *Modifier);
|
2010-04-04 04:47:45 +00:00
|
|
|
void printJTBlockOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O) {}
|
|
|
|
void printJT2BlockOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O) {}
|
|
|
|
void printTBAddrMode(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printNoHashImmediate(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printVFPf32ImmOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printVFPf64ImmOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2010-04-16 22:40:20 +00:00
|
|
|
void printHex8ImmOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printHex16ImmOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printHex32ImmOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printHex64ImmOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2009-10-19 22:23:04 +00:00
|
|
|
|
2010-04-04 04:47:45 +00:00
|
|
|
void printPCLabel(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2009-10-19 22:23:04 +00:00
|
|
|
// FIXME: Implement.
|
2010-04-04 04:47:45 +00:00
|
|
|
void PrintSpecial(const MCInst *MI, raw_ostream &O, const char *Kind) {}
|
2009-10-19 19:56:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|