2012-02-18 12:03:15 +00:00
|
|
|
//===- PPCInstPrinter.h - Convert PPC MCInst to assembly syntax -*- C++ -*-===//
|
2010-11-14 19:40:38 +00:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This class prints an PPC MCInst to a .s file.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef PPCINSTPRINTER_H
|
|
|
|
#define PPCINSTPRINTER_H
|
|
|
|
|
|
|
|
#include "llvm/MC/MCInstPrinter.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
2011-03-21 04:13:46 +00:00
|
|
|
|
|
|
|
class MCOperand;
|
2010-11-14 19:40:38 +00:00
|
|
|
|
|
|
|
class PPCInstPrinter : public MCInstPrinter {
|
2010-11-14 20:02:39 +00:00
|
|
|
// 0 -> AIX, 1 -> Darwin.
|
|
|
|
unsigned SyntaxVariant;
|
2010-11-14 19:40:38 +00:00
|
|
|
public:
|
2012-04-02 06:09:36 +00:00
|
|
|
PPCInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII,
|
|
|
|
const MCRegisterInfo &MRI, unsigned syntaxVariant)
|
|
|
|
: MCInstPrinter(MAI, MII, MRI), SyntaxVariant(syntaxVariant) {}
|
2010-11-14 20:02:39 +00:00
|
|
|
|
|
|
|
bool isDarwinSyntax() const {
|
|
|
|
return SyntaxVariant == 1;
|
|
|
|
}
|
2010-11-14 19:40:38 +00:00
|
|
|
|
2011-06-02 02:34:55 +00:00
|
|
|
virtual void printRegName(raw_ostream &OS, unsigned RegNo) const;
|
2011-09-15 23:38:46 +00:00
|
|
|
virtual void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot);
|
2010-11-14 19:40:38 +00:00
|
|
|
|
|
|
|
// Autogenerated by tblgen.
|
|
|
|
void printInstruction(const MCInst *MI, raw_ostream &O);
|
|
|
|
static const char *getRegisterName(unsigned RegNo);
|
|
|
|
|
|
|
|
|
2010-11-14 20:02:39 +00:00
|
|
|
void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
|
2010-11-14 19:40:38 +00:00
|
|
|
void printPredicateOperand(const MCInst *MI, unsigned OpNo,
|
2012-06-22 23:10:08 +00:00
|
|
|
raw_ostream &O, const char *Modifier = 0);
|
2010-11-14 19:40:38 +00:00
|
|
|
|
|
|
|
|
2010-11-14 20:11:21 +00:00
|
|
|
void printS5ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
|
|
|
|
void printU5ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
|
|
|
|
void printU6ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
|
|
|
|
void printS16ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
|
|
|
|
void printU16ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
|
2010-11-14 21:20:46 +00:00
|
|
|
void printBranchOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
|
2013-06-24 11:03:33 +00:00
|
|
|
void printAbsBranchOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
|
2010-11-14 19:40:38 +00:00
|
|
|
|
2010-11-14 20:22:56 +00:00
|
|
|
void printcrbitm(const MCInst *MI, unsigned OpNo, raw_ostream &O);
|
2010-11-14 19:40:38 +00:00
|
|
|
|
2010-11-14 20:22:56 +00:00
|
|
|
void printMemRegImm(const MCInst *MI, unsigned OpNo, raw_ostream &O);
|
|
|
|
void printMemRegReg(const MCInst *MI, unsigned OpNo, raw_ostream &O);
|
2010-11-14 19:40:38 +00:00
|
|
|
};
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|