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"
|
2011-09-08 01:24:38 +08:00
|
|
|
#include "llvm/MC/MCSubtargetInfo.h"
|
2009-10-20 03:56:26 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
2011-03-21 12:13:46 +08:00
|
|
|
|
|
|
|
class MCOperand;
|
2010-09-18 05:25:10 +08:00
|
|
|
|
2009-10-20 03:56:26 +08:00
|
|
|
class ARMInstPrinter : public MCInstPrinter {
|
|
|
|
public:
|
2011-09-08 01:24:38 +08:00
|
|
|
ARMInstPrinter(const MCAsmInfo &MAI, const MCSubtargetInfo &STI);
|
2009-10-20 03:56:26 +08:00
|
|
|
|
2011-09-16 07:38:46 +08:00
|
|
|
virtual void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot);
|
2010-10-29 05:37:33 +08:00
|
|
|
virtual StringRef getOpcodeName(unsigned Opcode) const;
|
2011-06-02 10:34:55 +08:00
|
|
|
virtual void printRegName(raw_ostream &OS, 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
|
|
|
|
2011-07-22 07:38:37 +08:00
|
|
|
void printSORegRegOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printSORegImmOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2011-04-01 07:26:08 +08:00
|
|
|
|
2011-09-20 06:21:13 +08:00
|
|
|
void printAddrModeTBB(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printAddrModeTBH(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
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);
|
|
|
|
void printAddrMode3OffsetOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2011-08-04 07:50:40 +08:00
|
|
|
void printAM3PostIndexOp(const MCInst *MI, unsigned Op, raw_ostream &O);
|
|
|
|
void printAM3PreOrOffsetIndexOp(const MCInst *MI, unsigned Op,raw_ostream &O);
|
|
|
|
void printPostIdxImm8Operand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2011-08-05 23:48:21 +08:00
|
|
|
void printPostIdxRegOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2011-08-05 02:24:14 +08:00
|
|
|
void printPostIdxImm8s4Operand(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);
|
2011-07-21 05:40:26 +08:00
|
|
|
void printPKHLSLShiftImm(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printPKHASRShiftImm(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);
|
2011-08-18 05:51:27 +08:00
|
|
|
void printThumbSRImm(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2010-04-04 12:47:45 +08:00
|
|
|
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);
|
2011-09-10 02:37:27 +08:00
|
|
|
void printT2AddrModeImm0_1020s4Operand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2010-04-04 12:47:45 +08:00
|
|
|
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);
|
2011-10-13 01:34:41 +08:00
|
|
|
void printCoprocOptionImm(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2011-09-30 08:50:06 +08:00
|
|
|
void printFPImmOperand(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);
|
2011-07-26 07:09:14 +08:00
|
|
|
void printImmPlusOneOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2011-07-27 05:28:43 +08:00
|
|
|
void printRotImmOperand(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);
|
2011-09-22 07:44:46 +08:00
|
|
|
void printT2LdrLabelOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2011-10-08 07:56:00 +08:00
|
|
|
void printVectorIndex(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2011-10-19 07:02:30 +08:00
|
|
|
void printVectorListOne(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2011-10-22 02:54:25 +08:00
|
|
|
void printVectorListTwo(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2011-10-22 04:02:19 +08:00
|
|
|
void printVectorListThree(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2011-10-22 04:35:01 +08:00
|
|
|
void printVectorListFour(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2011-11-30 09:09:44 +08:00
|
|
|
void printVectorListOneAllLanes(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2011-12-01 02:21:25 +08:00
|
|
|
void printVectorListTwoAllLanes(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2011-12-15 03:35:22 +08:00
|
|
|
void printVectorListTwoSpaced(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
|