| |||

Home > NEON and VFP Programming > VFP vector mode > VFP vector and scalar operations |

You can use VFP arithmetic instructions to operate:

on scalars

on vectors

on scalars and vectors together.

Use the `LEN`

bits in the `FPSCR`

to
control the length of vectors (see *FPSCR, the floating‑point status and control register*).

When `LEN`

is 1 all operations are scalar.

Vectors can have a *stride* of 1 or 2,
controlled by the `STRIDE`

bits in the `FPSCR`

.
When `STRIDE`

is 1, the elements of the vector
occupy consecutive registers in the bank. When `STRIDE`

is
2, the elements of the vector occupy alternate registers in the
bank.

When `LEN`

is greater than 1, the behavior
of arithmetic operations depends on which register bank the destination
and operand registers are in (see *Register banks*).

Given instructions of the following general forms:

`Op`

,`Fd`

,`Fn`

`Fm`

`Op`

,`Fd`

`Fm`

the behavior is as follows:

If

is in the first or fifth bank of registers, s0 to s7, d0 to d3, or d16 to d19, the operation is scalar.`Fd`

If the

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

is not, the operation is mixed.`Fd`

If neither

nor`Fd`

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

acts on the
value in `Op`

, and the
value in `Fm`

if
present. The result is placed in

`Fd`

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`

For single-operand instructions,

acts
on the single value in `Op`

. `Fm`

`LEN`

copies
of the result are placed in the vector starting at

.`Fd`

For multiple-operand instructions,

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`