Lines Matching refs:MI
83 uint64_t getBinaryCodeForInstr(const MachineInstr &MI) const;
85 void emitInstruction(const MachineInstr &MI);
102 unsigned getMachineOpValue(const MachineInstr &MI,
105 unsigned getRelocation(const MachineInstr &MI,
108 unsigned getJumpTargetOpValue(const MachineInstr &MI, unsigned OpNo) const;
110 unsigned getBranchTargetOpValue(const MachineInstr &MI,
112 unsigned getMemEncoding(const MachineInstr &MI, unsigned OpNo) const;
113 unsigned getSizeExtEncoding(const MachineInstr &MI, unsigned OpNo) const;
114 unsigned getSizeInsEncoding(const MachineInstr &MI, unsigned OpNo) const;
116 int emitULW(const MachineInstr &MI);
117 int emitUSW(const MachineInstr &MI);
118 int emitULH(const MachineInstr &MI);
119 int emitULHu(const MachineInstr &MI);
120 int emitUSH(const MachineInstr &MI);
157 unsigned MipsCodeEmitter::getRelocation(const MachineInstr &MI, in getRelocation() argument
160 uint64_t TSFlags = MI.getDesc().TSFlags; in getRelocation()
165 && MI.isBranch()) in getRelocation()
167 if (Form == MipsII::FrmI && MI.getOpcode() == Mips::LUi) in getRelocation()
172 unsigned MipsCodeEmitter::getJumpTargetOpValue(const MachineInstr &MI, in getJumpTargetOpValue() argument
174 MachineOperand MO = MI.getOperand(OpNo); in getJumpTargetOpValue()
176 emitGlobalAddress(MO.getGlobal(), getRelocation(MI, MO), true); in getJumpTargetOpValue()
178 emitExternalSymbolAddress(MO.getSymbolName(), getRelocation(MI, MO)); in getJumpTargetOpValue()
180 emitMachineBasicBlock(MO.getMBB(), getRelocation(MI, MO)); in getJumpTargetOpValue()
186 unsigned MipsCodeEmitter::getBranchTargetOpValue(const MachineInstr &MI, in getBranchTargetOpValue() argument
188 MachineOperand MO = MI.getOperand(OpNo); in getBranchTargetOpValue()
189 emitMachineBasicBlock(MO.getMBB(), getRelocation(MI, MO)); in getBranchTargetOpValue()
193 unsigned MipsCodeEmitter::getMemEncoding(const MachineInstr &MI, in getMemEncoding() argument
196 assert(MI.getOperand(OpNo).isReg()); in getMemEncoding()
197 unsigned RegBits = getMachineOpValue(MI, MI.getOperand(OpNo)) << 16; in getMemEncoding()
198 return (getMachineOpValue(MI, MI.getOperand(OpNo+1)) & 0xFFFF) | RegBits; in getMemEncoding()
201 unsigned MipsCodeEmitter::getSizeExtEncoding(const MachineInstr &MI, in getSizeExtEncoding() argument
204 return getMachineOpValue(MI, MI.getOperand(OpNo)) - 1; in getSizeExtEncoding()
207 unsigned MipsCodeEmitter::getSizeInsEncoding(const MachineInstr &MI, in getSizeInsEncoding() argument
210 return getMachineOpValue(MI, MI.getOperand(OpNo-1)) + in getSizeInsEncoding()
211 getMachineOpValue(MI, MI.getOperand(OpNo)) - 1; in getSizeInsEncoding()
216 unsigned MipsCodeEmitter::getMachineOpValue(const MachineInstr &MI, in getMachineOpValue() argument
223 if (MI.getOpcode() == Mips::ULW || MI.getOpcode() == Mips::USW || in getMachineOpValue()
224 MI.getOpcode() == Mips::ULH || MI.getOpcode() == Mips::ULHu) in getMachineOpValue()
225 emitGlobalAddressUnaligned(MO.getGlobal(), getRelocation(MI, MO), 4); in getMachineOpValue()
226 else if (MI.getOpcode() == Mips::USH) in getMachineOpValue()
227 emitGlobalAddressUnaligned(MO.getGlobal(), getRelocation(MI, MO), 8); in getMachineOpValue()
229 emitGlobalAddress(MO.getGlobal(), getRelocation(MI, MO), true); in getMachineOpValue()
231 emitExternalSymbolAddress(MO.getSymbolName(), getRelocation(MI, MO)); in getMachineOpValue()
233 emitConstPoolAddress(MO.getIndex(), getRelocation(MI, MO)); in getMachineOpValue()
235 emitJumpTableAddress(MO.getIndex(), getRelocation(MI, MO)); in getMachineOpValue()
237 emitMachineBasicBlock(MO.getMBB(), getRelocation(MI, MO)); in getMachineOpValue()
281 int MipsCodeEmitter::emitUSW(const MachineInstr &MI) { in emitUSW() argument
282 unsigned src = getMachineOpValue(MI, MI.getOperand(0)); in emitUSW()
283 unsigned base = getMachineOpValue(MI, MI.getOperand(1)); in emitUSW()
284 unsigned offset = getMachineOpValue(MI, MI.getOperand(2)); in emitUSW()
294 int MipsCodeEmitter::emitULW(const MachineInstr &MI) { in emitULW() argument
295 unsigned dst = getMachineOpValue(MI, MI.getOperand(0)); in emitULW()
296 unsigned base = getMachineOpValue(MI, MI.getOperand(1)); in emitULW()
297 unsigned offset = getMachineOpValue(MI, MI.getOperand(2)); in emitULW()
321 int MipsCodeEmitter::emitUSH(const MachineInstr &MI) { in emitUSH() argument
322 unsigned src = getMachineOpValue(MI, MI.getOperand(0)); in emitUSH()
323 unsigned base = getMachineOpValue(MI, MI.getOperand(1)); in emitUSH()
324 unsigned offset = getMachineOpValue(MI, MI.getOperand(2)); in emitUSH()
338 int MipsCodeEmitter::emitULH(const MachineInstr &MI) { in emitULH() argument
339 unsigned dst = getMachineOpValue(MI, MI.getOperand(0)); in emitULH()
340 unsigned base = getMachineOpValue(MI, MI.getOperand(1)); in emitULH()
341 unsigned offset = getMachineOpValue(MI, MI.getOperand(2)); in emitULH()
358 int MipsCodeEmitter::emitULHu(const MachineInstr &MI) { in emitULHu() argument
359 unsigned dst = getMachineOpValue(MI, MI.getOperand(0)); in emitULHu()
360 unsigned base = getMachineOpValue(MI, MI.getOperand(1)); in emitULHu()
361 unsigned offset = getMachineOpValue(MI, MI.getOperand(2)); in emitULHu()
378 void MipsCodeEmitter::emitInstruction(const MachineInstr &MI) { in emitInstruction() argument
379 DEBUG(errs() << "JIT: " << (void*)MCE.getCurrentPCValue() << ":\t" << MI); in emitInstruction()
381 MCE.processDebugLoc(MI.getDebugLoc(), true); in emitInstruction()
384 if ((MI.getDesc().TSFlags & MipsII::FormMask) == MipsII::Pseudo) in emitInstruction()
388 switch (MI.getOpcode()) { in emitInstruction()
390 NumEmitted += emitUSW(MI); in emitInstruction()
393 NumEmitted += emitULW(MI); in emitInstruction()
396 NumEmitted += emitULH(MI); in emitInstruction()
399 NumEmitted += emitULHu(MI); in emitInstruction()
402 NumEmitted += emitUSH(MI); in emitInstruction()
406 emitWordLE(getBinaryCodeForInstr(MI)); in emitInstruction()
411 MCE.processDebugLoc(MI.getDebugLoc(), false); in emitInstruction()