xref: /aosp_15_r20/external/llvm/lib/Target/Sparc/InstPrinter/SparcInstPrinter.h (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker //===-- SparcInstPrinter.h - Convert Sparc MCInst to assembly syntax ------===//
2*9880d681SAndroid Build Coastguard Worker //
3*9880d681SAndroid Build Coastguard Worker //                     The LLVM Compiler Infrastructure
4*9880d681SAndroid Build Coastguard Worker //
5*9880d681SAndroid Build Coastguard Worker // This file is distributed under the University of Illinois Open Source
6*9880d681SAndroid Build Coastguard Worker // License. See LICENSE.TXT for details.
7*9880d681SAndroid Build Coastguard Worker //
8*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
9*9880d681SAndroid Build Coastguard Worker //
10*9880d681SAndroid Build Coastguard Worker // This class prints an Sparc MCInst to a .s file.
11*9880d681SAndroid Build Coastguard Worker //
12*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
13*9880d681SAndroid Build Coastguard Worker 
14*9880d681SAndroid Build Coastguard Worker #ifndef LLVM_LIB_TARGET_SPARC_INSTPRINTER_SPARCINSTPRINTER_H
15*9880d681SAndroid Build Coastguard Worker #define LLVM_LIB_TARGET_SPARC_INSTPRINTER_SPARCINSTPRINTER_H
16*9880d681SAndroid Build Coastguard Worker 
17*9880d681SAndroid Build Coastguard Worker #include "llvm/MC/MCInstPrinter.h"
18*9880d681SAndroid Build Coastguard Worker 
19*9880d681SAndroid Build Coastguard Worker namespace llvm {
20*9880d681SAndroid Build Coastguard Worker 
21*9880d681SAndroid Build Coastguard Worker class SparcInstPrinter : public MCInstPrinter {
22*9880d681SAndroid Build Coastguard Worker public:
SparcInstPrinter(const MCAsmInfo & MAI,const MCInstrInfo & MII,const MCRegisterInfo & MRI)23*9880d681SAndroid Build Coastguard Worker   SparcInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII,
24*9880d681SAndroid Build Coastguard Worker                    const MCRegisterInfo &MRI)
25*9880d681SAndroid Build Coastguard Worker       : MCInstPrinter(MAI, MII, MRI) {}
26*9880d681SAndroid Build Coastguard Worker 
27*9880d681SAndroid Build Coastguard Worker   void printRegName(raw_ostream &OS, unsigned RegNo) const override;
28*9880d681SAndroid Build Coastguard Worker   void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot,
29*9880d681SAndroid Build Coastguard Worker                  const MCSubtargetInfo &STI) override;
30*9880d681SAndroid Build Coastguard Worker   bool printSparcAliasInstr(const MCInst *MI, const MCSubtargetInfo &STI,
31*9880d681SAndroid Build Coastguard Worker                             raw_ostream &OS);
32*9880d681SAndroid Build Coastguard Worker   bool isV9(const MCSubtargetInfo &STI) const;
33*9880d681SAndroid Build Coastguard Worker 
34*9880d681SAndroid Build Coastguard Worker   // Autogenerated by tblgen.
35*9880d681SAndroid Build Coastguard Worker   void printInstruction(const MCInst *MI, const MCSubtargetInfo &STI,
36*9880d681SAndroid Build Coastguard Worker                         raw_ostream &O);
37*9880d681SAndroid Build Coastguard Worker   bool printAliasInstr(const MCInst *MI, const MCSubtargetInfo &STI,
38*9880d681SAndroid Build Coastguard Worker                        raw_ostream &O);
39*9880d681SAndroid Build Coastguard Worker   void printCustomAliasOperand(const MCInst *MI, unsigned OpIdx,
40*9880d681SAndroid Build Coastguard Worker                                unsigned PrintMethodIdx,
41*9880d681SAndroid Build Coastguard Worker                                const MCSubtargetInfo &STI, raw_ostream &O);
42*9880d681SAndroid Build Coastguard Worker   static const char *getRegisterName(unsigned RegNo);
43*9880d681SAndroid Build Coastguard Worker 
44*9880d681SAndroid Build Coastguard Worker   void printOperand(const MCInst *MI, int opNum, const MCSubtargetInfo &STI,
45*9880d681SAndroid Build Coastguard Worker                     raw_ostream &OS);
46*9880d681SAndroid Build Coastguard Worker   void printMemOperand(const MCInst *MI, int opNum, const MCSubtargetInfo &STI,
47*9880d681SAndroid Build Coastguard Worker                        raw_ostream &OS, const char *Modifier = nullptr);
48*9880d681SAndroid Build Coastguard Worker   void printCCOperand(const MCInst *MI, int opNum, const MCSubtargetInfo &STI,
49*9880d681SAndroid Build Coastguard Worker                       raw_ostream &OS);
50*9880d681SAndroid Build Coastguard Worker   bool printGetPCX(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
51*9880d681SAndroid Build Coastguard Worker                    raw_ostream &OS);
52*9880d681SAndroid Build Coastguard Worker };
53*9880d681SAndroid Build Coastguard Worker } // end namespace llvm
54*9880d681SAndroid Build Coastguard Worker 
55*9880d681SAndroid Build Coastguard Worker #endif
56