LLVM 22.0.0git
XtensaInstPrinter.h
Go to the documentation of this file.
1//===- XtensaInstPrinter.h - Convert Xtensa MCInst to asm syntax -*- C++ -*-==//
2//
3// The LLVM Compiler Infrastructure
4//
5// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
6// See https://llvm.org/LICENSE.txt for license information.
7// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8//
9//===----------------------------------------------------------------------===//
10//
11// This class prints an Xtensa MCInst to a .s file.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_LIB_TARGET_XTENSA_MCTARGETDESC_XTENSAINSTPRINTER_H
16#define LLVM_LIB_TARGET_XTENSA_MCTARGETDESC_XTENSAINSTPRINTER_H
17
20
21namespace llvm {
22class MCOperand;
23
25public:
27 const MCRegisterInfo &MRI)
28 : MCInstPrinter(MAI, MII, MRI) {}
29
30 // Automatically generated by tblgen.
31 std::pair<const char *, uint64_t>
32 getMnemonic(const MCInst &MI) const override;
34 static const char *getRegisterName(MCRegister Reg);
35
36 // Print the given operand.
37 static void printOperand(const MCOperand &MO, raw_ostream &O);
38
39 // Override MCInstPrinter.
40 void printRegName(raw_ostream &O, MCRegister Reg) override;
41 void printInst(const MCInst *MI, uint64_t Address, StringRef Annot,
42 const MCSubtargetInfo &STI, raw_ostream &O) override;
43
44private:
45 // Print various types of operand.
46 void printOperand(const MCInst *MI, int OpNum, raw_ostream &O);
47 void printMemOperand(const MCInst *MI, int OpNUm, raw_ostream &O);
48 void printBranchTarget(const MCInst *MI, uint64_t Address, int OpNum,
49 raw_ostream &O);
50 void printLoopTarget(const MCInst *MI, uint64_t Address, int OpNum,
51 raw_ostream &O);
52 void printJumpTarget(const MCInst *MI, uint64_t Address, int OpNum,
53 raw_ostream &O);
54 void printCallOperand(const MCInst *MI, uint64_t Address, int OpNum,
55 raw_ostream &O);
56 void printL32RTarget(const MCInst *MI, uint64_t Address, int OpNum,
57 raw_ostream &O);
58 void printPCRelImm(uint64_t Address, int64_t Offset, raw_ostream &O);
59
60 void printImm8_AsmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
61 void printImm8_sh8_AsmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
62 void printImm12_AsmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
63 void printImm12m_AsmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
64 void printUimm4_AsmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
65 void printUimm5_AsmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
66 void printShimm1_31_AsmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
67 void printImm1_16_AsmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
68 void printImm1n_15_AsmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
69 void printImm32n_95_AsmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
70 void printImm8n_7_AsmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
71 void printImm64n_4n_AsmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
72 void printOffset8m8_AsmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
73 void printOffset8m16_AsmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
74 void printOffset8m32_AsmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
75 void printOffset4m32_AsmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
76 void printEntry_Imm12_AsmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
77 void printB4const_AsmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
78 void printB4constu_AsmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
79 void printImm7_22_AsmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
80};
81} // end namespace llvm
82
83#endif /* LLVM_LIB_TARGET_XTENSA_MCTARGETDESC_XTENSAINSTPRINTER_H */
IRTranslator LLVM IR MI
Register Reg
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition: MCAsmInfo.h:64
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:188
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:27
Instances of this class represent operands of the MCInst class.
Definition: MCInst.h:40
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:55
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)
static const char * getRegisterName(MCRegister Reg)
void printRegName(raw_ostream &O, MCRegister Reg) override
Print the assembler register name.
static void printOperand(const MCOperand &MO, raw_ostream &O)
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...
XtensaInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI)
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
@ Offset
Definition: DWP.cpp:477