LLVM  7.0.0svn
X86ATTInstPrinter.h
Go to the documentation of this file.
1 //=- X86ATTInstPrinter.h - Convert X86 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 X86 MCInst to AT&T style .s file syntax.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_X86_INSTPRINTER_X86ATTINSTPRINTER_H
15 #define LLVM_LIB_TARGET_X86_INSTPRINTER_X86ATTINSTPRINTER_H
16 
17 #include "X86InstPrinterCommon.h"
18 
19 namespace llvm {
20 
22 public:
24  const MCRegisterInfo &MRI)
25  : X86InstPrinterCommon(MAI, MII, MRI) {}
26 
27  void printRegName(raw_ostream &OS, unsigned RegNo) const override;
28  void printInst(const MCInst *MI, raw_ostream &OS, StringRef Annot,
29  const MCSubtargetInfo &STI) override;
30 
31  // Autogenerated by tblgen, returns true if we successfully printed an
32  // alias.
33  bool printAliasInstr(const MCInst *MI, raw_ostream &OS);
34  void printCustomAliasOperand(const MCInst *MI, unsigned OpIdx,
35  unsigned PrintMethodIdx, raw_ostream &O);
36 
37  // Autogenerated by tblgen.
38  void printInstruction(const MCInst *MI, raw_ostream &OS);
39  static const char *getRegisterName(unsigned RegNo);
40 
41  void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &OS) override;
42  void printMemReference(const MCInst *MI, unsigned Op, raw_ostream &OS);
43  void printMemOffset(const MCInst *MI, unsigned OpNo, raw_ostream &OS);
44  void printSrcIdx(const MCInst *MI, unsigned Op, raw_ostream &O);
45  void printDstIdx(const MCInst *MI, unsigned Op, raw_ostream &O);
46  void printU8Imm(const MCInst *MI, unsigned Op, raw_ostream &OS);
47 
48  void printanymem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
49  printMemReference(MI, OpNo, O);
50  }
51  void printopaquemem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
52  printMemReference(MI, OpNo, O);
53  }
54 
55  void printi8mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
56  printMemReference(MI, OpNo, O);
57  }
58  void printi16mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
59  printMemReference(MI, OpNo, O);
60  }
61  void printi32mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
62  printMemReference(MI, OpNo, O);
63  }
64  void printi64mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
65  printMemReference(MI, OpNo, O);
66  }
67  void printi128mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
68  printMemReference(MI, OpNo, O);
69  }
70  void printi256mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
71  printMemReference(MI, OpNo, O);
72  }
73  void printi512mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
74  printMemReference(MI, OpNo, O);
75  }
76  void printf32mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
77  printMemReference(MI, OpNo, O);
78  }
79  void printf64mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
80  printMemReference(MI, OpNo, O);
81  }
82  void printf80mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
83  printMemReference(MI, OpNo, O);
84  }
85  void printf128mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
86  printMemReference(MI, OpNo, O);
87  }
88  void printf256mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
89  printMemReference(MI, OpNo, O);
90  }
91  void printf512mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
92  printMemReference(MI, OpNo, O);
93  }
94 
95  void printSrcIdx8(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
96  printSrcIdx(MI, OpNo, O);
97  }
98  void printSrcIdx16(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
99  printSrcIdx(MI, OpNo, O);
100  }
101  void printSrcIdx32(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
102  printSrcIdx(MI, OpNo, O);
103  }
104  void printSrcIdx64(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
105  printSrcIdx(MI, OpNo, O);
106  }
107  void printDstIdx8(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
108  printDstIdx(MI, OpNo, O);
109  }
110  void printDstIdx16(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
111  printDstIdx(MI, OpNo, O);
112  }
113  void printDstIdx32(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
114  printDstIdx(MI, OpNo, O);
115  }
116  void printDstIdx64(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
117  printDstIdx(MI, OpNo, O);
118  }
119  void printMemOffs8(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
120  printMemOffset(MI, OpNo, O);
121  }
122  void printMemOffs16(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
123  printMemOffset(MI, OpNo, O);
124  }
125  void printMemOffs32(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
126  printMemOffset(MI, OpNo, O);
127  }
128  void printMemOffs64(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
129  printMemOffset(MI, OpNo, O);
130  }
131 
132 private:
133  bool HasCustomInstComment;
134 };
135 
136 } // end namespace llvm
137 
138 #endif // LLVM_LIB_TARGET_X86_INSTPRINTER_X86ATTINSTPRINTER_H
void printInst(const MCInst *MI, raw_ostream &OS, StringRef Annot, const MCSubtargetInfo &STI) override
Print the specified MCInst to the specified raw_ostream.
void printf128mem(const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printi16mem(const MCInst *MI, unsigned OpNo, raw_ostream &O)
static const char * getRegisterName(unsigned RegNo)
void printopaquemem(const MCInst *MI, unsigned OpNo, raw_ostream &O)
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
void printMemOffs32(const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printDstIdx8(const MCInst *MI, unsigned OpNo, raw_ostream &O)
X86ATTInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI)
void printf512mem(const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printi512mem(const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printSrcIdx8(const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printi256mem(const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printInstruction(const MCInst *MI, raw_ostream &OS)
void printSrcIdx16(const MCInst *MI, unsigned OpNo, raw_ostream &O)
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:161
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
void printRegName(raw_ostream &OS, unsigned RegNo) const override
Print the assembler register name.
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition: MCAsmInfo.h:56
void printMemOffset(const MCInst *MI, unsigned OpNo, raw_ostream &OS)
void printMemOffs8(const MCInst *MI, unsigned OpNo, raw_ostream &O)
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:24
void printf256mem(const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printf32mem(const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printi64mem(const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &OS) override
void printCustomAliasOperand(const MCInst *MI, unsigned OpIdx, unsigned PrintMethodIdx, raw_ostream &O)
void printf64mem(const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printMemReference(const MCInst *MI, unsigned Op, raw_ostream &OS)
void printU8Imm(const MCInst *MI, unsigned Op, raw_ostream &OS)
void printMemOffs64(const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printSrcIdx64(const MCInst *MI, unsigned OpNo, raw_ostream &O)
const MCAsmInfo & MAI
Definition: MCInstPrinter.h:46
void printDstIdx32(const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printi128mem(const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printSrcIdx(const MCInst *MI, unsigned Op, raw_ostream &O)
Generic base class for all target subtargets.
const MCInstrInfo & MII
Definition: MCInstPrinter.h:47
void printDstIdx64(const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printf80mem(const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printi8mem(const MCInst *MI, unsigned OpNo, raw_ostream &O)
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:46
void printDstIdx16(const MCInst *MI, unsigned OpNo, raw_ostream &O)
bool printAliasInstr(const MCInst *MI, raw_ostream &OS)
IRTranslator LLVM IR MI
void printDstIdx(const MCInst *MI, unsigned Op, raw_ostream &O)
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
void printanymem(const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printMemOffs16(const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printSrcIdx32(const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printi32mem(const MCInst *MI, unsigned OpNo, raw_ostream &O)
const MCRegisterInfo & MRI
Definition: MCInstPrinter.h:48