• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===-- AMDGPUInstPrinter.h - AMDGPU MC Inst -> ASM interface ---*- 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 /// \file
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_LIB_TARGET_AMDGPU_INSTPRINTER_AMDGPUINSTPRINTER_H
14 #define LLVM_LIB_TARGET_AMDGPU_INSTPRINTER_AMDGPUINSTPRINTER_H
15 
16 #include "llvm/MC/MCInstPrinter.h"
17 
18 namespace llvm {
19 
20 class AMDGPUInstPrinter : public MCInstPrinter {
21 public:
AMDGPUInstPrinter(const MCAsmInfo & MAI,const MCInstrInfo & MII,const MCRegisterInfo & MRI)22   AMDGPUInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII,
23                      const MCRegisterInfo &MRI)
24     : MCInstPrinter(MAI, MII, MRI) {}
25 
26   //Autogenerated by tblgen
27   void printInstruction(const MCInst *MI, raw_ostream &O);
28   static const char *getRegisterName(unsigned RegNo);
29 
30   void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot,
31                  const MCSubtargetInfo &STI) override;
32   static void printRegOperand(unsigned RegNo, raw_ostream &O,
33                               const MCRegisterInfo &MRI);
34 
35 private:
36   void printU4ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
37   void printU8ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
38   void printU16ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
39   void printU4ImmDecOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
40   void printU8ImmDecOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
41   void printU16ImmDecOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
42   void printU32ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
43   void printNamedBit(const MCInst* MI, unsigned OpNo, raw_ostream& O,
44                      StringRef BitName);
45   void printOffen(const MCInst *MI, unsigned OpNo, raw_ostream &O);
46   void printIdxen(const MCInst *MI, unsigned OpNo, raw_ostream &O);
47   void printAddr64(const MCInst *MI, unsigned OpNo, raw_ostream &O);
48   void printMBUFOffset(const MCInst *MI, unsigned OpNo, raw_ostream &O);
49   void printOffset(const MCInst *MI, unsigned OpNo, raw_ostream &O);
50   void printOffset0(const MCInst *MI, unsigned OpNo, raw_ostream &O);
51   void printOffset1(const MCInst *MI, unsigned OpNo, raw_ostream &O);
52   void printSMRDOffset(const MCInst *MI, unsigned OpNo, raw_ostream &O);
53   void printSMRDLiteralOffset(const MCInst *MI, unsigned OpNo, raw_ostream &O);
54   void printGDS(const MCInst *MI, unsigned OpNo, raw_ostream &O);
55   void printGLC(const MCInst *MI, unsigned OpNo, raw_ostream &O);
56   void printSLC(const MCInst *MI, unsigned OpNo, raw_ostream &O);
57   void printTFE(const MCInst *MI, unsigned OpNo, raw_ostream &O);
58   void printDMask(const MCInst *MI, unsigned OpNo, raw_ostream &O);
59   void printUNorm(const MCInst *MI, unsigned OpNo, raw_ostream &O);
60   void printDA(const MCInst *MI, unsigned OpNo, raw_ostream &O);
61   void printR128(const MCInst *MI, unsigned OpNo, raw_ostream &O);
62   void printLWE(const MCInst *MI, unsigned OpNo, raw_ostream &O);
63   void printRegOperand(unsigned RegNo, raw_ostream &O);
64   void printVOPDst(const MCInst *MI, unsigned OpNo, raw_ostream &O);
65   void printImmediate32(uint32_t I, raw_ostream &O);
66   void printImmediate64(uint64_t I, raw_ostream &O);
67   void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
68   void printOperandAndFPInputMods(const MCInst *MI, unsigned OpNo, raw_ostream &O);
69   void printOperandAndIntInputMods(const MCInst *MI, unsigned OpNo, raw_ostream &O);
70   void printDPPCtrl(const MCInst *MI, unsigned OpNo, raw_ostream &O);
71   void printRowMask(const MCInst *MI, unsigned OpNo, raw_ostream &O);
72   void printBankMask(const MCInst *MI, unsigned OpNo, raw_ostream &O);
73   void printBoundCtrl(const MCInst *MI, unsigned OpNo, raw_ostream &O);
74   void printSDWASel(const MCInst *MI, unsigned OpNo, raw_ostream &O);
75   void printSDWADstSel(const MCInst *MI, unsigned OpNo, raw_ostream &O);
76   void printSDWASrc0Sel(const MCInst *MI, unsigned OpNo, raw_ostream &O);
77   void printSDWASrc1Sel(const MCInst *MI, unsigned OpNo, raw_ostream &O);
78   void printSDWADstUnused(const MCInst *MI, unsigned OpNo, raw_ostream &O);
79   static void printInterpSlot(const MCInst *MI, unsigned OpNum, raw_ostream &O);
80   void printMemOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
81   static void printIfSet(const MCInst *MI, unsigned OpNo, raw_ostream &O,
82                          StringRef Asm, StringRef Default = "");
83   static void printIfSet(const MCInst *MI, unsigned OpNo,
84                          raw_ostream &O, char Asm);
85   static void printAbs(const MCInst *MI, unsigned OpNo, raw_ostream &O);
86   static void printClamp(const MCInst *MI, unsigned OpNo, raw_ostream &O);
87   static void printClampSI(const MCInst *MI, unsigned OpNo, raw_ostream &O);
88   static void printOModSI(const MCInst *MI, unsigned OpNo, raw_ostream &O);
89   void printLiteral(const MCInst *MI, unsigned OpNo, raw_ostream &O);
90   static void printLast(const MCInst *MI, unsigned OpNo, raw_ostream &O);
91   static void printNeg(const MCInst *MI, unsigned OpNo, raw_ostream &O);
92   static void printOMOD(const MCInst *MI, unsigned OpNo, raw_ostream &O);
93   static void printRel(const MCInst *MI, unsigned OpNo, raw_ostream &O);
94   static void printUpdateExecMask(const MCInst *MI, unsigned OpNo,
95                                   raw_ostream &O);
96   static void printUpdatePred(const MCInst *MI, unsigned OpNo, raw_ostream &O);
97   static void printWrite(const MCInst *MI, unsigned OpNo, raw_ostream &O);
98   static void printSel(const MCInst *MI, unsigned OpNo, raw_ostream &O);
99   static void printBankSwizzle(const MCInst *MI, unsigned OpNo, raw_ostream &O);
100   static void printRSel(const MCInst *MI, unsigned OpNo, raw_ostream &O);
101   static void printCT(const MCInst *MI, unsigned OpNo, raw_ostream &O);
102   static void printKCache(const MCInst *MI, unsigned OpNo, raw_ostream &O);
103   static void printSendMsg(const MCInst *MI, unsigned OpNo, raw_ostream &O);
104   static void printWaitFlag(const MCInst *MI, unsigned OpNo, raw_ostream &O);
105   static void printHwreg(const MCInst *MI, unsigned OpNo, raw_ostream &O);
106 };
107 
108 } // End namespace llvm
109 
110 #endif
111