/** * Specify the registers used by this instruction. * * @param rs is the register set in use * @param index is an index associated with the instruction * @param strength is the importance of the instruction * @see scale.backend.RegisterAllocator#useRegister(int,int,int) * @see scale.backend.RegisterAllocator#defRegister(int,int) */ public void specifyRegisterUsage(RegisterAllocator rs, int index, int strength) { super.specifyRegisterUsage(rs, index, strength); if (annulled) return; // Annulled instructions are processed as part of an AnnulMarker. if (delaySlot != null) delaySlot.specifyRegisterUsage(rs, index, strength); }
/** Return true if the instruction sets the register. */ public boolean defs(int register, RegisterSet registers) { if (super.defs(register, registers)) return true; if (delaySlot != null) return delaySlot.defs(register, registers); return false; }
/** * Map the registers defined in the instruction as destinations to the specified register. If the * register is not used as a destination register, no change is made. * * @param oldReg is the previous destination register * @param newReg is the new destination register */ public void remapDestRegister(int oldReg, int newReg) { super.remapDestRegister(oldReg, newReg); if (delaySlot != null) delaySlot.remapDestRegister(oldReg, newReg); }
public void remapRegisters(int[] map) { super.remapRegisters(map); if (delaySlot != null) delaySlot.remapRegisters(map); }
/** toString() helper method. */ protected final void delayToStringBuf(StringBuffer buf) { if (delaySlot != null) { buf.append("; "); buf.append(delaySlot.toString()); } }
/** Assemble the delay slot instruction. */ protected final void assembleDelay(Assembler asm, Emit emit) { emit.endLine(); emit.emit('\t'); if (delaySlot != null) delaySlot.assembler(asm, emit); else emit.emit("nop"); }