2012-02-18 12:03:15 +00:00
|
|
|
//===- ARMInstPrinter.h - Convert ARM MCInst to assembly syntax -*- C++ -*-===//
|
2009-10-19 19:56:26 +00:00
|
|
|
//
|
|
|
|
// 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-07 17:24:38 +00:00
|
|
|
#include "llvm/MC/MCSubtargetInfo.h"
|
2009-10-19 19:56:26 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
2011-03-21 04:13:46 +00:00
|
|
|
|
|
|
|
class MCOperand;
|
2010-09-17 21:25:10 +00:00
|
|
|
|
2009-10-19 19:56:26 +00:00
|
|
|
class ARMInstPrinter : public MCInstPrinter {
|
|
|
|
public:
|
2012-04-02 06:09:36 +00:00
|
|
|
ARMInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII,
|
|
|
|
const MCRegisterInfo &MRI, const MCSubtargetInfo &STI);
|
2009-10-19 19:56:26 +00:00
|
|
|
|
2011-09-15 23:38:46 +00:00
|
|
|
virtual void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot);
|
2011-06-02 02:34:55 +00:00
|
|
|
virtual void printRegName(raw_ostream &OS, unsigned RegNo) const;
|
2010-10-28 21:37:33 +00:00
|
|
|
|
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-11-03 01:11:15 +00:00
|
|
|
void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
|
2010-09-17 21:25:10 +00:00
|
|
|
|
2011-07-21 23:38:37 +00:00
|
|
|
void printSORegRegOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printSORegImmOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2011-03-31 23:26:08 +00:00
|
|
|
|
2011-09-19 22:21:13 +00:00
|
|
|
void printAddrModeTBB(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printAddrModeTBH(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2010-04-04 04:47:45 +00:00
|
|
|
void printAddrMode2Operand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2011-03-31 23:26:08 +00:00
|
|
|
void printAM2PostIndexOp(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printAM2PreOrOffsetIndexOp(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2010-04-04 04:47:45 +00:00
|
|
|
void printAddrMode2OffsetOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2011-04-04 17:18:19 +00:00
|
|
|
|
2010-04-04 04:47:45 +00:00
|
|
|
void printAddrMode3Operand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printAddrMode3OffsetOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2011-08-03 23:50:40 +00: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 15:48:21 +00:00
|
|
|
void printPostIdxRegOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2011-08-04 18:24:14 +00:00
|
|
|
void printPostIdxImm8s4Operand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2011-04-04 17:18:19 +00:00
|
|
|
|
2010-11-03 01:11:15 +00:00
|
|
|
void printLdStmModeOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printAddrMode5Operand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2010-04-04 04:47:45 +00:00
|
|
|
void printAddrMode6Operand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2011-03-24 21:04:58 +00:00
|
|
|
void printAddrMode7Operand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2010-04-04 04:47:45 +00:00
|
|
|
void printAddrMode6OffsetOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
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);
|
2010-08-12 20:46:17 +00:00
|
|
|
void printMemBOption(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2010-08-16 18:27:34 +00:00
|
|
|
void printShiftImmOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2011-07-20 21:40:26 +00:00
|
|
|
void printPKHLSLShiftImm(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printPKHASRShiftImm(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);
|
2011-08-17 21:51:27 +00:00
|
|
|
void printThumbSRImm(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2010-04-04 04:47:45 +00:00
|
|
|
void printThumbITMask(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printThumbAddrModeRROperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2010-12-14 03:36:38 +00: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 04:47:45 +00:00
|
|
|
void printThumbAddrModeSPOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2010-09-17 21:25:10 +00:00
|
|
|
|
2010-04-04 04:47:45 +00:00
|
|
|
void printT2SOOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2010-10-25 20:00:01 +00:00
|
|
|
void printAddrModeImm12Operand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2010-04-04 04:47:45 +00:00
|
|
|
void printT2AddrModeImm8Operand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
|
|
|
void printT2AddrModeImm8s4Operand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2011-09-09 18:37:27 +00:00
|
|
|
void printT2AddrModeImm0_1020s4Operand(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2010-04-04 04:47:45 +00: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-17 21:25:10 +00:00
|
|
|
|
2010-10-13 21:00:04 +00:00
|
|
|
void printSetendOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2011-02-14 13:09:44 +00:00
|
|
|
void printCPSIMod(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printCPSIFlag(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2010-04-04 04:47:45 +00: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-13 21:46:02 +00:00
|
|
|
void printPImmediate(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printCImmediate(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2011-10-12 17:34:41 +00:00
|
|
|
void printCoprocOptionImm(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2011-09-30 00:50:06 +00:00
|
|
|
void printFPImmOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2010-06-11 21:34:50 +00:00
|
|
|
void printNEONModImmOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2011-07-25 23:09:14 +00:00
|
|
|
void printImmPlusOneOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2011-07-26 21:28:43 +00:00
|
|
|
void printRotImmOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2009-10-19 22:23:04 +00:00
|
|
|
|
2010-09-17 21:25:10 +00:00
|
|
|
void printPCLabel(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2011-09-21 23:44:46 +00:00
|
|
|
void printT2LdrLabelOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2011-12-22 22:19:05 +00:00
|
|
|
void printFBits16(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printFBits32(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2011-10-07 23:56:00 +00:00
|
|
|
void printVectorIndex(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2011-10-18 23:02:30 +00:00
|
|
|
void printVectorListOne(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2012-03-06 22:01:44 +00:00
|
|
|
void printVectorListTwo(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
|
|
|
void printVectorListTwoSpaced(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2011-10-21 20:02:19 +00:00
|
|
|
void printVectorListThree(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2011-10-21 20:35:01 +00:00
|
|
|
void printVectorListFour(const MCInst *MI, unsigned OpNum, raw_ostream &O);
|
2011-11-30 01:09:44 +00:00
|
|
|
void printVectorListOneAllLanes(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2011-11-30 18:21:25 +00:00
|
|
|
void printVectorListTwoAllLanes(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2012-01-24 23:47:04 +00:00
|
|
|
void printVectorListThreeAllLanes(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2012-01-25 00:01:08 +00:00
|
|
|
void printVectorListFourAllLanes(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2011-12-21 00:38:54 +00:00
|
|
|
void printVectorListTwoSpacedAllLanes(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2012-01-24 23:47:04 +00:00
|
|
|
void printVectorListThreeSpacedAllLanes(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2012-01-25 00:01:08 +00:00
|
|
|
void printVectorListFourSpacedAllLanes(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2012-01-23 23:20:46 +00:00
|
|
|
void printVectorListThreeSpaced(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2012-01-24 00:43:17 +00:00
|
|
|
void printVectorListFourSpaced(const MCInst *MI, unsigned OpNum,
|
|
|
|
raw_ostream &O);
|
2009-10-19 19:56:26 +00:00
|
|
|
};
|
2010-09-17 21:25:10 +00:00
|
|
|
|
2010-11-14 19:40:38 +00:00
|
|
|
} // end namespace llvm
|
2009-10-19 19:56:26 +00:00
|
|
|
|
|
|
|
#endif
|