LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MipsInstPrinter.h
Go to the documentation of this file.
1 //=== MipsInstPrinter.h - Convert Mips 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 a Mips MCInst to a .s file.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef MIPSINSTPRINTER_H
15 #define MIPSINSTPRINTER_H
16 #include "llvm/MC/MCInstPrinter.h"
17 
18 namespace llvm {
19 // These enumeration declarations were originally in MipsInstrInfo.h but
20 // had to be moved here to avoid circular dependencies between
21 // LLVMMipsCodeGen and LLVMMipsAsmPrinter.
22 namespace Mips {
23 // Mips Branch Codes
30 };
31 
32 // Mips Condition Codes
33 enum CondCode {
34  // To be used with float branch True
51 
52  // To be used with float branch False
53  // This conditions have the same mnemonic as the
54  // above ones, but are used with a branch False;
71 };
72 
73 const char *MipsFCCToString(Mips::CondCode CC);
74 } // end namespace Mips
75 
76 class TargetMachine;
77 
79 public:
81  const MCRegisterInfo &MRI)
82  : MCInstPrinter(MAI, MII, MRI) {}
83 
84  // Autogenerated by tblgen.
85  void printInstruction(const MCInst *MI, raw_ostream &O);
86  static const char *getRegisterName(unsigned RegNo);
87 
88  virtual void printRegName(raw_ostream &OS, unsigned RegNo) const;
89  virtual void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot);
90 
91  bool printAliasInstr(const MCInst *MI, raw_ostream &OS);
92 
93 private:
94  void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
95  void printUnsignedImm(const MCInst *MI, int opNum, raw_ostream &O);
96  void printUnsignedImm8(const MCInst *MI, int opNum, raw_ostream &O);
97  void printMemOperand(const MCInst *MI, int opNum, raw_ostream &O);
98  void printMemOperandEA(const MCInst *MI, int opNum, raw_ostream &O);
99  void printFCCOperand(const MCInst *MI, int opNum, raw_ostream &O);
100  void printSHFMask(const MCInst *MI, int opNum, raw_ostream &O);
101 
102  bool printAlias(const char *Str, const MCInst &MI, unsigned OpNo,
103  raw_ostream &OS);
104  bool printAlias(const char *Str, const MCInst &MI, unsigned OpNo0,
105  unsigned OpNo1, raw_ostream &OS);
106  bool printAlias(const MCInst &MI, raw_ostream &OS);
107 };
108 } // end namespace llvm
109 
110 #endif
bool printAliasInstr(const MCInst *MI, raw_ostream &OS)
MipsInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI)
const char * MipsFCCToString(Mips::CondCode CC)
virtual void printRegName(raw_ostream &OS, unsigned RegNo) const
printRegName - Print the assembler register name.
const MCAsmInfo & MAI
Definition: MCInstPrinter.h:39
const MCInstrInfo & MII
Definition: MCInstPrinter.h:40
static const char * getRegisterName(unsigned RegNo)
void printInstruction(const MCInst *MI, raw_ostream &O)
virtual void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot)
const MCRegisterInfo & MRI
Definition: MCInstPrinter.h:41