Coverage Report

Created: 2017-10-03 07:32

/Users/buildslave/jenkins/sharedspace/clang-stage2-coverage-R@2/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.h
Line
Count
Source
1
//= X86IntelInstPrinter.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 Intel style .s file syntax.
11
//
12
//===----------------------------------------------------------------------===//
13
14
#ifndef LLVM_LIB_TARGET_X86_INSTPRINTER_X86INTELINSTPRINTER_H
15
#define LLVM_LIB_TARGET_X86_INSTPRINTER_X86INTELINSTPRINTER_H
16
17
#include "llvm/MC/MCInstPrinter.h"
18
#include "llvm/Support/raw_ostream.h"
19
20
namespace llvm {
21
22
class X86IntelInstPrinter final : public MCInstPrinter {
23
public:
24
  X86IntelInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII,
25
                      const MCRegisterInfo &MRI)
26
247
    : MCInstPrinter(MAI, MII, MRI) {}
27
28
  void printRegName(raw_ostream &OS, unsigned RegNo) const override;
29
  void printInst(const MCInst *MI, raw_ostream &OS, StringRef Annot,
30
                 const MCSubtargetInfo &STI) override;
31
32
  // Autogenerated by tblgen.
33
  void printInstruction(const MCInst *MI, raw_ostream &O);
34
  static const char *getRegisterName(unsigned RegNo);
35
36
  void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
37
  void printMemReference(const MCInst *MI, unsigned Op, raw_ostream &O);
38
  void printSSEAVXCC(const MCInst *MI, unsigned Op, raw_ostream &O);
39
  void printXOPCC(const MCInst *MI, unsigned Op, raw_ostream &O);
40
  void printPCRelImm(const MCInst *MI, unsigned OpNo, raw_ostream &O);
41
  void printMemOffset(const MCInst *MI, unsigned OpNo, raw_ostream &O);
42
  void printSrcIdx(const MCInst *MI, unsigned OpNo, raw_ostream &O);
43
  void printDstIdx(const MCInst *MI, unsigned OpNo, raw_ostream &O);
44
  void printRoundingControl(const MCInst *MI, unsigned Op, raw_ostream &OS);
45
  void printU8Imm(const MCInst *MI, unsigned Op, raw_ostream &O);
46
47
18
  void printanymem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
48
18
    printMemReference(MI, OpNo, O);
49
18
  }
50
51
49
  void printopaquemem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
52
49
    O << "opaque ptr ";
53
49
    printMemReference(MI, OpNo, O);
54
49
  }
55
56
251
  void printi8mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
57
251
    O << "byte ptr ";
58
251
    printMemReference(MI, OpNo, O);
59
251
  }
60
126
  void printi16mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
61
126
    O << "word ptr ";
62
126
    printMemReference(MI, OpNo, O);
63
126
  }
64
864
  void printi32mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
65
864
    O << "dword ptr ";
66
864
    printMemReference(MI, OpNo, O);
67
864
  }
68
1.00k
  void printi64mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
69
1.00k
    O << "qword ptr ";
70
1.00k
    printMemReference(MI, OpNo, O);
71
1.00k
  }
72
853
  void printi128mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
73
853
    O << "xmmword ptr ";
74
853
    printMemReference(MI, OpNo, O);
75
853
  }
76
329
  void printi256mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
77
329
    O << "ymmword ptr ";
78
329
    printMemReference(MI, OpNo, O);
79
329
  }
80
1.22k
  void printi512mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
81
1.22k
    O << "zmmword ptr ";
82
1.22k
    printMemReference(MI, OpNo, O);
83
1.22k
  }
84
1.14k
  void printf32mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
85
1.14k
    O << "dword ptr ";
86
1.14k
    printMemReference(MI, OpNo, O);
87
1.14k
  }
88
1.35k
  void printf64mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
89
1.35k
    O << "qword ptr ";
90
1.35k
    printMemReference(MI, OpNo, O);
91
1.35k
  }
92
16
  void printf80mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
93
16
    O << "xword ptr ";
94
16
    printMemReference(MI, OpNo, O);
95
16
  }
96
347
  void printf128mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
97
347
    O << "xmmword ptr ";
98
347
    printMemReference(MI, OpNo, O);
99
347
  }
100
112
  void printf256mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
101
112
    O << "ymmword ptr ";
102
112
    printMemReference(MI, OpNo, O);
103
112
  }
104
1.36k
  void printf512mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
105
1.36k
    O << "zmmword ptr ";
106
1.36k
    printMemReference(MI, OpNo, O);
107
1.36k
  }
108
109
110
1
  void printSrcIdx8(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
111
1
    O << "byte ptr ";
112
1
    printSrcIdx(MI, OpNo, O);
113
1
  }
114
1
  void printSrcIdx16(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
115
1
    O << "word ptr ";
116
1
    printSrcIdx(MI, OpNo, O);
117
1
  }
118
1
  void printSrcIdx32(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
119
1
    O << "dword ptr ";
120
1
    printSrcIdx(MI, OpNo, O);
121
1
  }
122
1
  void printSrcIdx64(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
123
1
    O << "qword ptr ";
124
1
    printSrcIdx(MI, OpNo, O);
125
1
  }
126
1
  void printDstIdx8(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
127
1
    O << "byte ptr ";
128
1
    printDstIdx(MI, OpNo, O);
129
1
  }
130
1
  void printDstIdx16(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
131
1
    O << "word ptr ";
132
1
    printDstIdx(MI, OpNo, O);
133
1
  }
134
1
  void printDstIdx32(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
135
1
    O << "dword ptr ";
136
1
    printDstIdx(MI, OpNo, O);
137
1
  }
138
1
  void printDstIdx64(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
139
1
    O << "qword ptr ";
140
1
    printDstIdx(MI, OpNo, O);
141
1
  }
142
6
  void printMemOffs8(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
143
6
    O << "byte ptr ";
144
6
    printMemOffset(MI, OpNo, O);
145
6
  }
146
4
  void printMemOffs16(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
147
4
    O << "word ptr ";
148
4
    printMemOffset(MI, OpNo, O);
149
4
  }
150
5
  void printMemOffs32(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
151
5
    O << "dword ptr ";
152
5
    printMemOffset(MI, OpNo, O);
153
5
  }
154
2
  void printMemOffs64(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
155
2
    O << "qword ptr ";
156
2
    printMemOffset(MI, OpNo, O);
157
2
  }
158
};
159
160
} // end namespace llvm
161
162
#endif // LLVM_LIB_TARGET_X86_INSTPRINTER_X86INTELINSTPRINTER_H