| |||

Home > VFP Programming > VFP instructions > VABS, VNEG, and VSQRT |

Floating-point absolute value, negate, and square root.

These instructions can be scalar, vector, or mixed.

V{`op`

}.F32`cond`

,`Sd`

`Sm`

V{`op`

}.F64`cond`

,`Dd`

`Dm`

where:

`op`

is one of

`ABS`

,`NEG`

, or`SQRT`

.`cond`

is an optional condition code.

,`Sd`

`Sm`

are the single-precision registers for the result and operand.

,`Dd`

`Dm`

are the double-precision registers for the result and operand.

The `VABS`

instruction takes the contents of or

`Dm`

,
clears the sign bit, and places the result in `Sd`

`Dd`

.
This gives the absolute value.The `VNEG`

instruction takes the contents of or

`Dm`

,
changes the sign bit, and places the result in `Sd`

`Dd`

.
This gives the negation of the value.The `VSQRT`

instruction takes the square root of
the contents of or

`Dm`

,
and places the result in `Sd`

`Dd`

.In the case of a `VABS`

and `VNEG`

instruction,
if the operand is a NaN, the sign bit is determined in each case
as above, but no exception is produced.

`VABS`

and `VNEG`

instructions cannot
produce any exceptions.

`VSQRT`

instructions can produce Invalid Operation
or Inexact exceptions.

- Concepts
*Using the Assembler*:- Reference: