1 //===-- PTXInstPrinter.h - Convert PTX MCInst to assembly syntax ----------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 // 10 // This class prints n PTX MCInst to a .ptx file. 11 // 12 //===----------------------------------------------------------------------===// 13 14 #ifndef PTXINSTPRINTER_H 15 #define PTXINSTPRINTER_H 16 17 #include "llvm/MC/MCInstPrinter.h" 18 #include "llvm/MC/MCSubtargetInfo.h" 19 20 namespace llvm { 21 22 class MCOperand; 23 24 class PTXInstPrinter : public MCInstPrinter { 25 public: 26 PTXInstPrinter(const MCAsmInfo &MAI, const MCSubtargetInfo &STI); 27 28 virtual void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot); 29 virtual StringRef getOpcodeName(unsigned Opcode) const; 30 virtual void printRegName(raw_ostream &OS, unsigned RegNo) const; 31 32 static const char *getInstructionName(unsigned Opcode); 33 34 // Autogenerated by tblgen. 35 void printInstruction(const MCInst *MI, raw_ostream &O); 36 static const char *getRegisterName(unsigned RegNo); 37 38 void printPredicate(const MCInst *MI, raw_ostream &O); 39 void printCall(const MCInst *MI, raw_ostream &O); 40 void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O); 41 void printMemOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O); 42 void printRoundingMode(const MCInst *MI, unsigned OpNo, raw_ostream &O); 43 }; 44 } 45 46 #endif 47 48