Lines Matching refs:MI
82 uint64_t getBinaryCodeForInstr(const MachineInstr &MI) const;
84 void emitInstruction(MachineBasicBlock::instr_iterator MI,
102 unsigned getMachineOpValue(const MachineInstr &MI,
105 unsigned getRelocation(const MachineInstr &MI,
108 unsigned getJumpTargetOpValue(const MachineInstr &MI, unsigned OpNo) const;
109 unsigned getJumpTargetOpValueMM(const MachineInstr &MI, unsigned OpNo) const;
110 unsigned getBranchTargetOpValueMM(const MachineInstr &MI,
113 unsigned getBranchTarget21OpValue(const MachineInstr &MI,
115 unsigned getBranchTarget26OpValue(const MachineInstr &MI,
117 unsigned getJumpOffset16OpValue(const MachineInstr &MI, unsigned OpNo) const;
119 unsigned getBranchTargetOpValue(const MachineInstr &MI, unsigned OpNo) const;
120 unsigned getMemEncoding(const MachineInstr &MI, unsigned OpNo) const;
121 unsigned getMemEncodingMMImm12(const MachineInstr &MI, unsigned OpNo) const;
122 unsigned getMSAMemEncoding(const MachineInstr &MI, unsigned OpNo) const;
123 unsigned getSizeExtEncoding(const MachineInstr &MI, unsigned OpNo) const;
124 unsigned getSizeInsEncoding(const MachineInstr &MI, unsigned OpNo) const;
125 unsigned getLSAImmEncoding(const MachineInstr &MI, unsigned OpNo) const;
126 unsigned getSimm19Lsl2Encoding(const MachineInstr &MI, unsigned OpNo) const;
127 unsigned getSimm18Lsl3Encoding(const MachineInstr &MI, unsigned OpNo) const;
130 void expandACCInstr(MachineBasicBlock::instr_iterator MI,
134 bool expandPseudos(MachineBasicBlock::instr_iterator &MI,
172 unsigned MipsCodeEmitter::getRelocation(const MachineInstr &MI, in getRelocation() argument
175 uint64_t TSFlags = MI.getDesc().TSFlags; in getRelocation()
180 && MI.isBranch()) in getRelocation()
182 if (Form == MipsII::FrmI && MI.getOpcode() == Mips::LUi) in getRelocation()
187 unsigned MipsCodeEmitter::getJumpTargetOpValue(const MachineInstr &MI, in getJumpTargetOpValue() argument
189 MachineOperand MO = MI.getOperand(OpNo); in getJumpTargetOpValue()
191 emitGlobalAddress(MO.getGlobal(), getRelocation(MI, MO), true); in getJumpTargetOpValue()
193 emitExternalSymbolAddress(MO.getSymbolName(), getRelocation(MI, MO)); in getJumpTargetOpValue()
195 emitMachineBasicBlock(MO.getMBB(), getRelocation(MI, MO)); in getJumpTargetOpValue()
201 unsigned MipsCodeEmitter::getJumpTargetOpValueMM(const MachineInstr &MI, in getJumpTargetOpValueMM() argument
207 unsigned MipsCodeEmitter::getBranchTargetOpValueMM(const MachineInstr &MI, in getBranchTargetOpValueMM() argument
213 unsigned MipsCodeEmitter::getBranchTarget21OpValue(const MachineInstr &MI, in getBranchTarget21OpValue() argument
219 unsigned MipsCodeEmitter::getBranchTarget26OpValue(const MachineInstr &MI, in getBranchTarget26OpValue() argument
225 unsigned MipsCodeEmitter::getJumpOffset16OpValue(const MachineInstr &MI, in getJumpOffset16OpValue() argument
231 unsigned MipsCodeEmitter::getBranchTargetOpValue(const MachineInstr &MI, in getBranchTargetOpValue() argument
233 MachineOperand MO = MI.getOperand(OpNo); in getBranchTargetOpValue()
234 emitMachineBasicBlock(MO.getMBB(), getRelocation(MI, MO)); in getBranchTargetOpValue()
238 unsigned MipsCodeEmitter::getMemEncoding(const MachineInstr &MI, in getMemEncoding() argument
241 assert(MI.getOperand(OpNo).isReg()); in getMemEncoding()
242 unsigned RegBits = getMachineOpValue(MI, MI.getOperand(OpNo)) << 16; in getMemEncoding()
243 return (getMachineOpValue(MI, MI.getOperand(OpNo+1)) & 0xFFFF) | RegBits; in getMemEncoding()
246 unsigned MipsCodeEmitter::getMemEncodingMMImm12(const MachineInstr &MI, in getMemEncodingMMImm12() argument
252 unsigned MipsCodeEmitter::getMSAMemEncoding(const MachineInstr &MI, in getMSAMemEncoding() argument
258 unsigned MipsCodeEmitter::getSizeExtEncoding(const MachineInstr &MI, in getSizeExtEncoding() argument
261 return getMachineOpValue(MI, MI.getOperand(OpNo)) - 1; in getSizeExtEncoding()
264 unsigned MipsCodeEmitter::getSizeInsEncoding(const MachineInstr &MI, in getSizeInsEncoding() argument
267 return getMachineOpValue(MI, MI.getOperand(OpNo-1)) + in getSizeInsEncoding()
268 getMachineOpValue(MI, MI.getOperand(OpNo)) - 1; in getSizeInsEncoding()
271 unsigned MipsCodeEmitter::getLSAImmEncoding(const MachineInstr &MI, in getLSAImmEncoding() argument
277 unsigned MipsCodeEmitter::getSimm18Lsl3Encoding(const MachineInstr &MI, in getSimm18Lsl3Encoding() argument
283 unsigned MipsCodeEmitter::getSimm19Lsl2Encoding(const MachineInstr &MI, in getSimm19Lsl2Encoding() argument
291 unsigned MipsCodeEmitter::getMachineOpValue(const MachineInstr &MI, in getMachineOpValue() argument
298 emitGlobalAddress(MO.getGlobal(), getRelocation(MI, MO), true); in getMachineOpValue()
300 emitExternalSymbolAddress(MO.getSymbolName(), getRelocation(MI, MO)); in getMachineOpValue()
302 emitConstPoolAddress(MO.getIndex(), getRelocation(MI, MO)); in getMachineOpValue()
304 emitJumpTableAddress(MO.getIndex(), getRelocation(MI, MO)); in getMachineOpValue()
306 emitMachineBasicBlock(MO.getMBB(), getRelocation(MI, MO)); in getMachineOpValue()
342 void MipsCodeEmitter::emitInstruction(MachineBasicBlock::instr_iterator MI, in emitInstruction() argument
344 DEBUG(errs() << "JIT: " << (void*)MCE.getCurrentPCValue() << ":\t" << *MI); in emitInstruction()
347 if (((MI->getDesc().TSFlags & MipsII::FormMask) == MipsII::Pseudo) && in emitInstruction()
348 !expandPseudos(MI, MBB)) in emitInstruction()
351 MCE.processDebugLoc(MI->getDebugLoc(), true); in emitInstruction()
353 emitWord(getBinaryCodeForInstr(*MI)); in emitInstruction()
356 MCE.processDebugLoc(MI->getDebugLoc(), false); in emitInstruction()
368 void MipsCodeEmitter::expandACCInstr(MachineBasicBlock::instr_iterator MI, in expandACCInstr() argument
372 BuildMI(MBB, &*MI, MI->getDebugLoc(), II->get(Opc)) in expandACCInstr()
373 .addReg(MI->getOperand(1).getReg()).addReg(MI->getOperand(2).getReg()); in expandACCInstr()
376 bool MipsCodeEmitter::expandPseudos(MachineBasicBlock::instr_iterator &MI, in expandPseudos() argument
378 switch (MI->getOpcode()) { in expandPseudos()
380 BuildMI(MBB, &*MI, MI->getDebugLoc(), II->get(Mips::SLL), Mips::ZERO) in expandPseudos()
384 BuildMI(MBB, &*MI, MI->getDebugLoc(), II->get(Mips::BEQ)).addReg(Mips::ZERO) in expandPseudos()
385 .addReg(Mips::ZERO).addOperand(MI->getOperand(0)); in expandPseudos()
388 BuildMI(MBB, &*MI, MI->getDebugLoc(), II->get(Mips::BREAK)).addImm(0) in expandPseudos()
392 BuildMI(MBB, &*MI, MI->getDebugLoc(), II->get(Mips::JALR), Mips::RA) in expandPseudos()
393 .addReg(MI->getOperand(0).getReg()); in expandPseudos()
396 expandACCInstr(MI, MBB, Mips::MULT); in expandPseudos()
399 expandACCInstr(MI, MBB, Mips::MULTu); in expandPseudos()
402 expandACCInstr(MI, MBB, Mips::SDIV); in expandPseudos()
405 expandACCInstr(MI, MBB, Mips::UDIV); in expandPseudos()
408 expandACCInstr(MI, MBB, Mips::MADD); in expandPseudos()
411 expandACCInstr(MI, MBB, Mips::MADDU); in expandPseudos()
414 expandACCInstr(MI, MBB, Mips::MSUB); in expandPseudos()
417 expandACCInstr(MI, MBB, Mips::MSUBU); in expandPseudos()
423 (MI--)->eraseFromBundle(); in expandPseudos()