blob: 04969642fd37e7e72ba308683092a57f02a6a43e [file] [log] [blame]
Justin Holewinskia2a63d22013-08-06 14:13:27 +00001//= NVPTXInstPrinter.h - Convert NVPTX 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 an NVPTX MCInst to .ptx file syntax.
11//
12//===----------------------------------------------------------------------===//
13
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000014#ifndef LLVM_LIB_TARGET_NVPTX_INSTPRINTER_NVPTXINSTPRINTER_H
15#define LLVM_LIB_TARGET_NVPTX_INSTPRINTER_NVPTXINSTPRINTER_H
Justin Holewinskia2a63d22013-08-06 14:13:27 +000016
17#include "llvm/MC/MCInstPrinter.h"
18#include "llvm/Support/raw_ostream.h"
19
20namespace llvm {
21
22class MCOperand;
23class MCSubtargetInfo;
24
25class NVPTXInstPrinter : public MCInstPrinter {
26public:
27 NVPTXInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII,
28 const MCRegisterInfo &MRI, const MCSubtargetInfo &STI);
29
Craig Topper2865c982014-04-29 07:57:44 +000030 void printRegName(raw_ostream &OS, unsigned RegNo) const override;
31 void printInst(const MCInst *MI, raw_ostream &OS, StringRef Annot) override;
Justin Holewinskia2a63d22013-08-06 14:13:27 +000032
33 // Autogenerated by tblgen.
34 void printInstruction(const MCInst *MI, raw_ostream &O);
35 static const char *getRegisterName(unsigned RegNo);
36 // End
37
38 void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
39 void printCvtMode(const MCInst *MI, int OpNum, raw_ostream &O,
Craig Toppere73658d2014-04-28 04:05:08 +000040 const char *Modifier = nullptr);
Justin Holewinskia2a63d22013-08-06 14:13:27 +000041 void printCmpMode(const MCInst *MI, int OpNum, raw_ostream &O,
Craig Toppere73658d2014-04-28 04:05:08 +000042 const char *Modifier = nullptr);
Justin Holewinskia2a63d22013-08-06 14:13:27 +000043 void printLdStCode(const MCInst *MI, int OpNum,
Craig Toppere73658d2014-04-28 04:05:08 +000044 raw_ostream &O, const char *Modifier = nullptr);
Justin Holewinskia2a63d22013-08-06 14:13:27 +000045 void printMemOperand(const MCInst *MI, int OpNum,
Craig Toppere73658d2014-04-28 04:05:08 +000046 raw_ostream &O, const char *Modifier = nullptr);
Justin Holewinski3d49e5c2013-11-15 12:30:04 +000047 void printProtoIdent(const MCInst *MI, int OpNum,
Craig Toppere73658d2014-04-28 04:05:08 +000048 raw_ostream &O, const char *Modifier = nullptr);
Justin Holewinskia2a63d22013-08-06 14:13:27 +000049};
50
51}
52
53#endif