|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdspl.intermediate.instructions.Instruction
dspl.intermediate.instructions.ArithmaticInstruction
public class ArithmaticInstruction
ArithmaticInstruction includes assignment, conversion, and all arithmatic instructions on both atomics and arrays
It covers all common arithmatic operations (addition, subtraction, multiplication, divison, and convolusion)
as applied (depending on args/dest) to both atomic and sometimes array Variables.
It also includes assignment (i.e. "x=5;") and conversion operations (converting a signed->unsigned integer)
| Field Summary | |
|---|---|
Variable |
arg1
First arguement |
Variable |
arg2
Second argument, will be null in the case of OPERATION_ASSIGNMENT and OPERATION_CONVERSION |
Variable |
dest
Destination variable: its value is determined by... |
static int |
OPERATION_ADDITION
Mathematical Addition: The table below lists the possible combinations of data types for arguments for each destination. dest = arg1 + arg2; destpossible types for arg1possible types for arg2 bytebyte/ubytebyte/ubyte ubytebyte/ubytebyte/ubyte intint/uintint/uint uintint/uintint/uint floatfloatfloat complexcomplexcomplex byte_arraybyte_array/ubyte_arraybyte_array/ubyte_array/byte/ubyte ubyte_arraybyte_array/ubyte_arraybyte_array/ubyte_array/byte/ubyte int_arrayint_array/uint_arrayint_array/uint_array/int/uint uint_arrayint_array/uint_arrayint_array/uint_array/int/uint complex_arraycomplex_arraycomplex_array/complex Note that in general, arrays can be operated on by atomics (i.e. |
static int |
OPERATION_ASSIGNMENT
Assignment refers to setting the value of a Variable Example: x = 5; would set the value of Variable x to 5 |
static int |
OPERATION_CONVERSION
|
static int |
OPERATION_CONVOLUTION
|
static int |
OPERATION_DIVISION
|
static int |
OPERATION_MULTIPLICATION
|
static int |
OPERATION_SUBTRACTION
|
int |
operationType
contains the operation type, must be one of the OPERATION_xxx values listed above |
| 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 | |
|---|---|
ArithmaticInstruction(int operationType,
Variable arg1,
Variable arg2,
Variable dest)
Constructor for creating ArithmaticInstruction |
|
| Method Summary | |
|---|---|
int |
getArithmaticOperationType()
Returns the Arithmatic Operation Type |
int |
getInstType()
|
boolean |
usesVariable(Variable v)
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 |
|---|
public static final int OPERATION_ASSIGNMENT
public static final int OPERATION_ADDITION
| dest | possible types for arg1 | possible types for arg2 |
| byte | byte/ubyte | byte/ubyte |
| ubyte | byte/ubyte | byte/ubyte |
| int | int/uint | int/uint |
| uint | int/uint | int/uint |
| float | float | float |
| complex | complex | complex |
| byte_array | byte_array/ubyte_array | byte_array/ubyte_array/byte/ubyte |
| ubyte_array | byte_array/ubyte_array | byte_array/ubyte_array/byte/ubyte |
| int_array | int_array/uint_array | int_array/uint_array/int/uint |
| uint_array | int_array/uint_array | int_array/uint_array/int/uint |
| complex_array | complex_array | complex_array/complex |
public static final int OPERATION_SUBTRACTION
public static final int OPERATION_MULTIPLICATION
public static final int OPERATION_DIVISION
public static final int OPERATION_CONVOLUTION
public static final int OPERATION_CONVERSION
public int operationType
public Variable arg1
public Variable arg2
public Variable dest
| Constructor Detail |
|---|
public ArithmaticInstruction(int operationType,
Variable arg1,
Variable arg2,
Variable dest)
operationType - arg1 - arg2 - dest - | Method Detail |
|---|
public boolean usesVariable(Variable v)
Instruction
usesVariable in class Instructionv - the variable to search for to see if it is used
public int getArithmaticOperationType()
public int getInstType()
getInstType in class Instruction
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||