LLVM API Documentation
00001 //===- ARMInstPrinter.h - Convert ARM MCInst to assembly syntax -*- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // This class prints an ARM MCInst to a .s file. 00011 // 00012 //===----------------------------------------------------------------------===// 00013 00014 #ifndef LLVM_LIB_TARGET_ARM_INSTPRINTER_ARMINSTPRINTER_H 00015 #define LLVM_LIB_TARGET_ARM_INSTPRINTER_ARMINSTPRINTER_H 00016 00017 #include "llvm/MC/MCInstPrinter.h" 00018 #include "llvm/MC/MCSubtargetInfo.h" 00019 00020 namespace llvm { 00021 00022 class MCOperand; 00023 00024 class ARMInstPrinter : public MCInstPrinter { 00025 public: 00026 ARMInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII, 00027 const MCRegisterInfo &MRI, const MCSubtargetInfo &STI); 00028 00029 void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot) override; 00030 void printRegName(raw_ostream &OS, unsigned RegNo) const override; 00031 00032 // Autogenerated by tblgen. 00033 void printInstruction(const MCInst *MI, raw_ostream &O); 00034 static const char *getRegisterName(unsigned RegNo); 00035 00036 00037 void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O); 00038 00039 void printSORegRegOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00040 void printSORegImmOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00041 00042 void printAddrModeTBB(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00043 void printAddrModeTBH(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00044 void printAddrMode2Operand(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00045 void printAM2PostIndexOp(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00046 void printAM2PreOrOffsetIndexOp(const MCInst *MI, unsigned OpNum, 00047 raw_ostream &O); 00048 void printAddrMode2OffsetOperand(const MCInst *MI, unsigned OpNum, 00049 raw_ostream &O); 00050 template <bool AlwaysPrintImm0> 00051 void printAddrMode3Operand(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00052 void printAddrMode3OffsetOperand(const MCInst *MI, unsigned OpNum, 00053 raw_ostream &O); 00054 void printAM3PostIndexOp(const MCInst *MI, unsigned Op, raw_ostream &O); 00055 void printAM3PreOrOffsetIndexOp(const MCInst *MI, unsigned Op, raw_ostream &O, 00056 bool AlwaysPrintImm0); 00057 void printPostIdxImm8Operand(const MCInst *MI, unsigned OpNum, 00058 raw_ostream &O); 00059 void printPostIdxRegOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00060 void printPostIdxImm8s4Operand(const MCInst *MI, unsigned OpNum, 00061 raw_ostream &O); 00062 00063 void printLdStmModeOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00064 template <bool AlwaysPrintImm0> 00065 void printAddrMode5Operand(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00066 void printAddrMode6Operand(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00067 void printAddrMode7Operand(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00068 void printAddrMode6OffsetOperand(const MCInst *MI, unsigned OpNum, 00069 raw_ostream &O); 00070 00071 void printBitfieldInvMaskImmOperand(const MCInst *MI, unsigned OpNum, 00072 raw_ostream &O); 00073 void printMemBOption(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00074 void printInstSyncBOption(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00075 void printShiftImmOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00076 void printPKHLSLShiftImm(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00077 void printPKHASRShiftImm(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00078 00079 template <unsigned scale> 00080 void printAdrLabelOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00081 void printThumbS4ImmOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00082 void printThumbSRImm(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00083 void printThumbITMask(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00084 void printThumbAddrModeRROperand(const MCInst *MI, unsigned OpNum, 00085 raw_ostream &O); 00086 void printThumbAddrModeImm5SOperand(const MCInst *MI, unsigned OpNum, 00087 raw_ostream &O, unsigned Scale); 00088 void printThumbAddrModeImm5S1Operand(const MCInst *MI, unsigned OpNum, 00089 raw_ostream &O); 00090 void printThumbAddrModeImm5S2Operand(const MCInst *MI, unsigned OpNum, 00091 raw_ostream &O); 00092 void printThumbAddrModeImm5S4Operand(const MCInst *MI, unsigned OpNum, 00093 raw_ostream &O); 00094 void printThumbAddrModeSPOperand(const MCInst *MI, unsigned OpNum, 00095 raw_ostream &O); 00096 00097 void printT2SOOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00098 template<bool AlwaysPrintImm0> 00099 void printAddrModeImm12Operand(const MCInst *MI, unsigned OpNum, 00100 raw_ostream &O); 00101 template<bool AlwaysPrintImm0> 00102 void printT2AddrModeImm8Operand(const MCInst *MI, unsigned OpNum, 00103 raw_ostream &O); 00104 template<bool AlwaysPrintImm0> 00105 void printT2AddrModeImm8s4Operand(const MCInst *MI, unsigned OpNum, 00106 raw_ostream &O); 00107 void printT2AddrModeImm0_1020s4Operand(const MCInst *MI, unsigned OpNum, 00108 raw_ostream &O); 00109 void printT2AddrModeImm8OffsetOperand(const MCInst *MI, unsigned OpNum, 00110 raw_ostream &O); 00111 void printT2AddrModeImm8s4OffsetOperand(const MCInst *MI, unsigned OpNum, 00112 raw_ostream &O); 00113 void printT2AddrModeSoRegOperand(const MCInst *MI, unsigned OpNum, 00114 raw_ostream &O); 00115 00116 void printSetendOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00117 void printCPSIMod(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00118 void printCPSIFlag(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00119 void printMSRMaskOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00120 void printBankedRegOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00121 void printPredicateOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00122 void printMandatoryPredicateOperand(const MCInst *MI, unsigned OpNum, 00123 raw_ostream &O); 00124 void printSBitModifierOperand(const MCInst *MI, unsigned OpNum, 00125 raw_ostream &O); 00126 void printRegisterList(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00127 void printNoHashImmediate(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00128 void printPImmediate(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00129 void printCImmediate(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00130 void printCoprocOptionImm(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00131 void printFPImmOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00132 void printNEONModImmOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00133 void printImmPlusOneOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00134 void printRotImmOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00135 void printGPRPairOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00136 00137 void printPCLabel(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00138 void printThumbLdrLabelOperand(const MCInst *MI, unsigned OpNum, 00139 raw_ostream &O); 00140 void printFBits16(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00141 void printFBits32(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00142 void printVectorIndex(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00143 void printVectorListOne(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00144 void printVectorListTwo(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00145 void printVectorListTwoSpaced(const MCInst *MI, unsigned OpNum, 00146 raw_ostream &O); 00147 void printVectorListThree(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00148 void printVectorListFour(const MCInst *MI, unsigned OpNum, raw_ostream &O); 00149 void printVectorListOneAllLanes(const MCInst *MI, unsigned OpNum, 00150 raw_ostream &O); 00151 void printVectorListTwoAllLanes(const MCInst *MI, unsigned OpNum, 00152 raw_ostream &O); 00153 void printVectorListThreeAllLanes(const MCInst *MI, unsigned OpNum, 00154 raw_ostream &O); 00155 void printVectorListFourAllLanes(const MCInst *MI, unsigned OpNum, 00156 raw_ostream &O); 00157 void printVectorListTwoSpacedAllLanes(const MCInst *MI, unsigned OpNum, 00158 raw_ostream &O); 00159 void printVectorListThreeSpacedAllLanes(const MCInst *MI, unsigned OpNum, 00160 raw_ostream &O); 00161 void printVectorListFourSpacedAllLanes(const MCInst *MI, unsigned OpNum, 00162 raw_ostream &O); 00163 void printVectorListThreeSpaced(const MCInst *MI, unsigned OpNum, 00164 raw_ostream &O); 00165 void printVectorListFourSpaced(const MCInst *MI, unsigned OpNum, 00166 raw_ostream &O); 00167 }; 00168 00169 } // end namespace llvm 00170 00171 #endif