26 #define DEBUG_TYPE "asm-printer"
28 #define GET_INSTRUCTION_NAME
29 #include "HexagonGenAsmWriter.inc"
42 RawPrinter->printInst(MI, TempStream,
"", STI);
45 auto PacketBundle = Contents.
rsplit(
'\n');
46 auto HeadTail = PacketBundle.first.split(
'\n');
47 auto Preamble =
"\t{\n\t\t";
49 while(!HeadTail.first.empty()) {
52 auto Duplex = HeadTail.first.
split(
'\v');
53 if(!Duplex.second.empty()){
54 O << Duplex.first <<
"\n";
61 HeadTail = HeadTail.second.
split(
'\n');
65 O <<
"\n\t}" << PacketBundle.second;
81 return -1U << (bits - 1);
95 return ~(-1U << (bits - 1));
97 return ~(-1U << bits);
120 void HexagonInstPrinter::setExtender(
MCInst const &MCI) {
131 MCInst const &MCI = *
I.getInst();
168 }
else if(MO.
isImm()) {
181 }
else if(MO.
isImm()) {
194 "Expecting an extendable operand");
198 }
else if (MO.
isImm()) {
199 int ImmValue = MO.
getImm();
228 O <<
" + #" << MO1.
getImm();
237 O <<
", #" << MO1.
getImm();
284 O <<
'#' << (hi ?
"HI" :
"LO") <<
"(#";
295 "Expecting an extendable operand");
void printFrameIndexOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O) const
bool isDuplex(MCInstrInfo const &MCII, MCInst const &MCI)
void printUnsignedImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O) const
void printSymbol(const MCInst *MI, unsigned OpNo, raw_ostream &O, bool hi) const
const MCInstrInfo & getMII() const
void printJumpTable(const MCInst *MI, unsigned OpNo, raw_ostream &O) const
std::unique_ptr< MCInstPrinter > RawPrinter
Describe properties that are true of each instruction in the target description file.
std::pair< StringRef, StringRef > split(char Separator) const
Split into two substrings around the first occurrence of a separator character.
static bool isExtendable(uint64_t TSFlags) LLVM_ATTRIBUTE_UNUSED
bool isBundle(MCInst const &MCI)
void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O) const
static int getMaxValue(uint64_t TSFlags)
void printNOneImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O) const
bool isOuterLoop(MCInst const &MCI)
static bool isExtended(uint64_t TSFlags)
std::pair< StringRef, StringRef > rsplit(char Separator) const
Split into two substrings around the last occurrence of a separator character.
void printInst(MCInst const *MI, raw_ostream &O, StringRef Annot, const MCSubtargetInfo &STI) override
Print the specified MCInst to the specified raw_ostream.
bool isImmext(MCInst const &MCI)
void printBranchOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O) const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
#define HEXAGON_PACKET_SIZE
void printConstantPool(const MCInst *MI, unsigned OpNo, raw_ostream &O) const
unsigned getReg() const
Returns the register number.
void printMEMriOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O) const
void printInst(MCInst const *MI, raw_ostream &O, StringRef Annot, MCSubtargetInfo const &STI) override
Print the specified MCInst to the specified raw_ostream.
void printExtOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O) const
Instances of this class represent a single low-level machine instruction.
static const char * getRegisterName(unsigned RegNo)
const MCExpr * getExpr() const
void print(raw_ostream &OS, const MCAsmInfo *MAI) const
HexagonAsmInstPrinter(MCInstPrinter *RawPrinter)
void printNegImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O) const
const char * getName(unsigned Opcode) const
Returns the name for the instructions with the given opcode.
void printRegName(raw_ostream &O, unsigned RegNo) const override
Print the assembler register name.
void printAbsAddrOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O) const
#define LLVM_ATTRIBUTE_UNUSED
iterator_range< MCInst::const_iterator > bundleInstructions(MCInst const &MCI)
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode...
static int getMinValue(uint64_t TSFlags)
void printImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O) const
void setOpcode(unsigned Op)
unsigned getOpcode() const
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
MCSubtargetInfo - Generic base class for all target subtargets.
const MCInst * getInst() const
size_t bundleSize(MCInst const &MCI)
void printCallOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O) const
virtual StringRef getOpcodeName(unsigned Opcode) const
bool isInnerLoop(MCInst const &MCI)
A raw_ostream that writes to an std::string.
void printInstruction(const MCInst *MI, raw_ostream &O)
void printExtBrtarget(const MCInst *MI, unsigned OpNo, raw_ostream &O) const
This class implements an extremely fast bulk output stream that can only output to a stream...
StringRef - Represent a constant reference to a string, i.e.
void printPredicateOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O) const
void printRegName(raw_ostream &OS, unsigned RegNo) const override
Print the assembler register name.
Instances of this class represent operands of the MCInst class.
void printGlobalOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O) const
const MCOperand & getOperand(unsigned i) const