1 //= X86IntelInstPrinter.h - Convert X86 MCInst to assembly syntax -*- C++ -*-=//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This class prints an X86 MCInst to Intel style .s file syntax.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_LIB_TARGET_X86_INSTPRINTER_X86INTELINSTPRINTER_H
15 #define LLVM_LIB_TARGET_X86_INSTPRINTER_X86INTELINSTPRINTER_H
17 #include "llvm/MC/MCInstPrinter.h"
18 #include "llvm/Support/raw_ostream.h"
24 class X86IntelInstPrinter final : public MCInstPrinter {
26 X86IntelInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII,
27 const MCRegisterInfo &MRI)
28 : MCInstPrinter(MAI, MII, MRI) {}
30 void printRegName(raw_ostream &OS, unsigned RegNo) const override;
31 void printInst(const MCInst *MI, raw_ostream &OS, StringRef Annot,
32 const MCSubtargetInfo &STI) override;
34 // Autogenerated by tblgen.
35 void printInstruction(const MCInst *MI, raw_ostream &O);
36 static const char *getRegisterName(unsigned RegNo);
38 void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
39 void printMemReference(const MCInst *MI, unsigned Op, raw_ostream &O);
40 void printSSEAVXCC(const MCInst *MI, unsigned Op, raw_ostream &O);
41 void printXOPCC(const MCInst *MI, unsigned Op, raw_ostream &O);
42 void printPCRelImm(const MCInst *MI, unsigned OpNo, raw_ostream &O);
43 void printMemOffset(const MCInst *MI, unsigned OpNo, raw_ostream &O);
44 void printSrcIdx(const MCInst *MI, unsigned OpNo, raw_ostream &O);
45 void printDstIdx(const MCInst *MI, unsigned OpNo, raw_ostream &O);
46 void printRoundingControl(const MCInst *MI, unsigned Op, raw_ostream &OS);
47 void printU8Imm(const MCInst *MI, unsigned Op, raw_ostream &O);
49 void printanymem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
50 printMemReference(MI, OpNo, O);
53 void printopaquemem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
55 printMemReference(MI, OpNo, O);
58 void printi8mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
60 printMemReference(MI, OpNo, O);
62 void printi16mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
64 printMemReference(MI, OpNo, O);
66 void printi32mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
68 printMemReference(MI, OpNo, O);
70 void printi64mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
72 printMemReference(MI, OpNo, O);
74 void printi128mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
76 printMemReference(MI, OpNo, O);
78 void printi256mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
80 printMemReference(MI, OpNo, O);
82 void printi512mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
84 printMemReference(MI, OpNo, O);
86 void printf32mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
88 printMemReference(MI, OpNo, O);
90 void printf64mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
92 printMemReference(MI, OpNo, O);
94 void printf80mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
96 printMemReference(MI, OpNo, O);
98 void printf128mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
100 printMemReference(MI, OpNo, O);
102 void printf256mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
104 printMemReference(MI, OpNo, O);
106 void printf512mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
108 printMemReference(MI, OpNo, O);
112 void printSrcIdx8(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
114 printSrcIdx(MI, OpNo, O);
116 void printSrcIdx16(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
118 printSrcIdx(MI, OpNo, O);
120 void printSrcIdx32(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
122 printSrcIdx(MI, OpNo, O);
124 void printSrcIdx64(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
126 printSrcIdx(MI, OpNo, O);
128 void printDstIdx8(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
130 printDstIdx(MI, OpNo, O);
132 void printDstIdx16(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
134 printDstIdx(MI, OpNo, O);
136 void printDstIdx32(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
138 printDstIdx(MI, OpNo, O);
140 void printDstIdx64(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
142 printDstIdx(MI, OpNo, O);
144 void printMemOffs8(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
146 printMemOffset(MI, OpNo, O);
148 void printMemOffs16(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
150 printMemOffset(MI, OpNo, O);
152 void printMemOffs32(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
154 printMemOffset(MI, OpNo, O);
156 void printMemOffs64(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
158 printMemOffset(MI, OpNo, O);