Path: blob/main/contrib/llvm-project/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZInstPrinter.h
35294 views
//==- SystemZInstPrinter.h - Convert SystemZ MCInst to assembly --*- C++ -*-==//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// This class prints a SystemZ MCInst to a .s file.9//10//===----------------------------------------------------------------------===//1112#ifndef LLVM_LIB_TARGET_SYSTEMZ_MCTARGETDESC_SYSTEMZINSTPRINTER_H13#define LLVM_LIB_TARGET_SYSTEMZ_MCTARGETDESC_SYSTEMZINSTPRINTER_H1415#include "SystemZMCAsmInfo.h"16#include "llvm/MC/MCInstPrinter.h"17#include <cstdint>1819namespace llvm {2021class MCOperand;2223class SystemZInstPrinter : public MCInstPrinter {24public:25SystemZInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII,26const MCRegisterInfo &MRI)27: MCInstPrinter(MAI, MII, MRI) {}2829// Automatically generated by tblgen.30std::pair<const char *, uint64_t> getMnemonic(const MCInst *MI) override;31void printInstruction(const MCInst *MI, uint64_t Address, raw_ostream &O);32static const char *getRegisterName(MCRegister Reg);3334// Print an address with the given base, displacement and index.35void printAddress(const MCAsmInfo *MAI, MCRegister Base,36const MCOperand &DispMO, MCRegister Index, raw_ostream &O);3738// Print the given operand.39void printOperand(const MCOperand &MO, const MCAsmInfo *MAI, raw_ostream &O);4041void printFormattedRegName(const MCAsmInfo *MAI, MCRegister Reg,42raw_ostream &O) const;4344// Override MCInstPrinter.45void printRegName(raw_ostream &O, MCRegister Reg) const override;4647void printInst(const MCInst *MI, uint64_t Address, StringRef Annot,48const MCSubtargetInfo &STI, raw_ostream &O) override;4950private:51template <unsigned N>52void printUImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);53template <unsigned N>54void printSImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);5556// Print various types of operand.57void printOperand(const MCInst *MI, int OpNum, raw_ostream &O);58void printOperand(const MCInst *MI, uint64_t /*Address*/, unsigned OpNum,59raw_ostream &O) {60printOperand(MI, OpNum, O);61}62void printBDAddrOperand(const MCInst *MI, int OpNum, raw_ostream &O);63void printBDXAddrOperand(const MCInst *MI, int OpNum, raw_ostream &O);64void printBDLAddrOperand(const MCInst *MI, int OpNum, raw_ostream &O);65void printBDRAddrOperand(const MCInst *MI, int OpNum, raw_ostream &O);66void printBDVAddrOperand(const MCInst *MI, int OpNum, raw_ostream &O);67void printU1ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);68void printU2ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);69void printU3ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);70void printU4ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);71void printS8ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);72void printU8ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);73void printU12ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);74void printS16ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);75void printU16ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);76void printS32ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);77void printU32ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);78void printU48ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);79void printPCRelOperand(const MCInst *MI, int OpNum, raw_ostream &O);80void printPCRelOperand(const MCInst *MI, uint64_t /*Address*/, int OpNum,81raw_ostream &O) {82printPCRelOperand(MI, OpNum, O);83}84void printPCRelTLSOperand(const MCInst *MI, uint64_t Address, int OpNum,85raw_ostream &O);8687// Print the mnemonic for a condition-code mask ("ne", "lh", etc.)88// This forms part of the instruction name rather than the operand list.89void printCond4Operand(const MCInst *MI, int OpNum, raw_ostream &O);90};9192} // end namespace llvm9394#endif // LLVM_LIB_TARGET_SYSTEMZ_MCTARGETDESC_SYSTEMZINSTPRINTER_H959697