181ad6265SDimitry Andric //===-- LoongArchInstPrinter.h - Convert LoongArch MCInst to asm syntax ---===// 281ad6265SDimitry Andric // 381ad6265SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 481ad6265SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 581ad6265SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 681ad6265SDimitry Andric // 781ad6265SDimitry Andric //===----------------------------------------------------------------------===// 881ad6265SDimitry Andric // 981ad6265SDimitry Andric // This class prints a LoongArch MCInst to a .s file. 1081ad6265SDimitry Andric // 1181ad6265SDimitry Andric //===----------------------------------------------------------------------===// 1281ad6265SDimitry Andric 1381ad6265SDimitry Andric #ifndef LLVM_LIB_TARGET_LOONGARCH_MCTARGETDESC_LOONGARCHINSTPRINTER_H 1481ad6265SDimitry Andric #define LLVM_LIB_TARGET_LOONGARCH_MCTARGETDESC_LOONGARCHINSTPRINTER_H 1581ad6265SDimitry Andric 1681ad6265SDimitry Andric #include "MCTargetDesc/LoongArchMCTargetDesc.h" 1781ad6265SDimitry Andric #include "llvm/MC/MCInstPrinter.h" 1881ad6265SDimitry Andric 1981ad6265SDimitry Andric namespace llvm { 2081ad6265SDimitry Andric 2181ad6265SDimitry Andric class LoongArchInstPrinter : public MCInstPrinter { 2281ad6265SDimitry Andric public: LoongArchInstPrinter(const MCAsmInfo & MAI,const MCInstrInfo & MII,const MCRegisterInfo & MRI)2381ad6265SDimitry Andric LoongArchInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII, 2481ad6265SDimitry Andric const MCRegisterInfo &MRI) 2581ad6265SDimitry Andric : MCInstPrinter(MAI, MII, MRI) {} 2681ad6265SDimitry Andric 27*bdd1243dSDimitry Andric bool applyTargetSpecificCLOption(StringRef Opt) override; 28*bdd1243dSDimitry Andric 2981ad6265SDimitry Andric void printInst(const MCInst *MI, uint64_t Address, StringRef Annot, 3081ad6265SDimitry Andric const MCSubtargetInfo &STI, raw_ostream &O) override; 31*bdd1243dSDimitry Andric void printRegName(raw_ostream &O, MCRegister Reg) const override; 32*bdd1243dSDimitry Andric void printAtomicMemOp(const MCInst *MI, unsigned OpNo, 33*bdd1243dSDimitry Andric const MCSubtargetInfo &STI, raw_ostream &O); 3481ad6265SDimitry Andric 3581ad6265SDimitry Andric // Autogenerated by tblgen. 3681ad6265SDimitry Andric std::pair<const char *, uint64_t> getMnemonic(const MCInst *MI) override; 3781ad6265SDimitry Andric void printInstruction(const MCInst *MI, uint64_t Address, 3881ad6265SDimitry Andric const MCSubtargetInfo &STI, raw_ostream &O); 3981ad6265SDimitry Andric bool printAliasInstr(const MCInst *MI, uint64_t Address, 4081ad6265SDimitry Andric const MCSubtargetInfo &STI, raw_ostream &O); 4181ad6265SDimitry Andric void printCustomAliasOperand(const MCInst *MI, uint64_t Address, 4281ad6265SDimitry Andric unsigned OpIdx, unsigned PrintMethodIdx, 4381ad6265SDimitry Andric const MCSubtargetInfo &STI, raw_ostream &O); 44*bdd1243dSDimitry Andric static const char *getRegisterName(MCRegister Reg); 45*bdd1243dSDimitry Andric static const char *getRegisterName(MCRegister Reg, unsigned AltIdx); 4681ad6265SDimitry Andric 4781ad6265SDimitry Andric private: 4881ad6265SDimitry Andric void printOperand(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, 4981ad6265SDimitry Andric raw_ostream &O); 5081ad6265SDimitry Andric }; 51972a253aSDimitry Andric } // end namespace llvm 5281ad6265SDimitry Andric 5381ad6265SDimitry Andric #endif // LLVM_LIB_TARGET_LOONGARCH_MCTARGETDESC_LOONGARCHINSTPRINTER_H 54