• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===- PPCInstPrinter.h - Convert PPC MCInst to assembly syntax -*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This class prints an PPC MCInst to a .s file.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_POWERPC_INSTPRINTER_PPCINSTPRINTER_H
15 #define LLVM_LIB_TARGET_POWERPC_INSTPRINTER_PPCINSTPRINTER_H
16 
17 #include "llvm/MC/MCInstPrinter.h"
18 
19 namespace llvm {
20 
21 class PPCInstPrinter : public MCInstPrinter {
22   bool IsDarwin;
23 public:
PPCInstPrinter(const MCAsmInfo & MAI,const MCInstrInfo & MII,const MCRegisterInfo & MRI,bool isDarwin)24   PPCInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII,
25                  const MCRegisterInfo &MRI, bool isDarwin)
26     : MCInstPrinter(MAI, MII, MRI), IsDarwin(isDarwin) {}
27 
isDarwinSyntax()28   bool isDarwinSyntax() const {
29     return IsDarwin;
30   }
31 
32   void printRegName(raw_ostream &OS, unsigned RegNo) const override;
33   void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot,
34                  const MCSubtargetInfo &STI) override;
35 
36   // Autogenerated by tblgen.
37   void printInstruction(const MCInst *MI, raw_ostream &O);
38   static const char *getRegisterName(unsigned RegNo);
39 
40   bool printAliasInstr(const MCInst *MI, raw_ostream &OS);
41   void printCustomAliasOperand(const MCInst *MI, unsigned OpIdx,
42                                unsigned PrintMethodIdx,
43                                raw_ostream &OS);
44 
45   void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
46   void printPredicateOperand(const MCInst *MI, unsigned OpNo,
47                              raw_ostream &O, const char *Modifier = nullptr);
48 
49   void printU1ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
50   void printU2ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
51   void printU3ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
52   void printU4ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
53   void printS5ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
54   void printU5ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
55   void printU6ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
56   void printU7ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
57   void printU8ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
58   void printU10ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
59   void printU12ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
60   void printS16ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
61   void printU16ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
62   void printBranchOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
63   void printAbsBranchOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
64   void printTLSCall(const MCInst *MI, unsigned OpNo, raw_ostream &O);
65 
66   void printcrbitm(const MCInst *MI, unsigned OpNo, raw_ostream &O);
67 
68   void printMemRegImm(const MCInst *MI, unsigned OpNo, raw_ostream &O);
69   void printMemRegReg(const MCInst *MI, unsigned OpNo, raw_ostream &O);
70 };
71 } // end namespace llvm
72 
73 #endif
74