[flang][cuda] Adding atomicadd as a cudadevice intrinsic and converting it LLVM diale...
[llvm-project.git] / llvm / lib / Target / M68k / MCTargetDesc / M68kInstPrinter.h
blob32ca9131d4ce7212f1feae955d16dbb490461fb0
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 //===----------------------------------------------------------------------===//
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"
20 namespace llvm {
22 class TargetMachine;
24 class M68kInstPrinter : public MCInstPrinter,
25 public M68kMemOperandPrinter<M68kInstPrinter, MCInst> {
26 friend class M68kMemOperandPrinter;
28 public:
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;
48 private:
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 //===----------------------------------------------------------------------===//
59 // Specializations
60 //===----------------------------------------------------------------------===//
62 void printPCRelImm(const MCInst *MI, uint64_t Address, unsigned opNum,
63 raw_ostream &O) {
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,
138 raw_ostream &O) {
139 printPCDMem(MI, Address, opNum, O);
141 void printPCD16Mem(const MCInst *MI, uint64_t Address, unsigned opNum,
142 raw_ostream &O) {
143 printPCDMem(MI, Address, opNum, O);
145 void printPCD32Mem(const MCInst *MI, uint64_t Address, unsigned opNum,
146 raw_ostream &O) {
147 printPCDMem(MI, Address, opNum, O);
150 void printPCI8Mem(const MCInst *MI, uint64_t Address, unsigned opNum,
151 raw_ostream &O) {
152 printPCIMem(MI, Address, opNum, O);
154 void printPCI16Mem(const MCInst *MI, uint64_t Address, unsigned opNum,
155 raw_ostream &O) {
156 printPCIMem(MI, Address, opNum, O);
158 void printPCI32Mem(const MCInst *MI, uint64_t Address, unsigned opNum,
159 raw_ostream &O) {
160 printPCIMem(MI, Address, opNum, O);
163 } // end namespace llvm
165 #endif // LLVM_LIB_TARGET_M68K_INSTPRINTER_M68KINSTPRINTER_H