1 //= X86IntelInstPrinter.h - Convert X86 MCInst to assembly syntax -*- C++ -*-=//
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
7 //===----------------------------------------------------------------------===//
9 // This class prints an X86 MCInst to Intel style .s file syntax.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_LIB_TARGET_X86_MCTARGETDESC_X86INTELINSTPRINTER_H
14 #define LLVM_LIB_TARGET_X86_MCTARGETDESC_X86INTELINSTPRINTER_H
16 #include "X86InstPrinterCommon.h"
17 #include "llvm/Support/raw_ostream.h"
21 class X86IntelInstPrinter final
: public X86InstPrinterCommon
{
23 X86IntelInstPrinter(const MCAsmInfo
&MAI
, const MCInstrInfo
&MII
,
24 const MCRegisterInfo
&MRI
)
25 : X86InstPrinterCommon(MAI
, MII
, MRI
) {}
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
);
32 // Autogenerated by tblgen, returns true if we successfully printed an
34 bool printAliasInstr(const MCInst
*MI
, raw_ostream
&OS
);
35 void printCustomAliasOperand(const MCInst
*MI
, unsigned OpIdx
,
36 unsigned PrintMethodIdx
, raw_ostream
&O
);
38 // Autogenerated by tblgen.
39 void printInstruction(const MCInst
*MI
, raw_ostream
&O
);
40 static const char *getRegisterName(unsigned RegNo
);
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
);
50 void printanymem(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
) {
51 printMemReference(MI
, OpNo
, O
);
54 void printopaquemem(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
) {
55 printMemReference(MI
, OpNo
, O
);
58 void printbytemem(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
) {
60 printMemReference(MI
, OpNo
, O
);
62 void printwordmem(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
) {
64 printMemReference(MI
, OpNo
, O
);
66 void printdwordmem(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
) {
68 printMemReference(MI
, OpNo
, O
);
70 void printqwordmem(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
) {
72 printMemReference(MI
, OpNo
, O
);
74 void printxmmwordmem(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
) {
76 printMemReference(MI
, OpNo
, O
);
78 void printymmwordmem(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
) {
80 printMemReference(MI
, OpNo
, O
);
82 void printzmmwordmem(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
) {
84 printMemReference(MI
, OpNo
, O
);
86 void printtbytemem(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
) {
88 printMemReference(MI
, OpNo
, O
);
92 void printSrcIdx8(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
) {
94 printSrcIdx(MI
, OpNo
, O
);
96 void printSrcIdx16(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
) {
98 printSrcIdx(MI
, OpNo
, O
);
100 void printSrcIdx32(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
) {
102 printSrcIdx(MI
, OpNo
, O
);
104 void printSrcIdx64(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
) {
106 printSrcIdx(MI
, OpNo
, O
);
108 void printDstIdx8(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
) {
110 printDstIdx(MI
, OpNo
, O
);
112 void printDstIdx16(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
) {
114 printDstIdx(MI
, OpNo
, O
);
116 void printDstIdx32(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
) {
118 printDstIdx(MI
, OpNo
, O
);
120 void printDstIdx64(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
) {
122 printDstIdx(MI
, OpNo
, O
);
124 void printMemOffs8(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
) {
126 printMemOffset(MI
, OpNo
, O
);
128 void printMemOffs16(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
) {
130 printMemOffset(MI
, OpNo
, O
);
132 void printMemOffs32(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
) {
134 printMemOffset(MI
, OpNo
, O
);
136 void printMemOffs64(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
) {
138 printMemOffset(MI
, OpNo
, O
);
142 } // end namespace llvm
144 #endif // LLVM_LIB_TARGET_X86_MCTARGETDESC_X86INTELINSTPRINTER_H