Package jminusminus
Class NLIRArithmetic
java.lang.Object
jminusminus.NLIRInstruction
jminusminus.NLIRArithmetic
LIR instruction corresponding to the JVM arithmetic instructions.
-
Field Summary
Fields inherited from class jminusminus.NLIRInstruction
block, id, lirMnemonic, reads, write
-
Constructor Summary
ConstructorDescriptionNLIRArithmetic
(NBasicBlock block, int id, int opcode, NLIRInstruction lhs, NLIRInstruction rhs) Constructs an NLIRArithmetic object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Replace references to virtual registers in this LIR instruction with references to physical registers.void
toSpim
(PrintWriter out) Translates this LIR instruction into SPIM and writes it out to the specified output stream.toString()
Returns a string representation of this instruction.
-
Constructor Details
-
NLIRArithmetic
public NLIRArithmetic(NBasicBlock block, int id, int opcode, NLIRInstruction lhs, NLIRInstruction rhs) Constructs an NLIRArithmetic object.- Parameters:
block
- enclosing block.id
- identifier of the instruction.opcode
- opcode for the arithmetic operator.lhs
- LIR for lhs.rhs
- LIR for rhs.
-
-
Method Details
-
allocatePhysicalRegisters
public void allocatePhysicalRegisters()Replace references to virtual registers in this LIR instruction with references to physical registers.- Overrides:
allocatePhysicalRegisters
in classNLIRInstruction
-
toSpim
Translates this LIR instruction into SPIM and writes it out to the specified output stream.- Overrides:
toSpim
in classNLIRInstruction
- Parameters:
out
- output stream for SPIM code.
-
toString
Returns a string representation of this instruction.- Overrides:
toString
in classNLIRInstruction
- Returns:
- a string representation of this instruction.
-