fabs
Floating-Point Absolute Value (Half-Precision)
FABS <Vd>.8H, <Vn>.8H
Absolute value of half-precision vector.
Pseudocode Operation
for i = 0 to 7
Vd[i*16 +: 16] ← Vn[i*16 +: 16] AND 0x7FFF
Example
FABS v0.4s.8H, v1.4s.8H
Encoding
Binary Layout
0
31
Q
30
0
29
01110
28:24
1
23
111100
22:17
01111
16:12
10
11:10
Rn
9:5
Rd
4:0
Operands
-
Vd
Destination SIMD/FP vector register -
Vn
First source SIMD/FP vector register
Related
Other forms of fabs
- fabs SVE Floating-Point Absolute Value
- fabs Floating-Point Absolute Value (Scalar)
- fabs Vector Floating-Point Absolute Value
More in FEAT_FP16 (NEON)
Reference
View in Arm A64 ISA Reference ↗
Arm A64 ISA
Instruction Forms
| Encoding | Instruction | ISA | Bit pattern | ||
|---|---|---|---|---|---|
| 0x0EF8F800 | FABS <Vd>.<T>, <Vn>.<T> | A64 | 0 | Q | 0 | 01110 | 1 | 111100 | 01111 | 10 | Rn | Rd | ||
| 0x0EA0F800 | FABS <Vd>.<T>, <Vn>.<T> | A64 | 0 | Q | 0 | 011101 | sz | 10000 | 01111 | 10 | Rn | Rd | ||
| 0x1EE0C000 | FABS <Hd>, <Hn> | A64 | 0 | 0 | 0 | 11110 | 11 | 10000 | 01 | 10000 | Rn | Rd | ||
| 0x1E20C000 | FABS <Sd>, <Sn> | A64 | 0 | 0 | 0 | 11110 | 00 | 10000 | 01 | 10000 | Rn | Rd | ||
| 0x1E60C000 | FABS <Dd>, <Dn> | A64 | 0 | 0 | 0 | 11110 | 01 | 10000 | 01 | 10000 | Rn | Rd | ||
| 0x041CA000 | FABS <Zd>.<T>, <Pg>/M, <Zn>.<T> | A64 | 00000100 | size | 011 | 10 | 0 | 101 | Pg | Zn | Zd |
Description
Floating-point Absolute value (vector). This instruction calculates the absolute value of each vector element in the source SIMD&FP register, writes the result to a vector, and writes the vector to the destination SIMD&FP register. Depending on the settings in the CPACR_EL1, CPTR_EL2, and CPTR_EL3 registers, and the current Security state and Exception level, an attempt to execute the instruction might be trapped.
Operation
CheckFPAdvSIMDEnabled64();
bits(datasize) operand = V[n, datasize];
bits(datasize) result;
bits(esize) element;
for e = 0 to elements-1
element = Elem[operand, e, esize];
if neg then
element = FPNeg(element, FPCR);
else
element = FPAbs(element, FPCR);
Elem[result, e, esize] = element;
V[d, datasize] = result;