Vector Operation
VEC_OP
| 31-26 | 25-21 | 20-16 | 15-11 | 10-6 | 5-0 | |
|---|---|---|---|---|---|---|
| VEC_OP | 01XX00 | rs | rt | rd | re | funct |
VEC_OP_XX rd,rs,[rt,]re,functPerforms VEC_OP (Single Instruction, Multiple Data) operations between vectors
XXindicates the number of input vectors, supporting1to4vectors in the operation;- When the number of input vectors does not exceed
2, their addresses are specified byGRF[rs]andGRF[rt]respectively; when exceeding2, their addresses are provided by dedicated registers; the length of input vectors isGRF[re]; - The write-back address for the result vector is
GRF[rd]; functrepresents the operation type, including RELU, QUAN, etc., used to support operations such as ReLU activation function and quantization; this field can be extended to support new operations.
Example:
VEC_OP_00 $3,$1,$2,RELUREDUCE
| 31-26 | 25-21 | 20-16 | 15-11 | 10-6 | 5-0 | |
|---|---|---|---|---|---|---|
| REDUCE | 010001 | rs | rt | rd | 0 0000 | funct |
REDUCE rd,rs,rt,functPerforms vector aggregation/reduction operations
- The input vector address is
GRF[rs], its length isGRF[rt], and the result write-back address isGRF[rd]; - The
functparameter specifies the operation type, includingSUM,MAX, etc., used for reduction operations such as summation and finding extreme values; this field can be extended to support new operations.
Example:
REDUCE $3,$1,$2,SUM