mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
d6c98ae638
Add HexagonMCInst class which adds various Hexagon VLIW annotations. In addition, this class also includes some APIs related to the constant extenders. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175634 91177308-0d34-0410-b5e6-96231b3b80d8
88 lines
3.2 KiB
C++
88 lines
3.2 KiB
C++
//===-- HexagonInstPrinter.h - Convert Hexagon MCInst to assembly syntax --===//
|
|
//
|
|
// 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 Hexagon MCInst to a .s file.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef HEXAGONINSTPRINTER_H
|
|
#define HEXAGONINSTPRINTER_H
|
|
|
|
#include "llvm/MC/MCInstPrinter.h"
|
|
#include "llvm/MC/MCInstrInfo.h"
|
|
|
|
namespace llvm {
|
|
class HexagonMCInst;
|
|
|
|
class HexagonInstPrinter : public MCInstPrinter {
|
|
public:
|
|
explicit HexagonInstPrinter(const MCAsmInfo &MAI,
|
|
const MCInstrInfo &MII,
|
|
const MCRegisterInfo &MRI)
|
|
: MCInstPrinter(MAI, MII, MRI), MII(MII) {}
|
|
|
|
virtual void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot);
|
|
void printInst(const HexagonMCInst *MI, raw_ostream &O, StringRef Annot);
|
|
virtual StringRef getOpcodeName(unsigned Opcode) const;
|
|
void printInstruction(const MCInst *MI, raw_ostream &O);
|
|
StringRef getRegName(unsigned RegNo) const;
|
|
static const char *getRegisterName(unsigned RegNo);
|
|
|
|
void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O) const;
|
|
void printImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O) const;
|
|
void printExtOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O) const;
|
|
void printUnsignedImmOperand(const MCInst *MI, unsigned OpNo,
|
|
raw_ostream &O) const;
|
|
void printNegImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O)
|
|
const;
|
|
void printNOneImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O)
|
|
const;
|
|
void printMEMriOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O)
|
|
const;
|
|
void printFrameIndexOperand(const MCInst *MI, unsigned OpNo,
|
|
raw_ostream &O) const;
|
|
void printBranchOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O)
|
|
const;
|
|
void printCallOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O)
|
|
const;
|
|
void printAbsAddrOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O)
|
|
const;
|
|
void printPredicateOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O)
|
|
const;
|
|
void printGlobalOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O)
|
|
const;
|
|
void printJumpTable(const MCInst *MI, unsigned OpNo, raw_ostream &O) const;
|
|
|
|
void printConstantPool(const MCInst *MI, unsigned OpNo,
|
|
raw_ostream &O) const;
|
|
|
|
void printSymbolHi(const MCInst *MI, unsigned OpNo, raw_ostream &O) const
|
|
{ printSymbol(MI, OpNo, O, true); }
|
|
void printSymbolLo(const MCInst *MI, unsigned OpNo, raw_ostream &O) const
|
|
{ printSymbol(MI, OpNo, O, false); }
|
|
|
|
const MCInstrInfo &getMII() const {
|
|
return MII;
|
|
}
|
|
|
|
protected:
|
|
void printSymbol(const MCInst *MI, unsigned OpNo, raw_ostream &O, bool hi)
|
|
const;
|
|
|
|
static const char PacketPadding;
|
|
|
|
private:
|
|
const MCInstrInfo &MII;
|
|
|
|
};
|
|
|
|
} // end namespace llvm
|
|
|
|
#endif
|