LCOV - code coverage report
Current view: top level - lib/Target/AMDGPU/InstPrinter - AMDGPUInstPrinter.h (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 4 4 100.0 %
Date: 2018-07-13 00:08:38 Functions: 2 4 50.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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        2081 : class AMDGPUInstPrinter : public MCInstPrinter {
      21             : public:
      22             :   AMDGPUInstPrinter(const MCAsmInfo &MAI,
      23             :                     const MCInstrInfo &MII, const MCRegisterInfo &MRI)
      24        2090 :     : MCInstPrinter(MAI, MII, MRI) {}
      25             : 
      26             :   //Autogenerated by tblgen
      27             :   void printInstruction(const MCInst *MI, const MCSubtargetInfo &STI,
      28             :                         raw_ostream &O);
      29             :   static const char *getRegisterName(unsigned RegNo);
      30             : 
      31             :   void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot,
      32             :                  const MCSubtargetInfo &STI) override;
      33             :   static void printRegOperand(unsigned RegNo, raw_ostream &O,
      34             :                               const MCRegisterInfo &MRI);
      35             : 
      36             : private:
      37             :   void printU4ImmOperand(const MCInst *MI, unsigned OpNo,
      38             :                          const MCSubtargetInfo &STI, raw_ostream &O);
      39             :   void printU8ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
      40             :   void printU16ImmOperand(const MCInst *MI, unsigned OpNo,
      41             :                           const MCSubtargetInfo &STI, raw_ostream &O);
      42             :   void printU4ImmDecOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
      43             :   void printU8ImmDecOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
      44             :   void printU16ImmDecOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
      45             :   void printS13ImmDecOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
      46             :   void printU32ImmOperand(const MCInst *MI, unsigned OpNo,
      47             :                           const MCSubtargetInfo &STI, raw_ostream &O);
      48             :   void printNamedBit(const MCInst *MI, unsigned OpNo, raw_ostream &O,
      49             :                      StringRef BitName);
      50             :   void printOffen(const MCInst *MI, unsigned OpNo, raw_ostream &O);
      51             :   void printIdxen(const MCInst *MI, unsigned OpNo, raw_ostream &O);
      52             :   void printAddr64(const MCInst *MI, unsigned OpNo, raw_ostream &O);
      53             :   void printMBUFOffset(const MCInst *MI, unsigned OpNo, raw_ostream &O);
      54             :   void printOffset(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
      55             :                    raw_ostream &O);
      56             :   void printOffsetS13(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
      57             :                       raw_ostream &O);
      58             : 
      59             :   void printOffset0(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
      60             :                     raw_ostream &O);
      61             :   void printOffset1(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
      62             :                     raw_ostream &O);
      63             :   void printSMRDOffset8(const MCInst *MI, unsigned OpNo,
      64             :                        const MCSubtargetInfo &STI, raw_ostream &O);
      65             :   void printSMRDOffset20(const MCInst *MI, unsigned OpNo,
      66             :                        const MCSubtargetInfo &STI, raw_ostream &O);
      67             :   void printSMRDLiteralOffset(const MCInst *MI, unsigned OpNo,
      68             :                               const MCSubtargetInfo &STI, raw_ostream &O);
      69             :   void printGDS(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
      70             :                 raw_ostream &O);
      71             :   void printGLC(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
      72             :                 raw_ostream &O);
      73             :   void printSLC(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
      74             :                 raw_ostream &O);
      75             :   void printTFE(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
      76             :                 raw_ostream &O);
      77             :   void printDMask(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
      78             :                   raw_ostream &O);
      79             :   void printUNorm(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
      80             :                   raw_ostream &O);
      81             :   void printDA(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
      82             :                raw_ostream &O);
      83             :   void printR128(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
      84             :                  raw_ostream &O);
      85             :   void printLWE(const MCInst *MI, unsigned OpNo,
      86             :                 const MCSubtargetInfo &STI, raw_ostream &O);
      87             :   void printD16(const MCInst *MI, unsigned OpNo,
      88             :                 const MCSubtargetInfo &STI, raw_ostream &O);
      89             :   void printExpCompr(const MCInst *MI, unsigned OpNo,
      90             :                      const MCSubtargetInfo &STI, raw_ostream &O);
      91             :   void printExpVM(const MCInst *MI, unsigned OpNo,
      92             :                   const MCSubtargetInfo &STI, raw_ostream &O);
      93             :   void printDFMT(const MCInst *MI, unsigned OpNo,
      94             :                  const MCSubtargetInfo &STI, raw_ostream &O);
      95             :   void printNFMT(const MCInst *MI, unsigned OpNo,
      96             :                  const MCSubtargetInfo &STI, raw_ostream &O);
      97             : 
      98             :   void printRegOperand(unsigned RegNo, raw_ostream &O);
      99             :   void printVOPDst(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
     100             :                    raw_ostream &O);
     101             :   void printVINTRPDst(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
     102             :                       raw_ostream &O);
     103             :   void printImmediate16(uint32_t Imm, const MCSubtargetInfo &STI,
     104             :                         raw_ostream &O);
     105             :   void printImmediateV216(uint32_t Imm, const MCSubtargetInfo &STI,
     106             :                           raw_ostream &O);
     107             :   void printImmediate32(uint32_t Imm, const MCSubtargetInfo &STI,
     108             :                         raw_ostream &O);
     109             :   void printImmediate64(uint64_t Imm, const MCSubtargetInfo &STI,
     110             :                         raw_ostream &O);
     111             :   void printOperand(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
     112             :                     raw_ostream &O);
     113             :   void printOperandAndFPInputMods(const MCInst *MI, unsigned OpNo,
     114             :                                   const MCSubtargetInfo &STI, raw_ostream &O);
     115             :   void printOperandAndIntInputMods(const MCInst *MI, unsigned OpNo,
     116             :                                    const MCSubtargetInfo &STI, raw_ostream &O);
     117             :   void printDPPCtrl(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
     118             :                     raw_ostream &O);
     119             :   void printRowMask(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
     120             :                     raw_ostream &O);
     121             :   void printBankMask(const MCInst *MI, unsigned OpNo,
     122             :                      const MCSubtargetInfo &STI, raw_ostream &O);
     123             :   void printBoundCtrl(const MCInst *MI, unsigned OpNo,
     124             :                       const MCSubtargetInfo &STI, raw_ostream &O);
     125             :   void printSDWASel(const MCInst *MI, unsigned OpNo, raw_ostream &O);
     126             :   void printSDWADstSel(const MCInst *MI, unsigned OpNo,
     127             :                        const MCSubtargetInfo &STI, raw_ostream &O);
     128             :   void printSDWASrc0Sel(const MCInst *MI, unsigned OpNo,
     129             :                         const MCSubtargetInfo &STI, raw_ostream &O);
     130             :   void printSDWASrc1Sel(const MCInst *MI, unsigned OpNo,
     131             :                         const MCSubtargetInfo &STI, raw_ostream &O);
     132             :   void printSDWADstUnused(const MCInst *MI, unsigned OpNo,
     133             :                           const MCSubtargetInfo &STI, raw_ostream &O);
     134             :   void printPackedModifier(const MCInst *MI, StringRef Name, unsigned Mod,
     135             :                            raw_ostream &O);
     136             :   void printOpSel(const MCInst *MI, unsigned OpNo,
     137             :                   const MCSubtargetInfo &STI, raw_ostream &O);
     138             :   void printOpSelHi(const MCInst *MI, unsigned OpNo,
     139             :                   const MCSubtargetInfo &STI, raw_ostream &O);
     140             :   void printNegLo(const MCInst *MI, unsigned OpNo,
     141             :                   const MCSubtargetInfo &STI, raw_ostream &O);
     142             :   void printNegHi(const MCInst *MI, unsigned OpNo,
     143             :                   const MCSubtargetInfo &STI, raw_ostream &O);
     144             :   void printInterpSlot(const MCInst *MI, unsigned OpNo,
     145             :                        const MCSubtargetInfo &STI, raw_ostream &O);
     146             :   void printInterpAttr(const MCInst *MI, unsigned OpNo,
     147             :                        const MCSubtargetInfo &STI, raw_ostream &O);
     148             :   void printInterpAttrChan(const MCInst *MI, unsigned OpNo,
     149             :                            const MCSubtargetInfo &STI, raw_ostream &O);
     150             : 
     151             :   void printVGPRIndexMode(const MCInst *MI, unsigned OpNo,
     152             :                           const MCSubtargetInfo &STI, raw_ostream &O);
     153             :   void printMemOperand(const MCInst *MI, unsigned OpNo,
     154             :                        const MCSubtargetInfo &STI, raw_ostream &O);
     155             : 
     156             : 
     157             :   template <unsigned N>
     158             :   void printExpSrcN(const MCInst *MI, unsigned OpNo,
     159             :                     const MCSubtargetInfo &STI, raw_ostream &O);
     160             :   void printExpSrc0(const MCInst *MI, unsigned OpNo,
     161             :                     const MCSubtargetInfo &STI, raw_ostream &O);
     162             :   void printExpSrc1(const MCInst *MI, unsigned OpNo,
     163             :                     const MCSubtargetInfo &STI, raw_ostream &O);
     164             :   void printExpSrc2(const MCInst *MI, unsigned OpNo,
     165             :                     const MCSubtargetInfo &STI, raw_ostream &O);
     166             :   void printExpSrc3(const MCInst *MI, unsigned OpNo,
     167             :                     const MCSubtargetInfo &STI, raw_ostream &O);
     168             :   void printExpTgt(const MCInst *MI, unsigned OpNo,
     169             :                    const MCSubtargetInfo &STI, raw_ostream &O);
     170             : 
     171             : public:
     172             :   static void printIfSet(const MCInst *MI, unsigned OpNo, raw_ostream &O,
     173             :                          StringRef Asm, StringRef Default = "");
     174             :   static void printIfSet(const MCInst *MI, unsigned OpNo, raw_ostream &O,
     175             :                          char Asm);
     176             : protected:
     177             :   void printAbs(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
     178             :                 raw_ostream &O);
     179             :   void printHigh(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
     180             :                  raw_ostream &O);
     181             :   void printClamp(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
     182             :                   raw_ostream &O);
     183             :   void printClampSI(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
     184             :                     raw_ostream &O);
     185             :   void printOModSI(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
     186             :                    raw_ostream &O);
     187             :   void printLiteral(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
     188             :                     raw_ostream &O);
     189             :   void printLast(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
     190             :                  raw_ostream &O);
     191             :   void printNeg(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
     192             :                 raw_ostream &O);
     193             :   void printOMOD(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
     194             :                  raw_ostream &O);
     195             :   void printRel(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
     196             :                 raw_ostream &O);
     197             :   void printUpdateExecMask(const MCInst *MI, unsigned OpNo,
     198             :                            const MCSubtargetInfo &STI, raw_ostream &O);
     199             :   void printUpdatePred(const MCInst *MI, unsigned OpNo,
     200             :                        const MCSubtargetInfo &STI, raw_ostream &O);
     201             :   void printWrite(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
     202             :                   raw_ostream &O);
     203             :   void printBankSwizzle(const MCInst *MI, unsigned OpNo,
     204             :                         const MCSubtargetInfo &STI, raw_ostream &O);
     205             :   void printRSel(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
     206             :                  raw_ostream &O);
     207             :   void printCT(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
     208             :                raw_ostream &O);
     209             :   void printKCache(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
     210             :                    raw_ostream &O);
     211             :   void printSendMsg(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
     212             :                     raw_ostream &O);
     213             :   void printSwizzle(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
     214             :                     raw_ostream &O);
     215             :   void printWaitFlag(const MCInst *MI, unsigned OpNo,
     216             :                      const MCSubtargetInfo &STI, raw_ostream &O);
     217             :   void printHwreg(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
     218             :                   raw_ostream &O);
     219             : };
     220             : 
     221         259 : class R600InstPrinter : public MCInstPrinter {
     222             : public:
     223             :   R600InstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII,
     224             :                   const MCRegisterInfo &MRI)
     225         260 :     : MCInstPrinter(MAI, MII, MRI) {}
     226             : 
     227             :   void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot,
     228             :                  const MCSubtargetInfo &STI) override;
     229             :   void printInstruction(const MCInst *MI, raw_ostream &O);
     230             :   static const char *getRegisterName(unsigned RegNo);
     231             : 
     232             :   void printAbs(const MCInst *MI, unsigned OpNo, raw_ostream &O);
     233             :   void printBankSwizzle(const MCInst *MI, unsigned OpNo, raw_ostream &O);
     234             :   void printClamp(const MCInst *MI, unsigned OpNo, raw_ostream &O);
     235             :   void printCT(const MCInst *MI, unsigned OpNo, raw_ostream &O);
     236             :   void printKCache(const MCInst *MI, unsigned OpNo, raw_ostream &O);
     237             :   void printLast(const MCInst *MI, unsigned OpNo, raw_ostream &O);
     238             :   void printLiteral(const MCInst *MI, unsigned OpNo, raw_ostream &O);
     239             :   void printMemOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
     240             :   void printNeg(const MCInst *MI, unsigned OpNo, raw_ostream &O);
     241             :   void printOMOD(const MCInst *MI, unsigned OpNo, raw_ostream &O);
     242             :   void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
     243             :   void printRel(const MCInst *MI, unsigned OpNo, raw_ostream &O);
     244             :   void printRSel(const MCInst *MI, unsigned OpNo, raw_ostream &O);
     245             :   void printUpdateExecMask(const MCInst *MI, unsigned OpNo, raw_ostream &O);
     246             :   void printUpdatePred(const MCInst *MI, unsigned OpNo, raw_ostream &O);
     247             :   void printWrite(const MCInst *MI, unsigned OpNo, raw_ostream &O);
     248             : };
     249             : 
     250             : } // End namespace llvm
     251             : 
     252             : #endif

Generated by: LCOV version 1.13