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) override;
33 // Autogenerated by tblgen.
34 void printInstruction(const MCInst *MI, raw_ostream &O);
35 static const char *getRegisterName(unsigned RegNo);
37 void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
38 void printMemReference(const MCInst *MI, unsigned Op, raw_ostream &O);
39 void printSSECC(const MCInst *MI, unsigned Op, raw_ostream &O);
40 void printAVXCC(const MCInst *MI, unsigned Op, raw_ostream &O);
41 void printPCRelImm(const MCInst *MI, unsigned OpNo, raw_ostream &O);
42 void printMemOffset(const MCInst *MI, unsigned OpNo, raw_ostream &O);
43 void printSrcIdx(const MCInst *MI, unsigned OpNo, raw_ostream &O);
44 void printDstIdx(const MCInst *MI, unsigned OpNo, raw_ostream &O);
45 void printRoundingControl(const MCInst *MI, unsigned Op, raw_ostream &OS);
47 void printopaquemem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
49 printMemReference(MI, OpNo, O);
52 void printi8mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
54 printMemReference(MI, OpNo, O);
56 void printi16mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
58 printMemReference(MI, OpNo, O);
60 void printi32mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
62 printMemReference(MI, OpNo, O);
64 void printi64mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
66 printMemReference(MI, OpNo, O);
68 void printi128mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
70 printMemReference(MI, OpNo, O);
72 void printi256mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
74 printMemReference(MI, OpNo, O);
76 void printi512mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
78 printMemReference(MI, OpNo, O);
80 void printf32mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
82 printMemReference(MI, OpNo, O);
84 void printf64mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
86 printMemReference(MI, OpNo, O);
88 void printf80mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
90 printMemReference(MI, OpNo, O);
92 void printf128mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
94 printMemReference(MI, OpNo, O);
96 void printf256mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
98 printMemReference(MI, OpNo, O);
100 void printf512mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
102 printMemReference(MI, OpNo, O);
106 void printSrcIdx8(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
108 printSrcIdx(MI, OpNo, O);
110 void printSrcIdx16(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
112 printSrcIdx(MI, OpNo, O);
114 void printSrcIdx32(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
116 printSrcIdx(MI, OpNo, O);
118 void printSrcIdx64(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
120 printSrcIdx(MI, OpNo, O);
122 void printDstIdx8(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
124 printDstIdx(MI, OpNo, O);
126 void printDstIdx16(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
128 printDstIdx(MI, OpNo, O);
130 void printDstIdx32(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
132 printDstIdx(MI, OpNo, O);
134 void printDstIdx64(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
136 printDstIdx(MI, OpNo, O);
138 void printMemOffs8(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
140 printMemOffset(MI, OpNo, O);
142 void printMemOffs16(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
144 printMemOffset(MI, OpNo, O);
146 void printMemOffs32(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
148 printMemOffset(MI, OpNo, O);
150 void printMemOffs64(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
152 printMemOffset(MI, OpNo, O);