36 MachineOperandType MOTy,
47 TargetFlags &= ~MipsII::MO_DLLIMPORT;
50 switch (TargetFlags) {
186 int64_t offset)
const {
204 return LowerSymbolOperand(MO, MOTy, offset);
222void MipsMCInstLower::
230 unsigned TargetFlags =
MI->getOperand(1).getTargetFlags();
231 switch (TargetFlags) {
248 if (
MI->getNumOperands() == 2) {
253 }
else if (
MI->getNumOperands() == 3) {
256 MI->getOperand(2).getMBB(),
Spec));
261 MCInst &OutMI,
int Opcode)
const {
265 unsigned TargetFlags =
MI->getOperand(2).getTargetFlags();
266 switch (TargetFlags) {
284 for (
unsigned I = 0, E = 2;
I != E; ++
I) {
289 if (
MI->getNumOperands() == 3) {
295 }
else if (
MI->getNumOperands() == 4) {
298 MI->getOperand(3).getMBB(),
Spec));
304 switch (
MI->getOpcode()) {
307 case Mips::LONG_BRANCH_LUi:
308 case Mips::LONG_BRANCH_LUi2Op:
309 case Mips::LONG_BRANCH_LUi2Op_64:
310 lowerLongBranchLUi(
MI, OutMI);
312 case Mips::LONG_BRANCH_ADDiu:
313 case Mips::LONG_BRANCH_ADDiu2Op:
314 lowerLongBranchADDiu(
MI, OutMI, Mips::ADDiu);
316 case Mips::LONG_BRANCH_DADDiu:
317 case Mips::LONG_BRANCH_DADDiu2Op:
318 lowerLongBranchADDiu(
MI, OutMI, Mips::DADDiu);
324 if (lowerLongBranch(
MI, OutMI))
This class is intended to be used as a driving class for all asm writers.
virtual MCSymbol * GetCPISymbol(unsigned CPID) const
Return the symbol for the specified constant pool entry.
MCSymbol * GetJTISymbol(unsigned JTID, bool isLinkerPrivate=false) const
Return the symbol for the specified jump table entry.
void getNameWithPrefix(SmallVectorImpl< char > &Name, const GlobalValue *GV) const
MCSymbol * GetBlockAddressSymbol(const BlockAddress *BA) const
Return the MCSymbol used to satisfy BlockAddress uses of the specified basic block.
MCSymbol * GetExternalSymbolSymbol(const Twine &Sym) const
Return the MCSymbol for the specified ExternalSymbol.
Binary assembler expressions.
static const MCBinaryExpr * createAdd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx, SMLoc Loc=SMLoc())
static const MCBinaryExpr * createSub(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static LLVM_ABI const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)
Context object for machine code objects.
LLVM_ABI MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
Base class for the full range of assembler expressions which are needed for parsing.
Instances of this class represent a single low-level machine instruction.
void addOperand(const MCOperand Op)
void setOpcode(unsigned Op)
Instances of this class represent operands of the MCInst class.
static MCOperand createExpr(const MCExpr *Val)
static MCOperand createReg(MCRegister Reg)
static MCOperand createImm(int64_t Val)
static const MCSpecifierExpr * create(const MCExpr *Expr, Spec S, MCContext &Ctx, SMLoc Loc=SMLoc())
Represent a reference to a symbol from inside an expression.
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx, SMLoc Loc=SMLoc())
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
LLVM_ABI MCSymbol * getSymbol() const
Return the MCSymbol for this basic block.
Representation of each machine instruction.
MachineOperand class - Representation of each machine instruction operand.
const GlobalValue * getGlobal() const
MachineBasicBlock * getMBB() const
const BlockAddress * getBlockAddress() const
unsigned getTargetFlags() const
MachineOperandType getType() const
getType - Returns the MachineOperandType for this operand.
const char * getSymbolName() const
Register getReg() const
getReg - Returns the register number.
MCSymbol * getMCSymbol() const
@ MO_Immediate
Immediate operand.
@ MO_ConstantPoolIndex
Address of indexed Constant in Constant Pool.
@ MO_MCSymbol
MCSymbol reference (for debug/eh info)
@ MO_GlobalAddress
Address of a global value.
@ MO_RegisterMask
Mask of preserved registers.
@ MO_BlockAddress
Address of a basic block.
@ MO_MachineBasicBlock
MachineBasicBlock reference.
@ MO_Register
Register operand.
@ MO_ExternalSymbol
Name of external global symbol.
@ MO_JumpTableIndex
Address of indexed Jump Table for switch.
int64_t getOffset() const
Return the offset from the symbol in this operand.
void Lower(const MachineInstr *MI, MCInst &OutMI) const
MCOperand LowerOperand(const MachineOperand &MO, int64_t offset=0) const
void Initialize(MCContext *C)
MipsMCInstLower(MipsAsmPrinter &asmprinter)
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ C
The default llvm calling convention, compatible with C.
const MCSpecifierExpr * createGpOff(const MCExpr *Expr, Specifier S, MCContext &Ctx)
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)
@ Sub
Subtraction of integers.