1 //===- PTXInstPrinter.h - Convert PTX MCInst to assembly syntax -*- C++ -*-===// 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 MCInstrInfo &MII, 27 const MCRegisterInfo &MRI, const MCSubtargetInfo &STI); 28 29 virtual void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot); 30 virtual void printRegName(raw_ostream &OS, unsigned RegNo) const; 31 32 // Autogenerated by tblgen. 33 void printInstruction(const MCInst *MI, raw_ostream &O); 34 static const char *getRegisterName(unsigned RegNo); 35 36 void printPredicate(const MCInst *MI, raw_ostream &O); 37 void printCall(const MCInst *MI, raw_ostream &O); 38 void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O); 39 void printMemOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O); 40 void printRoundingMode(const MCInst *MI, unsigned OpNo, raw_ostream &O); 41 }; 42 } 43 44 #endif 45 46