} // end anonymous namespace
-namespace llvm {
-
-extern const MCInstrDesc MipsInsts[];
-
-} // end namespace llvm
-
-static const MCInstrDesc &getInstDesc(unsigned Opcode) {
- return MipsInsts[Opcode];
-}
-
static bool hasShortDelaySlot(MCInst &Inst) {
switch (Inst.getOpcode()) {
case Mips::BEQ_MM:
return false;
}
-static bool needsExpandMemInst(MCInst &Inst) {
- const MCInstrDesc &MCID = getInstDesc(Inst.getOpcode());
-
+static bool needsExpandMemInst(MCInst &Inst, const MCInstrDesc &MCID) {
unsigned NumOp = MCID.getNumOperands();
if (NumOp != 3 && NumOp != 4)
return false;
const MCSubtargetInfo *STI) {
MipsTargetStreamer &TOut = getTargetStreamer();
const unsigned Opcode = Inst.getOpcode();
- const MCInstrDesc &MCID = getInstDesc(Opcode);
+ const MCInstrDesc &MCID = MII.get(Opcode);
bool ExpandedJalSym = false;
Inst.setLoc(IDLoc);
if (MCID.mayLoad() || MCID.mayStore()) {
// Check the offset of memory operand, if it is a symbol
// reference or immediate we may have to expand instructions.
- if (needsExpandMemInst(Inst)) {
- const MCInstrDesc &MCID = getInstDesc(Inst.getOpcode());
+ if (needsExpandMemInst(Inst, MCID)) {
switch (MCID.OpInfo[MCID.getNumOperands() - 1].OperandType) {
case MipsII::OPERAND_MEM_SIMM9:
expandMem9Inst(Inst, IDLoc, Out, STI, MCID.mayLoad());
// If .set reorder is active and branch instruction has a delay slot,
// emit a NOP after it.
- const MCInstrDesc &MCID = getInstDesc(JalrInst.getOpcode());
+ const MCInstrDesc &MCID = MII.get(JalrInst.getOpcode());
if (MCID.hasDelaySlot() && AssemblerOptions.back()->isReorder())
TOut.emitEmptyDelaySlot(hasShortDelaySlot(JalrInst), IDLoc,
STI);
const MCSubtargetInfo *STI) {
MipsTargetStreamer &TOut = getTargetStreamer();
- assert(getInstDesc(Inst.getOpcode()).getNumOperands() == 1 &&
+ assert(MII.get(Inst.getOpcode()).getNumOperands() == 1 &&
"unexpected number of operands");
MCOperand Offset = Inst.getOperand(0);
// If .set reorder is active and branch instruction has a delay slot,
// emit a NOP after it.
- const MCInstrDesc &MCID = getInstDesc(Inst.getOpcode());
+ const MCInstrDesc &MCID = MII.get(Inst.getOpcode());
if (MCID.hasDelaySlot() && AssemblerOptions.back()->isReorder())
TOut.emitEmptyDelaySlot(true, IDLoc, STI);
unsigned BaseReg = BaseRegOp.getReg();
unsigned TmpReg = DstReg;
- const MCInstrDesc &Desc = getInstDesc(OpCode);
+ const MCInstrDesc &Desc = MII.get(OpCode);
int16_t DstRegClass = Desc.OpInfo[StartOp].RegClass;
unsigned DstRegClassID =
getContext().getRegisterInfo()->getRegClass(DstRegClass).getID();
unsigned BaseReg = BaseRegOp.getReg();
unsigned TmpReg = DstReg;
- const MCInstrDesc &Desc = getInstDesc(OpCode);
+ const MCInstrDesc &Desc = MII.get(OpCode);
int16_t DstRegClass = Desc.OpInfo[StartOp].RegClass;
unsigned DstRegClassID =
getContext().getRegisterInfo()->getRegClass(DstRegClass).getID();
return Match_Success;
}
- uint64_t TSFlags = getInstDesc(Inst.getOpcode()).TSFlags;
+ uint64_t TSFlags = MII.get(Inst.getOpcode()).TSFlags;
if ((TSFlags & MipsII::HasFCCRegOperand) &&
(Inst.getOperand(0).getReg() != Mips::FCC0) && !hasEightFccRegisters())
return Match_NoFCCRegisterForCurrentISA;