dspl.intermediate.instructions
Class RelationInstruction

java.lang.Object
  extended by dspl.intermediate.instructions.Instruction
      extended by dspl.intermediate.instructions.RelationInstruction

public class RelationInstruction
extends Instruction

This class is used to represent all of the instructions and the comparison necessary for all of the branch and loop instructions that require some representation of the condition that determines if they run or not.

Author:
varun

Field Summary
 Variable arg1
          First argument to be compared
 Variable arg2
          Second arguement to compared to arg1
 int condition
          the condition required for what we were given to be true
 InstructionSet statements
           
 
Fields inherited from class dspl.intermediate.instructions.Instruction
INST_TYPE_ARITHMATIC, INST_TYPE_BRANCH, INST_TYPE_CCALL, INST_TYPE_FORLOOP, lastInstruction, nextInstruction, prevInstruction
 
Constructor Summary
RelationInstruction(Variable arg1, Variable arg2, int condition)
           
 
Method Summary
 int getInstType()
           
 boolean usesVariable(Variable foo)
          Designed to be a recursive call to see if a given variable is used anymore within a code block, after the current instruction.
 
Methods inherited from class dspl.intermediate.instructions.Instruction
setNextInstruction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

statements

public InstructionSet statements

arg1

public Variable arg1
First argument to be compared


arg2

public Variable arg2
Second arguement to compared to arg1


condition

public int condition
the condition required for what we were given to be true

Constructor Detail

RelationInstruction

public RelationInstruction(Variable arg1,
                           Variable arg2,
                           int condition)
Method Detail

usesVariable

public boolean usesVariable(Variable foo)
Description copied from class: Instruction
Designed to be a recursive call to see if a given variable is used anymore within a code block, after the current instruction. Intention is to allow a way to parse the Instruction tree to see if a specific variable is used again. NOTE: may not be necessary, or may need to be augmented to return a value indicating how far away from the current instruction will it be used again if desire to perform better register allocation.

Specified by:
usesVariable in class Instruction
Parameters:
foo - the variable to search for to see if it is used
Returns:

getInstType

public int getInstType()
Specified by:
getInstType in class Instruction
Returns:
the instruction type of this instruction