1 //===-- M68kInstPrinter.h - Convert M68k MCInst to asm ----------*- 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 //===----------------------------------------------------------------------===//
10 /// This file contains declarations for an M68k MCInst printer.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_LIB_TARGET_M68K_INSTPRINTER_M68KINSTPRINTER_H
15 #define LLVM_LIB_TARGET_M68K_INSTPRINTER_M68KINSTPRINTER_H
17 #include "M68kMemOperandPrinter.h"
18 #include "llvm/MC/MCInstPrinter.h"
24 class M68kInstPrinter
: public MCInstPrinter
,
25 public M68kMemOperandPrinter
<M68kInstPrinter
, MCInst
> {
26 friend class M68kMemOperandPrinter
;
29 M68kInstPrinter(const MCAsmInfo
&MAI
, const MCInstrInfo
&MII
,
30 const MCRegisterInfo
&MRI
)
31 : MCInstPrinter(MAI
, MII
, MRI
) {}
33 // Autogenerated by tblgen.
34 void printInstruction(const MCInst
*MI
, uint64_t Address
, raw_ostream
&O
);
35 static const char *getRegisterName(MCRegister Reg
);
37 void printRegName(raw_ostream
&OS
, MCRegister Reg
) override
;
38 void printInst(const MCInst
*MI
, uint64_t Address
, StringRef Annot
,
39 const MCSubtargetInfo
&STI
, raw_ostream
&O
) override
;
41 bool printAliasInstr(const MCInst
*MI
, uint64_t Address
, raw_ostream
&OS
);
42 void printCustomAliasOperand(const MCInst
*MI
, unsigned OpIdx
,
43 unsigned PrintMethodIdx
, raw_ostream
&O
);
45 std::pair
<const char *, uint64_t>
46 getMnemonic(const MCInst
&MI
) const override
;
49 void printOperand(const MCInst
*MI
, unsigned opNum
, raw_ostream
&O
);
50 void printImmediate(const MCInst
*MI
, unsigned opNum
, raw_ostream
&O
);
51 /// Print register mask for MOVEM instruction in order D0-D7,A0-A7
52 void printMoveMask(const MCInst
*MI
, unsigned opNum
, raw_ostream
&O
);
53 /// Print register mask for MOVEM instruction in order A7-A0,D7-D0
54 void printMoveMaskR(const MCInst
*MI
, unsigned opNum
, raw_ostream
&O
);
55 void printDisp(const MCInst
*MI
, unsigned opNum
, raw_ostream
&O
);
56 void printAbsMem(const MCInst
*MI
, unsigned opNum
, raw_ostream
&O
);
58 //===----------------------------------------------------------------------===//
60 //===----------------------------------------------------------------------===//
62 void printPCRelImm(const MCInst
*MI
, uint64_t Address
, unsigned opNum
,
64 printAbsMem(MI
, opNum
, O
);
67 void printARI8Mem(const MCInst
*MI
, unsigned opNum
, raw_ostream
&O
) {
68 printARIMem(MI
, opNum
, O
);
70 void printARI16Mem(const MCInst
*MI
, unsigned opNum
, raw_ostream
&O
) {
71 printARIMem(MI
, opNum
, O
);
73 void printARI32Mem(const MCInst
*MI
, unsigned opNum
, raw_ostream
&O
) {
74 printARIMem(MI
, opNum
, O
);
77 void printARIPI8Mem(const MCInst
*MI
, unsigned opNum
, raw_ostream
&O
) {
78 printARIPIMem(MI
, opNum
, O
);
80 void printARIPI16Mem(const MCInst
*MI
, unsigned opNum
, raw_ostream
&O
) {
81 printARIPIMem(MI
, opNum
, O
);
83 void printARIPI32Mem(const MCInst
*MI
, unsigned opNum
, raw_ostream
&O
) {
84 printARIPIMem(MI
, opNum
, O
);
87 void printARIPD8Mem(const MCInst
*MI
, unsigned opNum
, raw_ostream
&O
) {
88 printARIPDMem(MI
, opNum
, O
);
90 void printARIPD16Mem(const MCInst
*MI
, unsigned opNum
, raw_ostream
&O
) {
91 printARIPDMem(MI
, opNum
, O
);
93 void printARIPD32Mem(const MCInst
*MI
, unsigned opNum
, raw_ostream
&O
) {
94 printARIPDMem(MI
, opNum
, O
);
97 void printARID8Mem(const MCInst
*MI
, unsigned opNum
, raw_ostream
&O
) {
98 printARIDMem(MI
, opNum
, O
);
100 void printARID16Mem(const MCInst
*MI
, unsigned opNum
, raw_ostream
&O
) {
101 printARIDMem(MI
, opNum
, O
);
103 void printARID32Mem(const MCInst
*MI
, unsigned opNum
, raw_ostream
&O
) {
104 printARIDMem(MI
, opNum
, O
);
107 void printARII8Mem(const MCInst
*MI
, unsigned opNum
, raw_ostream
&O
) {
108 printARIIMem(MI
, opNum
, O
);
110 void printARII16Mem(const MCInst
*MI
, unsigned opNum
, raw_ostream
&O
) {
111 printARIIMem(MI
, opNum
, O
);
113 void printARII32Mem(const MCInst
*MI
, unsigned opNum
, raw_ostream
&O
) {
114 printARIIMem(MI
, opNum
, O
);
117 void printAS8Mem(const MCInst
*MI
, unsigned opNum
, raw_ostream
&O
) {
118 printAbsMem(MI
, opNum
, O
);
120 void printAS16Mem(const MCInst
*MI
, unsigned opNum
, raw_ostream
&O
) {
121 printAbsMem(MI
, opNum
, O
);
123 void printAS32Mem(const MCInst
*MI
, unsigned opNum
, raw_ostream
&O
) {
124 printAbsMem(MI
, opNum
, O
);
127 void printAL8Mem(const MCInst
*MI
, unsigned opNum
, raw_ostream
&O
) {
128 printAbsMem(MI
, opNum
, O
);
130 void printAL16Mem(const MCInst
*MI
, unsigned opNum
, raw_ostream
&O
) {
131 printAbsMem(MI
, opNum
, O
);
133 void printAL32Mem(const MCInst
*MI
, unsigned opNum
, raw_ostream
&O
) {
134 printAbsMem(MI
, opNum
, O
);
137 void printPCD8Mem(const MCInst
*MI
, uint64_t Address
, unsigned opNum
,
139 printPCDMem(MI
, Address
, opNum
, O
);
141 void printPCD16Mem(const MCInst
*MI
, uint64_t Address
, unsigned opNum
,
143 printPCDMem(MI
, Address
, opNum
, O
);
145 void printPCD32Mem(const MCInst
*MI
, uint64_t Address
, unsigned opNum
,
147 printPCDMem(MI
, Address
, opNum
, O
);
150 void printPCI8Mem(const MCInst
*MI
, uint64_t Address
, unsigned opNum
,
152 printPCIMem(MI
, Address
, opNum
, O
);
154 void printPCI16Mem(const MCInst
*MI
, uint64_t Address
, unsigned opNum
,
156 printPCIMem(MI
, Address
, opNum
, O
);
158 void printPCI32Mem(const MCInst
*MI
, uint64_t Address
, unsigned opNum
,
160 printPCIMem(MI
, Address
, opNum
, O
);
163 } // end namespace llvm
165 #endif // LLVM_LIB_TARGET_M68K_INSTPRINTER_M68KINSTPRINTER_H