LLVM 20.0.0git
M68kInstPrinter.h
Go to the documentation of this file.
1//===-- M68kInstPrinter.h - Convert M68k MCInst to asm ----------*- 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/// \file
10/// This file contains declarations for an M68k MCInst printer.
11///
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_LIB_TARGET_M68K_INSTPRINTER_M68KINSTPRINTER_H
15#define LLVM_LIB_TARGET_M68K_INSTPRINTER_M68KINSTPRINTER_H
16
19
20namespace llvm {
21
22class TargetMachine;
23
25 public M68kMemOperandPrinter<M68kInstPrinter, MCInst> {
27
28public:
30 const MCRegisterInfo &MRI)
31 : MCInstPrinter(MAI, MII, MRI) {}
32
33 // Autogenerated by tblgen.
35 static const char *getRegisterName(MCRegister Reg);
36
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;
40
42 void printCustomAliasOperand(const MCInst *MI, unsigned OpIdx,
43 unsigned PrintMethodIdx, raw_ostream &O);
44
45 std::pair<const char *, uint64_t>
46 getMnemonic(const MCInst &MI) const override;
47
48private:
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);
57
58 //===----------------------------------------------------------------------===//
59 // Specializations
60 //===----------------------------------------------------------------------===//
61 //
62 void printPCRelImm(const MCInst *MI, uint64_t Address, unsigned opNum,
63 raw_ostream &O) {
64 printAbsMem(MI, opNum, O);
65 }
66
67 void printARI8Mem(const MCInst *MI, unsigned opNum, raw_ostream &O) {
68 printARIMem(MI, opNum, O);
69 }
70 void printARI16Mem(const MCInst *MI, unsigned opNum, raw_ostream &O) {
71 printARIMem(MI, opNum, O);
72 }
73 void printARI32Mem(const MCInst *MI, unsigned opNum, raw_ostream &O) {
74 printARIMem(MI, opNum, O);
75 }
76
77 void printARIPI8Mem(const MCInst *MI, unsigned opNum, raw_ostream &O) {
78 printARIPIMem(MI, opNum, O);
79 }
80 void printARIPI16Mem(const MCInst *MI, unsigned opNum, raw_ostream &O) {
81 printARIPIMem(MI, opNum, O);
82 }
83 void printARIPI32Mem(const MCInst *MI, unsigned opNum, raw_ostream &O) {
84 printARIPIMem(MI, opNum, O);
85 }
86
87 void printARIPD8Mem(const MCInst *MI, unsigned opNum, raw_ostream &O) {
88 printARIPDMem(MI, opNum, O);
89 }
90 void printARIPD16Mem(const MCInst *MI, unsigned opNum, raw_ostream &O) {
91 printARIPDMem(MI, opNum, O);
92 }
93 void printARIPD32Mem(const MCInst *MI, unsigned opNum, raw_ostream &O) {
94 printARIPDMem(MI, opNum, O);
95 }
96
97 void printARID8Mem(const MCInst *MI, unsigned opNum, raw_ostream &O) {
98 printARIDMem(MI, opNum, O);
99 }
100 void printARID16Mem(const MCInst *MI, unsigned opNum, raw_ostream &O) {
101 printARIDMem(MI, opNum, O);
102 }
103 void printARID32Mem(const MCInst *MI, unsigned opNum, raw_ostream &O) {
104 printARIDMem(MI, opNum, O);
105 }
106
107 void printARII8Mem(const MCInst *MI, unsigned opNum, raw_ostream &O) {
108 printARIIMem(MI, opNum, O);
109 }
110 void printARII16Mem(const MCInst *MI, unsigned opNum, raw_ostream &O) {
111 printARIIMem(MI, opNum, O);
112 }
113 void printARII32Mem(const MCInst *MI, unsigned opNum, raw_ostream &O) {
114 printARIIMem(MI, opNum, O);
115 }
116
117 void printAS8Mem(const MCInst *MI, unsigned opNum, raw_ostream &O) {
118 printAbsMem(MI, opNum, O);
119 }
120 void printAS16Mem(const MCInst *MI, unsigned opNum, raw_ostream &O) {
121 printAbsMem(MI, opNum, O);
122 }
123 void printAS32Mem(const MCInst *MI, unsigned opNum, raw_ostream &O) {
124 printAbsMem(MI, opNum, O);
125 }
126
127 void printAL8Mem(const MCInst *MI, unsigned opNum, raw_ostream &O) {
128 printAbsMem(MI, opNum, O);
129 }
130 void printAL16Mem(const MCInst *MI, unsigned opNum, raw_ostream &O) {
131 printAbsMem(MI, opNum, O);
132 }
133 void printAL32Mem(const MCInst *MI, unsigned opNum, raw_ostream &O) {
134 printAbsMem(MI, opNum, O);
135 }
136
137 void printPCD8Mem(const MCInst *MI, uint64_t Address, unsigned opNum,
138 raw_ostream &O) {
139 printPCDMem(MI, Address, opNum, O);
140 }
141 void printPCD16Mem(const MCInst *MI, uint64_t Address, unsigned opNum,
142 raw_ostream &O) {
143 printPCDMem(MI, Address, opNum, O);
144 }
145 void printPCD32Mem(const MCInst *MI, uint64_t Address, unsigned opNum,
146 raw_ostream &O) {
147 printPCDMem(MI, Address, opNum, O);
148 }
149
150 void printPCI8Mem(const MCInst *MI, uint64_t Address, unsigned opNum,
151 raw_ostream &O) {
152 printPCIMem(MI, Address, opNum, O);
153 }
154 void printPCI16Mem(const MCInst *MI, uint64_t Address, unsigned opNum,
155 raw_ostream &O) {
156 printPCIMem(MI, Address, opNum, O);
157 }
158 void printPCI32Mem(const MCInst *MI, uint64_t Address, unsigned opNum,
159 raw_ostream &O) {
160 printPCIMem(MI, Address, opNum, O);
161 }
162};
163} // end namespace llvm
164
165#endif // LLVM_LIB_TARGET_M68K_INSTPRINTER_M68KINSTPRINTER_H
IRTranslator LLVM IR MI
This file contains memory operand printing logics shared between AsmPrinter.
unsigned Reg
raw_pwrite_stream & OS
static bool printOperand(raw_ostream &OS, const SelectionDAG *G, const SDValue Value)
M68kInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI)
bool printAliasInstr(const MCInst *MI, uint64_t Address, raw_ostream &OS)
void printRegName(raw_ostream &OS, MCRegister Reg) override
Print the assembler register name.
std::pair< const char *, uint64_t > getMnemonic(const MCInst &MI) const override
Returns a pair containing the mnemonic for MI and the number of bits left for further processing by p...
void printInst(const MCInst *MI, uint64_t Address, StringRef Annot, const MCSubtargetInfo &STI, raw_ostream &O) override
Print the specified MCInst to the specified raw_ostream.
void printInstruction(const MCInst *MI, uint64_t Address, raw_ostream &O)
void printCustomAliasOperand(const MCInst *MI, unsigned OpIdx, unsigned PrintMethodIdx, raw_ostream &O)
static const char * getRegisterName(MCRegister Reg)
void printARIDMem(const MCInst *MI, unsigned OpNum, raw_ostream &O)
void printPCDMem(const MCInst *MI, uint64_t Address, unsigned OpNum, raw_ostream &O)
void printPCIMem(const MCInst *MI, uint64_t Address, unsigned OpNum, raw_ostream &O)
void printARIPDMem(const MCInst *MI, unsigned OpNum, raw_ostream &O)
void printARIPIMem(const MCInst *MI, unsigned OpNum, raw_ostream &O)
void printARIIMem(const MCInst *MI, unsigned OpNum, raw_ostream &O)
void printARIMem(const MCInst *MI, unsigned OpNum, raw_ostream &O)
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition: MCAsmInfo.h:56
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
Definition: MCInstPrinter.h:46
const MCInstrInfo & MII
Definition: MCInstPrinter.h:53
const MCRegisterInfo & MRI
Definition: MCInstPrinter.h:54
const MCAsmInfo & MAI
Definition: MCInstPrinter.h:52
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:185
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:26
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Wrapper class representing physical registers. Should be passed by value.
Definition: MCRegister.h:33
Generic base class for all target subtargets.
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:51
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18