Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/lib/Target/X86/MCTargetDesc/X86IntelInstPrinter.h
Line
Count
Source
1
//= X86IntelInstPrinter.h - Convert X86 MCInst to assembly syntax -*- C++ -*-=//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
// This class prints an X86 MCInst to Intel style .s file syntax.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#ifndef LLVM_LIB_TARGET_X86_MCTARGETDESC_X86INTELINSTPRINTER_H
14
#define LLVM_LIB_TARGET_X86_MCTARGETDESC_X86INTELINSTPRINTER_H
15
16
#include "X86InstPrinterCommon.h"
17
#include "llvm/Support/raw_ostream.h"
18
19
namespace llvm {
20
21
class X86IntelInstPrinter final : public X86InstPrinterCommon {
22
public:
23
  X86IntelInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII,
24
                      const MCRegisterInfo &MRI)
25
269
    : 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
  bool printVecCompareInstr(const MCInst *MI, raw_ostream &OS);
31
32
  // Autogenerated by tblgen, returns true if we successfully printed an
33
  // alias.
34
  bool printAliasInstr(const MCInst *MI, raw_ostream &OS);
35
  void printCustomAliasOperand(const MCInst *MI, unsigned OpIdx,
36
                               unsigned PrintMethodIdx, raw_ostream &O);
37
38
  // Autogenerated by tblgen.
39
  void printInstruction(const MCInst *MI, raw_ostream &O);
40
  static const char *getRegisterName(unsigned RegNo);
41
42
  void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O) override;
43
  void printMemReference(const MCInst *MI, unsigned Op, raw_ostream &O);
44
  void printMemOffset(const MCInst *MI, unsigned OpNo, raw_ostream &O);
45
  void printSrcIdx(const MCInst *MI, unsigned OpNo, raw_ostream &O);
46
  void printDstIdx(const MCInst *MI, unsigned OpNo, raw_ostream &O);
47
  void printU8Imm(const MCInst *MI, unsigned Op, raw_ostream &O);
48
  void printSTiRegOperand(const MCInst *MI, unsigned OpNo, raw_ostream &OS);
49
50
16
  void printanymem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
51
16
    printMemReference(MI, OpNo, O);
52
16
  }
53
54
49
  void printopaquemem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
55
49
    printMemReference(MI, OpNo, O);
56
49
  }
57
58
253
  void printbytemem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
59
253
    O << "byte ptr ";
60
253
    printMemReference(MI, OpNo, O);
61
253
  }
62
126
  void printwordmem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
63
126
    O << "word ptr ";
64
126
    printMemReference(MI, OpNo, O);
65
126
  }
66
2.13k
  void printdwordmem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
67
2.13k
    O << "dword ptr ";
68
2.13k
    printMemReference(MI, OpNo, O);
69
2.13k
  }
70
2.35k
  void printqwordmem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
71
2.35k
    O << "qword ptr ";
72
2.35k
    printMemReference(MI, OpNo, O);
73
2.35k
  }
74
1.27k
  void printxmmwordmem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
75
1.27k
    O << "xmmword ptr ";
76
1.27k
    printMemReference(MI, OpNo, O);
77
1.27k
  }
78
507
  void printymmwordmem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
79
507
    O << "ymmword ptr ";
80
507
    printMemReference(MI, OpNo, O);
81
507
  }
82
2.68k
  void printzmmwordmem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
83
2.68k
    O << "zmmword ptr ";
84
2.68k
    printMemReference(MI, OpNo, O);
85
2.68k
  }
86
16
  void printtbytemem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
87
16
    O << "tbyte ptr ";
88
16
    printMemReference(MI, OpNo, O);
89
16
  }
90
91
92
1
  void printSrcIdx8(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
93
1
    O << "byte ptr ";
94
1
    printSrcIdx(MI, OpNo, O);
95
1
  }
96
1
  void printSrcIdx16(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
97
1
    O << "word ptr ";
98
1
    printSrcIdx(MI, OpNo, O);
99
1
  }
100
1
  void printSrcIdx32(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
101
1
    O << "dword ptr ";
102
1
    printSrcIdx(MI, OpNo, O);
103
1
  }
104
1
  void printSrcIdx64(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
105
1
    O << "qword ptr ";
106
1
    printSrcIdx(MI, OpNo, O);
107
1
  }
108
1
  void printDstIdx8(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
109
1
    O << "byte ptr ";
110
1
    printDstIdx(MI, OpNo, O);
111
1
  }
112
1
  void printDstIdx16(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
113
1
    O << "word ptr ";
114
1
    printDstIdx(MI, OpNo, O);
115
1
  }
116
1
  void printDstIdx32(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
117
1
    O << "dword ptr ";
118
1
    printDstIdx(MI, OpNo, O);
119
1
  }
120
1
  void printDstIdx64(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
121
1
    O << "qword ptr ";
122
1
    printDstIdx(MI, OpNo, O);
123
1
  }
124
6
  void printMemOffs8(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
125
6
    O << "byte ptr ";
126
6
    printMemOffset(MI, OpNo, O);
127
6
  }
128
4
  void printMemOffs16(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
129
4
    O << "word ptr ";
130
4
    printMemOffset(MI, OpNo, O);
131
4
  }
132
8
  void printMemOffs32(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
133
8
    O << "dword ptr ";
134
8
    printMemOffset(MI, OpNo, O);
135
8
  }
136
2
  void printMemOffs64(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
137
2
    O << "qword ptr ";
138
2
    printMemOffset(MI, OpNo, O);
139
2
  }
140
};
141
142
} // end namespace llvm
143
144
#endif // LLVM_LIB_TARGET_X86_MCTARGETDESC_X86INTELINSTPRINTER_H