blob: f30fc49ab058e089f9251d57de1e7b9fece02d6d [file] [log] [blame]
Tom Stellard75aadc22012-12-11 21:25:42 +00001//===-- 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 AMDGPUINSTPRINTER_H
14#define AMDGPUINSTPRINTER_H
15
16#include "llvm/ADT/StringRef.h"
17#include "llvm/MC/MCInstPrinter.h"
18#include "llvm/Support/raw_ostream.h"
19
20namespace llvm {
21
22class AMDGPUInstPrinter : public MCInstPrinter {
23public:
24 AMDGPUInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII,
25 const MCRegisterInfo &MRI)
26 : MCInstPrinter(MAI, MII, MRI) {}
27
28 //Autogenerated by tblgen
29 void printInstruction(const MCInst *MI, raw_ostream &O);
30 static const char *getRegisterName(unsigned RegNo);
31
Craig Topper5656db42014-04-29 07:57:24 +000032 void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot) override;
Tom Stellard75aadc22012-12-11 21:25:42 +000033
34private:
Matt Arsenault4d7d3832014-04-15 22:32:49 +000035 void printU8ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
36 void printU16ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
37 void printU32ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
Matt Arsenaultfcf86c52014-04-15 22:32:42 +000038 void printRegOperand(unsigned RegNo, raw_ostream &O);
Matt Arsenault4d7d3832014-04-15 22:32:49 +000039 void printImmediate(uint32_t Imm, raw_ostream &O);
Matt Arsenaultfcf86c52014-04-15 22:32:42 +000040 void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
Matt Arsenaultf45faaf2014-03-17 22:23:09 +000041 static void printInterpSlot(const MCInst *MI, unsigned OpNum, raw_ostream &O);
Matt Arsenaultfcf86c52014-04-15 22:32:42 +000042 void printMemOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
Matt Arsenaultf45faaf2014-03-17 22:23:09 +000043 static void printIfSet(const MCInst *MI, unsigned OpNo, raw_ostream &O,
44 StringRef Asm, StringRef Default = "");
45 static void printAbs(const MCInst *MI, unsigned OpNo, raw_ostream &O);
46 static void printClamp(const MCInst *MI, unsigned OpNo, raw_ostream &O);
47 static void printLiteral(const MCInst *MI, unsigned OpNo, raw_ostream &O);
48 static void printLast(const MCInst *MI, unsigned OpNo, raw_ostream &O);
49 static void printNeg(const MCInst *MI, unsigned OpNo, raw_ostream &O);
50 static void printOMOD(const MCInst *MI, unsigned OpNo, raw_ostream &O);
51 static void printRel(const MCInst *MI, unsigned OpNo, raw_ostream &O);
52 static void printUpdateExecMask(const MCInst *MI, unsigned OpNo,
53 raw_ostream &O);
54 static void printUpdatePred(const MCInst *MI, unsigned OpNo, raw_ostream &O);
55 static void printWrite(const MCInst *MI, unsigned OpNo, raw_ostream &O);
56 static void printSel(const MCInst *MI, unsigned OpNo, raw_ostream &O);
57 static void printBankSwizzle(const MCInst *MI, unsigned OpNo, raw_ostream &O);
58 static void printRSel(const MCInst *MI, unsigned OpNo, raw_ostream &O);
59 static void printCT(const MCInst *MI, unsigned OpNo, raw_ostream &O);
60 static void printKCache(const MCInst *MI, unsigned OpNo, raw_ostream &O);
61 static void printSendMsg(const MCInst *MI, unsigned OpNo, raw_ostream &O);
62 static void printWaitFlag(const MCInst *MI, unsigned OpNo, raw_ostream &O);
Tom Stellard75aadc22012-12-11 21:25:42 +000063};
64
65} // End namespace llvm
66
67#endif // AMDGPUINSTRPRINTER_H