[AMDGPU] Check for immediate SrcC in mfma in AsmParser
[llvm-core.git] / lib / Target / X86 / MCTargetDesc / X86IntelInstPrinter.h
blobf32f49f7c417458ed801df10a25c097f6f831923
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.
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"
19 namespace llvm {
21 class X86IntelInstPrinter final : public X86InstPrinterCommon {
22 public:
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
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);
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) {
59 O << "byte ptr ";
60 printMemReference(MI, OpNo, O);
62 void printwordmem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
63 O << "word ptr ";
64 printMemReference(MI, OpNo, O);
66 void printdwordmem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
67 O << "dword ptr ";
68 printMemReference(MI, OpNo, O);
70 void printqwordmem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
71 O << "qword ptr ";
72 printMemReference(MI, OpNo, O);
74 void printxmmwordmem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
75 O << "xmmword ptr ";
76 printMemReference(MI, OpNo, O);
78 void printymmwordmem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
79 O << "ymmword ptr ";
80 printMemReference(MI, OpNo, O);
82 void printzmmwordmem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
83 O << "zmmword ptr ";
84 printMemReference(MI, OpNo, O);
86 void printtbytemem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
87 O << "tbyte ptr ";
88 printMemReference(MI, OpNo, O);
92 void printSrcIdx8(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
93 O << "byte ptr ";
94 printSrcIdx(MI, OpNo, O);
96 void printSrcIdx16(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
97 O << "word ptr ";
98 printSrcIdx(MI, OpNo, O);
100 void printSrcIdx32(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
101 O << "dword ptr ";
102 printSrcIdx(MI, OpNo, O);
104 void printSrcIdx64(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
105 O << "qword ptr ";
106 printSrcIdx(MI, OpNo, O);
108 void printDstIdx8(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
109 O << "byte ptr ";
110 printDstIdx(MI, OpNo, O);
112 void printDstIdx16(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
113 O << "word ptr ";
114 printDstIdx(MI, OpNo, O);
116 void printDstIdx32(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
117 O << "dword ptr ";
118 printDstIdx(MI, OpNo, O);
120 void printDstIdx64(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
121 O << "qword ptr ";
122 printDstIdx(MI, OpNo, O);
124 void printMemOffs8(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
125 O << "byte ptr ";
126 printMemOffset(MI, OpNo, O);
128 void printMemOffs16(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
129 O << "word ptr ";
130 printMemOffset(MI, OpNo, O);
132 void printMemOffs32(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
133 O << "dword ptr ";
134 printMemOffset(MI, OpNo, O);
136 void printMemOffs64(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
137 O << "qword ptr ";
138 printMemOffset(MI, OpNo, O);
142 } // end namespace llvm
144 #endif // LLVM_LIB_TARGET_X86_MCTARGETDESC_X86INTELINSTPRINTER_H