2012-02-18 20:03:15 +08:00
|
|
|
//===- ARMInstPrinter.h - Convert ARM MCInst to assembly syntax -*- C++ -*-===//
|
2009-10-20 03:56:26 +08: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.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-14 00:26:38 +08:00
|
|
|
#ifndef LLVM_LIB_TARGET_ARM_INSTPRINTER_ARMINSTPRINTER_H
|
|
|
|
#define LLVM_LIB_TARGET_ARM_INSTPRINTER_ARMINSTPRINTER_H
|
2009-10-20 03:56:26 +08:00
|
|
|
|
|
|
|
#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:
|
2012-04-02 14:09:36 +08:00
|
|
|
ARMInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII,
|
2015-03-31 05:52:28 +08:00
|
|
|
const MCRegisterInfo &MRI);
|
2009-10-20 03:56:26 +08:00
|
|
|
|
2015-03-28 04:36:02 +08:00
|
|
|
void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot,
|
|
|
|
const MCSubtargetInfo &STI) override;
|
2014-03-10 10:09:33 +08:00
|
|
|
void printRegName(raw_ostream &OS, unsigned RegNo) const override;
|
2010-10-29 05:37:33 +08:00
|
|
|
|
2009-10-20 03:56:26 +08:00
|
|
|
// Autogenerated by tblgen.
|
2015-03-28 07:41:42 +08:00
|
|
|
void printInstruction(const MCInst *MI, const MCSubtargetInfo &STI,
|
|
|
|
raw_ostream &O);
|
2009-10-20 03:56:26 +08:00
|
|
|
static const char *getRegisterName(unsigned RegNo);
|
|
|
|
|
2015-03-28 07:41:42 +08:00
|
|
|
void printOperand(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
|
|
|
|
raw_ostream &O);
|
|
|
|
|
|
|
|
void printSORegRegOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printSORegImmOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
|
|
|
|
void printAddrModeTBB(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printAddrModeTBH(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printAddrMode2Operand(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printAM2PostIndexOp(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
2011-04-01 07:26:08 +08:00
|
|
|
void printAM2PreOrOffsetIndexOp(const MCInst *MI, unsigned OpNum,
|
2015-03-28 07:41:42 +08:00
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
2010-04-04 12:47:45 +08:00
|
|
|
void printAddrMode2OffsetOperand(const MCInst *MI, unsigned OpNum,
|
2015-03-28 07:41:42 +08:00
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
2013-04-13 02:47:25 +08:00
|
|
|
template <bool AlwaysPrintImm0>
|
2015-03-28 07:41:42 +08:00
|
|
|
void printAddrMode3Operand(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
2010-04-04 12:47:45 +08:00
|
|
|
void printAddrMode3OffsetOperand(const MCInst *MI, unsigned OpNum,
|
2015-03-28 07:41:42 +08:00
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
2013-04-13 02:47:25 +08:00
|
|
|
void printAM3PreOrOffsetIndexOp(const MCInst *MI, unsigned Op, raw_ostream &O,
|
|
|
|
bool AlwaysPrintImm0);
|
2011-08-04 07:50:40 +08:00
|
|
|
void printPostIdxImm8Operand(const MCInst *MI, unsigned OpNum,
|
2015-03-28 07:41:42 +08:00
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printPostIdxRegOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
2011-08-05 02:24:14 +08:00
|
|
|
void printPostIdxImm8s4Operand(const MCInst *MI, unsigned OpNum,
|
2015-03-28 07:41:42 +08:00
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
2011-04-05 01:18:19 +08:00
|
|
|
|
2015-03-28 07:41:42 +08:00
|
|
|
void printLdStmModeOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
2013-04-13 02:47:25 +08:00
|
|
|
template <bool AlwaysPrintImm0>
|
2015-03-28 07:41:42 +08:00
|
|
|
void printAddrMode5Operand(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printAddrMode6Operand(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printAddrMode7Operand(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
2010-04-04 12:47:45 +08:00
|
|
|
void printAddrMode6OffsetOperand(const MCInst *MI, unsigned OpNum,
|
2015-03-28 07:41:42 +08:00
|
|
|
const MCSubtargetInfo &STI, 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,
|
2015-03-28 07:41:42 +08:00
|
|
|
const MCSubtargetInfo &STI,
|
2010-04-04 12:47:45 +08:00
|
|
|
raw_ostream &O);
|
2015-03-28 07:41:42 +08:00
|
|
|
void printMemBOption(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printInstSyncBOption(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printShiftImmOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printPKHLSLShiftImm(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printPKHASRShiftImm(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
2009-11-19 14:57:41 +08:00
|
|
|
|
2013-07-03 17:21:44 +08:00
|
|
|
template <unsigned scale>
|
2015-03-28 07:41:42 +08:00
|
|
|
void printAdrLabelOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printThumbS4ImmOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printThumbSRImm(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printThumbITMask(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
2010-04-04 12:47:45 +08:00
|
|
|
void printThumbAddrModeRROperand(const MCInst *MI, unsigned OpNum,
|
2015-03-28 07:41:42 +08:00
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
2010-12-14 11:36:38 +08:00
|
|
|
void printThumbAddrModeImm5SOperand(const MCInst *MI, unsigned OpNum,
|
2015-03-28 07:41:42 +08:00
|
|
|
const MCSubtargetInfo &STI,
|
2010-12-14 11:36:38 +08:00
|
|
|
raw_ostream &O, unsigned Scale);
|
|
|
|
void printThumbAddrModeImm5S1Operand(const MCInst *MI, unsigned OpNum,
|
2015-03-28 07:41:42 +08:00
|
|
|
const MCSubtargetInfo &STI,
|
2010-12-14 11:36:38 +08:00
|
|
|
raw_ostream &O);
|
|
|
|
void printThumbAddrModeImm5S2Operand(const MCInst *MI, unsigned OpNum,
|
2015-03-28 07:41:42 +08:00
|
|
|
const MCSubtargetInfo &STI,
|
2010-12-14 11:36:38 +08:00
|
|
|
raw_ostream &O);
|
|
|
|
void printThumbAddrModeImm5S4Operand(const MCInst *MI, unsigned OpNum,
|
2015-03-28 07:41:42 +08:00
|
|
|
const MCSubtargetInfo &STI,
|
2010-12-14 11:36:38 +08:00
|
|
|
raw_ostream &O);
|
2010-04-04 12:47:45 +08:00
|
|
|
void printThumbAddrModeSPOperand(const MCInst *MI, unsigned OpNum,
|
2015-03-28 07:41:42 +08:00
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
2010-09-18 05:25:10 +08:00
|
|
|
|
2015-03-28 07:41:42 +08:00
|
|
|
void printT2SOOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
2015-03-28 07:24:22 +08:00
|
|
|
template <bool AlwaysPrintImm0>
|
2010-10-26 04:00:01 +08:00
|
|
|
void printAddrModeImm12Operand(const MCInst *MI, unsigned OpNum,
|
2015-03-28 07:41:42 +08:00
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
2015-03-28 07:24:22 +08:00
|
|
|
template <bool AlwaysPrintImm0>
|
2010-04-04 12:47:45 +08:00
|
|
|
void printT2AddrModeImm8Operand(const MCInst *MI, unsigned OpNum,
|
2015-03-28 07:41:42 +08:00
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
2015-03-28 07:24:22 +08:00
|
|
|
template <bool AlwaysPrintImm0>
|
2010-04-04 12:47:45 +08:00
|
|
|
void printT2AddrModeImm8s4Operand(const MCInst *MI, unsigned OpNum,
|
2015-03-28 07:41:42 +08:00
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
2011-09-10 02:37:27 +08:00
|
|
|
void printT2AddrModeImm0_1020s4Operand(const MCInst *MI, unsigned OpNum,
|
2015-03-28 07:41:42 +08:00
|
|
|
const MCSubtargetInfo &STI,
|
2015-03-28 07:24:22 +08:00
|
|
|
raw_ostream &O);
|
2010-04-04 12:47:45 +08:00
|
|
|
void printT2AddrModeImm8OffsetOperand(const MCInst *MI, unsigned OpNum,
|
2015-03-28 07:41:42 +08:00
|
|
|
const MCSubtargetInfo &STI,
|
2010-04-04 12:47:45 +08:00
|
|
|
raw_ostream &O);
|
|
|
|
void printT2AddrModeImm8s4OffsetOperand(const MCInst *MI, unsigned OpNum,
|
2015-03-28 07:41:42 +08:00
|
|
|
const MCSubtargetInfo &STI,
|
2010-04-04 12:47:45 +08:00
|
|
|
raw_ostream &O);
|
|
|
|
void printT2AddrModeSoRegOperand(const MCInst *MI, unsigned OpNum,
|
2015-03-28 07:41:42 +08:00
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
|
|
|
|
void printSetendOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printCPSIMod(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printCPSIFlag(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printMSRMaskOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printBankedRegOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printPredicateOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
2010-04-04 12:47:45 +08:00
|
|
|
void printMandatoryPredicateOperand(const MCInst *MI, unsigned OpNum,
|
2015-03-28 07:41:42 +08:00
|
|
|
const MCSubtargetInfo &STI,
|
2010-04-04 12:47:45 +08:00
|
|
|
raw_ostream &O);
|
|
|
|
void printSBitModifierOperand(const MCInst *MI, unsigned OpNum,
|
2015-03-28 07:41:42 +08:00
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printRegisterList(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printNoHashImmediate(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printPImmediate(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printCImmediate(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printCoprocOptionImm(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printFPImmOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printNEONModImmOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printImmPlusOneOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printRotImmOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printModImmOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printGPRPairOperand(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
|
|
|
|
void printPCLabel(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
2012-10-30 09:04:51 +08:00
|
|
|
void printThumbLdrLabelOperand(const MCInst *MI, unsigned OpNum,
|
2015-03-28 07:41:42 +08:00
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printFBits16(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printFBits32(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printVectorIndex(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printVectorListOne(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printVectorListTwo(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
2012-03-07 06:01:44 +08:00
|
|
|
void printVectorListTwoSpaced(const MCInst *MI, unsigned OpNum,
|
2015-03-28 07:41:42 +08:00
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printVectorListThree(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
|
|
|
void printVectorListFour(const MCInst *MI, unsigned OpNum,
|
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
2011-11-30 09:09:44 +08:00
|
|
|
void printVectorListOneAllLanes(const MCInst *MI, unsigned OpNum,
|
2015-03-28 07:41:42 +08:00
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
2011-12-01 02:21:25 +08:00
|
|
|
void printVectorListTwoAllLanes(const MCInst *MI, unsigned OpNum,
|
2015-03-28 07:41:42 +08:00
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
2012-01-25 07:47:04 +08:00
|
|
|
void printVectorListThreeAllLanes(const MCInst *MI, unsigned OpNum,
|
2015-03-28 07:41:42 +08:00
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
2012-01-25 08:01:08 +08:00
|
|
|
void printVectorListFourAllLanes(const MCInst *MI, unsigned OpNum,
|
2015-03-28 07:41:42 +08:00
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
2011-12-21 08:38:54 +08:00
|
|
|
void printVectorListTwoSpacedAllLanes(const MCInst *MI, unsigned OpNum,
|
2015-03-28 07:41:42 +08:00
|
|
|
const MCSubtargetInfo &STI,
|
2011-12-21 08:38:54 +08:00
|
|
|
raw_ostream &O);
|
2012-01-25 07:47:04 +08:00
|
|
|
void printVectorListThreeSpacedAllLanes(const MCInst *MI, unsigned OpNum,
|
2015-03-28 07:41:42 +08:00
|
|
|
const MCSubtargetInfo &STI,
|
2012-01-25 07:47:04 +08:00
|
|
|
raw_ostream &O);
|
2012-01-25 08:01:08 +08:00
|
|
|
void printVectorListFourSpacedAllLanes(const MCInst *MI, unsigned OpNum,
|
2015-03-28 07:41:42 +08:00
|
|
|
const MCSubtargetInfo &STI,
|
2012-01-25 08:01:08 +08:00
|
|
|
raw_ostream &O);
|
2012-01-24 07:20:46 +08:00
|
|
|
void printVectorListThreeSpaced(const MCInst *MI, unsigned OpNum,
|
2015-03-28 07:41:42 +08:00
|
|
|
const MCSubtargetInfo &STI, raw_ostream &O);
|
2012-01-24 08:43:17 +08:00
|
|
|
void printVectorListFourSpaced(const MCInst *MI, unsigned OpNum,
|
2015-03-28 07:41:42 +08:00
|
|
|
const MCSubtargetInfo &STI, 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
|