Vector API Quick Reference#
The tables below list the functions of the vector API. The “EW” column indicates whether the operation acts element-wise.
The “Signature” column is intended as a hint which quickly conveys the kind of the conceptual inputs to and outputs from the operation. The signatures are only intended to convey how many (conceptual) inputs and outputs there are, and their dimensionality.
The functions themselves will typically take more arguments than these signatures indicate. For example, most functions take vector lengths as input, and many take shift values which are used to control growth of element bit-depth. Check the function’s full documentation to get more detailed information.
The following symbols are used in the signatures:
Symbol |
Description |
---|---|
\(\mathbb{S}\) |
A scalar input or output value. |
\(\mathbb{V}\) |
A vector-valued input or output. |
\(\mathbb{M}\) |
A matrix-valued input or output. |
\(\varnothing\) |
Placeholder indicating no input or output. |
For example, the operation signature \((\mathbb{V \times V \times S}) \to \mathbb{V}\) indicates the operation takes two vector inputs and a scalar input, and the output is a vector.
32-bit Vector Ops |
||
---|---|---|
Function |
EW |
Signature |
\(\mathbb{V}\) \(\to \mathbb{V}\) |
||
x |
\(\mathbb{V}\) \(\to \mathbb{V}\) |
|
\(\mathbb{V}\) \(\to \mathbb{S}\) |
||
x |
\((\mathbb{V \times V})\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times S})\) \(\to \mathbb{V}\) |
|
\(\mathbb{V}\) \(\to \mathbb{S}\) |
||
\(\mathbb{V}\) \(\to \mathbb{S}\) |
||
x |
\((\mathbb{V \times S \times S})\) \(\to \mathbb{V}\) |
|
\((\mathbb{V \times V})\) \(\to \mathbb{S}\) |
||
\(\mathbb{V}\) \(\to \mathbb{S}\) |
||
\(\mathbb{V}\) \(\to \mathbb{S}\) |
||
x |
\(\mathbb{V}\) \(\to \mathbb{V}\) |
|
\(\mathbb{V}\) \(\to \mathbb{S}\) |
||
x |
\((\mathbb{V \times V})\) \(\to \mathbb{V}\) |
|
\(\mathbb{V}\) \(\to \mathbb{S}\) |
||
x |
\((\mathbb{V \times V})\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times V})\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times V \times V})\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times V \times V})\) \(\to \mathbb{V}\) |
|
x |
\(\mathbb{V}\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times S})\) \(\to \mathbb{V}\) |
|
x |
\(\mathbb{S}\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times S})\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times S})\) \(\to \mathbb{V}\) |
|
x |
\(\mathbb{V}\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times V})\) \(\to \mathbb{V}\) |
|
\(\mathbb{V}\) \(\to \mathbb{S}\) |
||
\((\mathbb{V \times V})\) \(\to \mathbb{V}\) |
||
\(\mathbb{V}\) \(\to (\mathbb{V \times V})\) |
||
\((\mathbb{V \times V})\) \(\to \mathbb{V}\) |
||
\((\mathbb{V \times V})\) \(\to \mathbb{V}\) |
||
x |
\((\mathbb{V \times S})\) \(\to \mathbb{V}\) |
|
x |
\(\mathbb{V}\) \(\to \mathbb{V}\) |
|
x |
\(\mathbb{V}\) \(\to \mathbb{V}\) |
|
x |
\(\mathbb{V}\) \(\to \mathbb{V}\) |
|
\((\mathbb{V \times V})\) \(\to \mathbb{S}\) |
||
x |
\(\mathbb{V}\) \(\to \mathbb{V}\) |
16-bit Vector Ops |
||
---|---|---|
Function |
EW |
Signature |
x |
\(\mathbb{V}\) \(\to \mathbb{V}\) |
|
\(\mathbb{V}\) \(\to \mathbb{S}\) |
||
x |
\((\mathbb{V \times V})\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times S})\) \(\to \mathbb{V}\) |
|
\(\mathbb{V}\) \(\to \mathbb{S}\) |
||
\(\mathbb{V}\) \(\to \mathbb{S}\) |
||
x |
\((\mathbb{V \times S \times S})\) \(\to \mathbb{V}\) |
|
\((\mathbb{V \times V})\) \(\to \mathbb{S}\) |
||
\(\mathbb{V}\) \(\to \mathbb{S}\) |
||
\(\mathbb{V}\) \(\to \mathbb{S}\) |
||
x |
\(\mathbb{V}\) \(\to \mathbb{V}\) |
|
\(\mathbb{V}\) \(\to \mathbb{S}\) |
||
x |
\((\mathbb{V \times V})\) \(\to \mathbb{V}\) |
|
\(\mathbb{V}\) \(\to \mathbb{S}\) |
||
x |
\((\mathbb{V \times V})\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times V})\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times V \times V})\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times V \times V})\) \(\to \mathbb{V}\) |
|
x |
\(\mathbb{V}\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times S})\) \(\to \mathbb{V}\) |
|
x |
\(\mathbb{S}\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times S})\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times S})\) \(\to \mathbb{V}\) |
|
x |
\(\mathbb{V}\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times V})\) \(\to \mathbb{V}\) |
|
\(\mathbb{V}\) \(\to \mathbb{S}\) |
||
x |
\(\mathbb{V}\) \(\to \mathbb{V}\) |
|
x |
\(\mathbb{V}\) \(\to \mathbb{V}\) |
8-bit Vector Ops |
|||
---|---|---|---|
Function |
EW |
Signature |
Brief |
x |
\(\mathbb{V}\) \(\to \mathbb{V}\) |
Identify negative elements |
32-bit Complex Vector Ops |
||
---|---|---|
Function |
EW |
Signature |
x |
\((\mathbb{V \times V})\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times S})\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times V \times V})\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times V})\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times V \times V})\) \(\to \mathbb{V}\) |
|
x |
\(\mathbb{V}\) \(\to \mathbb{V}\) |
|
\(\mathbb{V}\) \(\to \mathbb{S}\) |
||
x |
\((\mathbb{V \times V \times V})\) \(\to \mathbb{V}\) |
|
x |
\(\mathbb{V}\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times V})\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times V \times V})\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times V})\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times S})\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times S})\) \(\to \mathbb{V}\) |
|
x |
\(\mathbb{S}\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times S})\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times S})\) \(\to \mathbb{V}\) |
|
x |
\(\mathbb{V}\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times V})\) \(\to \mathbb{V}\) |
|
\(\mathbb{V}\) \(\to \mathbb{S}\) |
||
\(\mathbb{V}\) \(\to \mathbb{V}\) |
16-bit Complex Vector Ops |
||
---|---|---|
Function |
EW |
Signature |
x |
\((\mathbb{V \times V})\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times S})\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times V})\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times V \times V})\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times V \times V})\) \(\to \mathbb{V}\) |
|
\(\mathbb{V}\) \(\to \mathbb{S}\) |
||
x |
\((\mathbb{V \times V \times V})\) \(\to \mathbb{V}\) |
|
x |
\(\mathbb{V}\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times V})\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times V \times V})\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times V})\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times S})\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times S})\) \(\to \mathbb{V}\) |
|
x |
\(\mathbb{S}\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times S})\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times S})\) \(\to \mathbb{V}\) |
|
x |
\(\mathbb{V}\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times V})\) \(\to \mathbb{V}\) |
|
\(\mathbb{V}\) \(\to \mathbb{S}\) |
Fixed-Point Vector Ops |
||
---|---|---|
Function |
EW |
Signature |
x |
\((\mathbb{V \times V})\) \(\to \mathbb{V}\) |
|
x |
\(\mathbb{V}\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times V})\) \(\to \mathbb{V}\) |
|
x |
\(\mathbb{V}\) \(\to \mathbb{V}\) |
Floating-Point Vector Ops |
||
---|---|---|
Function |
EW |
Signature |
\(\mathbb{V}\) \(\to \mathbb{S}\) |
||
\((\mathbb{V \times V})\) \(\to \mathbb{S}\) |
||
x |
\(\mathbb{V \times V}\) \(\to \mathbb{V}\) |
|
x |
\((\mathbb{V \times S})\) \(\to \mathbb{V}\) |
|
x |
\(\mathbb{V}\) \(\to \mathbb{V}\) |
|
x |
\(\mathbb{V}\) \(\to \mathbb{V}\) |
|
x |
\(\mathbb{V}\) \(\to \mathbb{V}\) |
|
x |
\(\mathbb{V}\) \(\to \mathbb{V}\) |
|
x |
\(\mathbb{V \times V}\) \(\to \mathbb{V}\) |
|
x |
\(\mathbb{V \times V}\) \(\to \mathbb{V}\) |
|
x |
\(\mathbb{V \times V}\) \(\to \mathbb{V}\) |
|
x |
\(\mathbb{V \times V \times V}\) \(\to \mathbb{V}\) |
|
x |
\(\mathbb{V \times V \times V}\) \(\to \mathbb{V}\) |
Note that several of the functions below take vectors of the split_acc_s32_t
type. This
is a 32-bit vector type used for accumulating results of 8- or 16-bit operations in a manner
optimized for the XS3 VPU.
Other Vector Ops |
||
---|---|---|
Function |
EW |
Signature |
x |
\((\mathbb{V \times S})\) \(\to \mathbb{V}\) |
|
x |
\(\mathbb{V}\) \(\to \mathbb{V}\) |
|
x |
\(\mathbb{V}\) \(\to \mathbb{V}\) |
|
x |
\(\mathbb{V}\) \(\to \mathbb{V}\) |
|
\((\mathbb{M \times V})\) \(\to \mathbb{V}\) |
||
\((\mathbb{M \times V})\) \(\to \mathbb{V}\) |
Vector Type Conversion Ops |
||
---|---|---|
Function |
Array Element Type |
|
Input |
Output |
|
|
|
|
|
|
|
|
|
|
|
|
|