10b57cec5SDimitry Andric //===-- SparcInstPrinter.h - Convert Sparc MCInst to assembly syntax ------===// 20b57cec5SDimitry Andric // 30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 60b57cec5SDimitry Andric // 70b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 80b57cec5SDimitry Andric // 90b57cec5SDimitry Andric // This class prints an Sparc MCInst to a .s file. 100b57cec5SDimitry Andric // 110b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 120b57cec5SDimitry Andric 130b57cec5SDimitry Andric #ifndef LLVM_LIB_TARGET_SPARC_MCTARGETDESC_SPARCINSTPRINTER_H 140b57cec5SDimitry Andric #define LLVM_LIB_TARGET_SPARC_MCTARGETDESC_SPARCINSTPRINTER_H 150b57cec5SDimitry Andric 165f757f3fSDimitry Andric #include "SparcMCTargetDesc.h" 170b57cec5SDimitry Andric #include "llvm/MC/MCInstPrinter.h" 180b57cec5SDimitry Andric 190b57cec5SDimitry Andric namespace llvm { 200b57cec5SDimitry Andric 210b57cec5SDimitry Andric class SparcInstPrinter : public MCInstPrinter { 220b57cec5SDimitry Andric public: SparcInstPrinter(const MCAsmInfo & MAI,const MCInstrInfo & MII,const MCRegisterInfo & MRI)230b57cec5SDimitry Andric SparcInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII, 240b57cec5SDimitry Andric const MCRegisterInfo &MRI) 250b57cec5SDimitry Andric : MCInstPrinter(MAI, MII, MRI) {} 260b57cec5SDimitry Andric 27bdd1243dSDimitry Andric void printRegName(raw_ostream &OS, MCRegister Reg) const override; 285f757f3fSDimitry Andric void printRegName(raw_ostream &OS, MCRegister Reg, unsigned AltIdx) const; 29480093f4SDimitry Andric void printInst(const MCInst *MI, uint64_t Address, StringRef Annot, 30480093f4SDimitry Andric const MCSubtargetInfo &STI, raw_ostream &O) override; 310b57cec5SDimitry Andric bool printSparcAliasInstr(const MCInst *MI, const MCSubtargetInfo &STI, 320b57cec5SDimitry Andric raw_ostream &OS); 330b57cec5SDimitry Andric bool isV9(const MCSubtargetInfo &STI) const; 340b57cec5SDimitry Andric 350b57cec5SDimitry Andric // Autogenerated by tblgen. 36e8d8bef9SDimitry Andric std::pair<const char *, uint64_t> getMnemonic(const MCInst *MI) override; 37480093f4SDimitry Andric void printInstruction(const MCInst *MI, uint64_t Address, 38480093f4SDimitry Andric const MCSubtargetInfo &STI, raw_ostream &O); 395ffd83dbSDimitry Andric bool printAliasInstr(const MCInst *MI, uint64_t Address, 405ffd83dbSDimitry Andric const MCSubtargetInfo &STI, raw_ostream &O); 415ffd83dbSDimitry Andric void printCustomAliasOperand(const MCInst *MI, uint64_t Address, 425ffd83dbSDimitry Andric unsigned OpIdx, unsigned PrintMethodIdx, 430b57cec5SDimitry Andric const MCSubtargetInfo &STI, raw_ostream &O); 445f757f3fSDimitry Andric static const char *getRegisterName(MCRegister Reg, 455f757f3fSDimitry Andric unsigned AltIdx = SP::NoRegAltName); 460b57cec5SDimitry Andric 470b57cec5SDimitry Andric void printOperand(const MCInst *MI, int opNum, const MCSubtargetInfo &STI, 480b57cec5SDimitry Andric raw_ostream &OS); 490b57cec5SDimitry Andric void printMemOperand(const MCInst *MI, int opNum, const MCSubtargetInfo &STI, 505f757f3fSDimitry Andric raw_ostream &OS); 510b57cec5SDimitry Andric void printCCOperand(const MCInst *MI, int opNum, const MCSubtargetInfo &STI, 520b57cec5SDimitry Andric raw_ostream &OS); 530b57cec5SDimitry Andric bool printGetPCX(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, 540b57cec5SDimitry Andric raw_ostream &OS); 550b57cec5SDimitry Andric void printMembarTag(const MCInst *MI, int opNum, const MCSubtargetInfo &STI, 560b57cec5SDimitry Andric raw_ostream &O); 575f757f3fSDimitry Andric void printASITag(const MCInst *MI, int opNum, const MCSubtargetInfo &STI, 585f757f3fSDimitry Andric raw_ostream &O); 59*0fca6ea1SDimitry Andric void printPrefetchTag(const MCInst *MI, int opNum, const MCSubtargetInfo &STI, 60*0fca6ea1SDimitry Andric raw_ostream &O); 610b57cec5SDimitry Andric }; 620b57cec5SDimitry Andric } // end namespace llvm 630b57cec5SDimitry Andric 640b57cec5SDimitry Andric #endif 65