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 {
|
2011-03-21 12:13:46 +08:00
|
|
|
|
|
|
|
class MCOperand;
|
|
|
|
class TargetMachine;
|
2010-09-18 05:25:10 +08:00
|
|
|
|
2009-10-20 03:56:26 +08:00
|
|
|
class ARMInstPrinter : public MCInstPrinter {
|
|
|
|
public:
|
2011-03-31 08:39:16 +08:00
|
|
|
ARMInstPrinter(TargetMachine &TM, const MCAsmInfo &MAI)
|
|
|
|
: MCInstPrinter(MAI) {}
|
2009-10-20 03:56:26 +08:00
|
|
|
|
2010-04-04 13:04:31 +08:00
|
|
|
virtual void printInst(const MCInst *MI, raw_ostream &O);
|
2010-10-29 05:37:33 +08:00
|
|
|
virtual StringRef getOpcodeName(unsigned Opcode) const;
|
2011-03-06 02:43:32 +08:00
|
|
|
virtual StringRef getRegName(unsigned RegNo) const;
|
2010-10-29 05:37:33 +08:00
|
|
|
|
|
|
|
static const char *getInstructionName(unsigned Opcode);
|
2010-09-18 05:25:10 +08:00
|
|
|
|
2009-10-20 03:56:26 +08:00
|
|
|
// Autogenerated by tblgen.
|
2010-04-04 12:47:45 +08:00
|
|
|
void printInstruction(const MCInst *MI, raw_ostream &O);
|
2009-10-20 03:56:26 +08:00
|
|
|
static const char *getRegisterName(unsigned RegNo);
|
|
|
|
|
|
|
|
|
2010-11-03 09:11:15 +08:00
|
|
|
void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
|
2010-09-18 05:25:10 +08:00
|
|
|
|
2010-04-04 12:47:45 +08:00
|
|
|
void printSOImmOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2010-09-18 05:25:10 +08:00
|
|
|
|
2010-04-04 12:47:45 +08:00
|
|
|
void printSORegOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2011-04-01 07:26:08 +08:00
|
|
|
|
2010-04-04 12:47:45 +08:00
|
|
|
void printAddrMode2Operand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2011-04-01 07:26:08 +08:00
|
|
|
void printAM2PostIndexOp(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printAM2PreOrOffsetIndexOp(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2010-04-04 12:47:45 +08:00
|
|
|
void printAddrMode2OffsetOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2011-04-05 01:18:19 +08:00
|
|
|
|
2010-04-04 12:47:45 +08:00
|
|
|
void printAddrMode3Operand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2011-04-05 01:18:19 +08:00
|
|
|
void printAM3PostIndexOp(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printAM3PreOrOffsetIndexOp(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2010-04-04 12:47:45 +08:00
|
|
|
void printAddrMode3OffsetOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2011-04-05 01:18:19 +08:00
|
|
|
|
2010-11-03 09:11:15 +08:00
|
|
|
void printLdStmModeOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printAddrMode5Operand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2010-04-04 12:47:45 +08:00
|
|
|
void printAddrMode6Operand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2011-03-25 05:04:58 +08:00
|
|
|
void printAddrMode7Operand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2010-04-04 12:47:45 +08:00
|
|
|
void printAddrMode6OffsetOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2010-03-11 02:59:38 +08:00
|
|
|
|
2010-04-04 12:47:45 +08:00
|
|
|
void printBitfieldInvMaskImmOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2010-08-13 04:46:17 +08:00
|
|
|
void printMemBOption(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2010-08-17 02:27:34 +08:00
|
|
|
void printShiftImmOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2009-11-19 14:57:41 +08:00
|
|
|
|
2010-04-04 12:47:45 +08: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);
|
2010-12-14 11:36:38 +08:00
|
|
|
void printThumbAddrModeImm5SOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O, unsigned Scale);
|
|
|
|
void printThumbAddrModeImm5S1Operand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
|
|
|
void printThumbAddrModeImm5S2Operand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
|
|
|
void printThumbAddrModeImm5S4Operand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2010-04-04 12:47:45 +08:00
|
|
|
void printThumbAddrModeSPOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2010-09-18 05:25:10 +08:00
|
|
|
|
2010-04-04 12:47:45 +08:00
|
|
|
void printT2SOOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2010-10-26 04:00:01 +08:00
|
|
|
void printAddrModeImm12Operand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2010-04-04 12:47:45 +08:00
|
|
|
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);
|
2010-09-18 05:25:10 +08:00
|
|
|
|
2010-10-14 05:00:04 +08:00
|
|
|
void printSetendOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2011-02-14 21:09:44 +08:00
|
|
|
void printCPSIMod(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printCPSIFlag(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2010-04-04 12:47:45 +08:00
|
|
|
void printMSRMaskOperand(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 printNoHashImmediate(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2011-01-14 05:46:02 +08:00
|
|
|
void printPImmediate(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printCImmediate(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2010-04-04 12:47:45 +08:00
|
|
|
void printVFPf32ImmOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printVFPf64ImmOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2010-06-12 05:34:50 +08:00
|
|
|
void printNEONModImmOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2009-10-20 06:23:04 +08:00
|
|
|
|
2010-09-18 05:25:10 +08:00
|
|
|
void printPCLabel(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2009-10-20 03:56:26 +08:00
|
|
|
};
|
2010-09-18 05:25:10 +08:00
|
|
|
|
2010-11-15 03:40:38 +08:00
|
|
|
} // end namespace llvm
|
2009-10-20 03:56:26 +08:00
|
|
|
|
|
|
|
#endif
|