| |||

Home > NEON and VFP Programming > Control of scalar, vector, and mixed operations |

You can use VFP arithmetic instructions to operate on:

scalars

vectors

scalars and vectors together.

Use the `LEN`

bits in the `FPSCR`

to
control the length of vectors. When `LEN`

is 1
all VFP operations are scalar.

When `LEN`

is greater than 1, the VFP operation
can be scalar, vector or mixed. The behavior of VFP arithmetic operations
depends on which register bank the destination and operand registers are
in.

The first bank of registers, s0 to s7 or d0 to d3 and the fifth bank of registers d16 to d19 are scalar banks. All other banks are vector banks. A vector operation or mixed operation is one where the destination register is in one of the vector banks.

Given instructions of the following general forms:

`Op`

,`Fd`

,`Fn`

`Fm`

`Op`

,`Fd`

`Fm`

where:

`Op`

is the VFP instruction

`Fd`

is the destination register

`Fn`

is an operand register

`Fm`

is the only or second operand register

the behavior of the operation is as follows:

If

is in the first or fifth bank of registers then the operation is scalar.`Fd`

If

is in the first or fifth bank of registers, but`Fm`

is not, then the operation is mixed.`Fd`

If neither

nor`Fd`

are in the first or fifth bank of registers, the operation is vector.`Fm`

In scalar operations,

acts
on the value in `Op`

,
and the value in `Fm`

if
present. The result is placed in

`Fd`

In vector operations,

acts
on the values in the vector starting at `Op`

,
together with the values in the vector starting at `Fm`

if
present. The results are placed in the vector starting at `Fn`

.`Fd`

In mixed operations, with a single operand,

acts
on the single value in `Op`

and `Fm`

`LEN`

copies
of the result are placed in the vector starting at

.`Fd`

In mixed operations, with two operands,

acts
on the single value in `Op`

,
together with the values in the vector starting at `Fm`

.
The results are placed in the vector starting at `Fn`

.`Fd`