Path: blob/main/contrib/llvm-project/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZInstPrinterCommon.h
213845 views
//== SystemZInstPrinterCommon.h - Common SystemZ InstPrinter funcs *- 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_SYSTEMZINSTPRINTERCOMMON_H13#define LLVM_LIB_TARGET_SYSTEMZ_MCTARGETDESC_SYSTEMZINSTPRINTERCOMMON_H1415#include "SystemZMCAsmInfo.h"16#include "llvm/MC/MCInstPrinter.h"17#include "llvm/MC/MCRegister.h"18#include <cstdint>1920namespace llvm {2122class MCOperand;2324class SystemZInstPrinterCommon : public MCInstPrinter {25public:26SystemZInstPrinterCommon(const MCAsmInfo &MAI, const MCInstrInfo &MII,27const MCRegisterInfo &MRI)28: MCInstPrinter(MAI, MII, MRI) {}2930// Print an address with the given base, displacement and index.31void printAddress(const MCAsmInfo *MAI, MCRegister Base,32const MCOperand &DispMO, MCRegister Index, raw_ostream &O);3334// Print the given operand.35void printOperand(const MCOperand &MO, const MCAsmInfo *MAI, raw_ostream &O);3637virtual void printFormattedRegName(const MCAsmInfo *MAI, MCRegister Reg,38raw_ostream &O) {}3940// Override MCInstPrinter.41void printRegName(raw_ostream &O, MCRegister Reg) override;4243protected:44template <unsigned N>45void printUImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);46template <unsigned N>47void printSImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);4849// Print various types of operand.50void printOperand(const MCInst *MI, int OpNum, raw_ostream &O);51void printOperand(const MCInst *MI, uint64_t /*Address*/, unsigned OpNum,52raw_ostream &O) {53printOperand(MI, OpNum, O);54}55void printBDAddrOperand(const MCInst *MI, int OpNum, raw_ostream &O);56void printBDXAddrOperand(const MCInst *MI, int OpNum, raw_ostream &O);57void printBDLAddrOperand(const MCInst *MI, int OpNum, raw_ostream &O);58void printBDRAddrOperand(const MCInst *MI, int OpNum, raw_ostream &O);59void printBDVAddrOperand(const MCInst *MI, int OpNum, raw_ostream &O);60void printLXAAddrOperand(const MCInst *MI, int OpNum, raw_ostream &O);61void printU1ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);62void printU2ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);63void printU3ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);64void printU4ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);65void printS8ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);66void printU8ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);67void printU12ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);68void printS16ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);69void printU16ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);70void printS32ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);71void printU32ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);72void printU48ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);73void printPCRelOperand(const MCInst *MI, uint64_t Address, int OpNum,74raw_ostream &O);75void printPCRelTLSOperand(const MCInst *MI, uint64_t Address, int OpNum,76raw_ostream &O);7778// Print the mnemonic for a condition-code mask ("ne", "lh", etc.)79// This forms part of the instruction name rather than the operand list.80void printCond4Operand(const MCInst *MI, int OpNum, raw_ostream &O);81};8283} // end namespace llvm8485#endif // LLVM_LIB_TARGET_SYSTEMZ_MCTARGETDESC_SYSTEMZINSTPRINTERCOMMON_H868788