28 #define DEBUG_TYPE "asm-printer" 33 #define PRINT_ALIAS_INSTR 34 #include "AVRGenAsmWriter.inc" 48 printOperand(MI, 0, O);
51 if (Opcode == AVR::LDRdPtrPd)
54 printOperand(MI, 1, O);
56 if (Opcode == AVR::LDRdPtrPi)
61 printOperand(MI, 0, O);
63 printOperand(MI, 1, O);
69 if (Opcode == AVR::STPtrPdRr)
72 printOperand(MI, 1, O);
74 if (Opcode == AVR::STPtrPiRr)
78 printOperand(MI, 2, O);
81 if (!printAliasInstr(MI, O))
82 printInstruction(MI, O);
94 unsigned RegLoNum = MRI.
getSubReg(RegNum, AVR::sub_lo);
95 RegNum = (RegLoNum != AVR::NoRegister) ? RegLoNum : RegNum;
98 return getRegisterName(RegNum);
101 void AVRInstPrinter::printOperand(
const MCInst *
MI,
unsigned OpNo,
107 bool isPtrReg = (MOI.
RegClass == AVR::PTRREGSRegClassID) ||
108 (MOI.
RegClass == AVR::PTRDISPREGSRegClassID) ||
109 (MOI.
RegClass == AVR::ZREGRegClassID);
112 O << getRegisterName(Op.
getReg(), AVR::ptr);
116 }
else if (Op.
isImm()) {
119 assert(Op.
isExpr() &&
"Unknown operand kind in printOperand");
126 void AVRInstPrinter::printPCRelImm(
const MCInst *MI,
unsigned OpNo,
131 int64_t Imm = Op.
getImm();
141 assert(Op.
isExpr() &&
"Unknown pcrel immediate operand");
146 void AVRInstPrinter::printMemri(
const MCInst *MI,
unsigned OpNo,
153 printOperand(MI, OpNo, O);
156 if (OffsetOp.isImm()) {
157 int64_t
Offset = OffsetOp.getImm();
163 }
else if (OffsetOp.isExpr()) {
164 O << *OffsetOp.getExpr();
This class represents lattice values for constants.
unsigned getReg() const
Returns the register number.
const MCExpr * getExpr() const
Instances of this class represent a single low-level machine instruction.
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
unsigned getSubReg(unsigned Reg, unsigned Idx) const
Returns the physical register number of sub-register "Index" for physical register RegNo...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
const MCOperand & getOperand(unsigned i) const
void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot, const MCSubtargetInfo &STI) override
Print the specified MCInst to the specified raw_ostream.
int16_t RegClass
This specifies the register class enumeration of the operand if the operand is a register.
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode...
Generic base class for all target subtargets.
unsigned getNumSubRegIndices() const
Return the number of sub-register indices understood by the target.
static const char * getPrettyRegisterName(unsigned RegNo, MCRegisterInfo const &MRI)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void printAnnotation(raw_ostream &OS, StringRef Annot)
Utility function for printing annotations.
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.
This holds information about one operand of a machine instruction, indicating the register class for ...
unsigned getOpcode() const
Instances of this class represent operands of the MCInst class.
const MCRegisterInfo & MRI