22#define DEBUG_TYPE "asm-printer"
25#include "BPFGenAsmWriter.inc"
39 }
else if (
Op.isImm()) {
42 assert(
Op.isExpr() &&
"Expected an expression");
53 assert(RegOp.
isReg() &&
"Register operand not a register");
64 assert(0 &&
"Expected an immediate");
83 if (
MI->getOpcode() == BPF::JMPL) {
84 int32_t Imm =
Op.getImm();
85 O << ((Imm >= 0) ?
"+" :
"") <<
formatImm(Imm);
87 int16_t Imm =
Op.getImm();
88 O << ((Imm >= 0) ?
"+" :
"") <<
formatImm(Imm);
90 }
else if (
Op.isExpr()) {
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
std::pair< Instruction::BinaryOps, Value * > OffsetOp
Find all possible pairs (BinOp, RHS) that BinOp V, RHS can be simplified.
void printBrTargetOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printInstruction(const MCInst *MI, uint64_t Address, raw_ostream &O)
static const char * getRegisterName(MCRegister Reg)
void printImm64Operand(const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printMemOperand(const MCInst *MI, int OpNo, raw_ostream &O)
void printInst(const MCInst *MI, uint64_t Address, StringRef Annot, const MCSubtargetInfo &STI, raw_ostream &O) override
Print the specified MCInst to the specified raw_ostream.
This class represents an Operation in the Expression.
void printExpr(raw_ostream &, const MCExpr &) const
void printAnnotation(raw_ostream &OS, StringRef Annot)
Utility function for printing annotations.
format_object< int64_t > formatImm(int64_t Value) const
Utility function to print immediates in decimal or hex.
Instances of this class represent a single low-level machine instruction.
Instances of this class represent operands of the MCInst class.
MCRegister getReg() const
Returns the register number.
Generic base class for all target subtargets.
StringRef - Represent a constant reference to a string, i.e.
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
DWARFExpression::Operation Op