fcvtxnt
FCVTXNT <Zd>.S, <Pg>/M, <Zn>.D
Floating-point Convert Narrow (Top)
Pseudocode Operation
No pseudocode available.
Encoding
Binary Layout
01100100
31:24
0
23
0
22
0010
21:18
1
17
0
16
101
15:13
Pg
12:10
Zn
9:5
Zd
4:0
Related
More in Float
Reference
View in Arm A64 ISA Reference ↗
Arm A64 ISA
Instruction Forms
| Encoding | Instruction | ISA | Bit pattern | ||
|---|---|---|---|---|---|
| 0x640AA000 | FCVTXNT <Zd>.S, <Pg>/M, <Zn>.D | A64 | 01100100 | 0 | 0 | 0010 | 1 | 0 | 101 | Pg | Zn | Zd |
Description
Convert active double-precision floating-point elements from the source vector to single-precision, rounding to Odd, and place the results in the odd-numbered 32-bit elements of the destination vector, leaving the even-numbered elements unchanged. Inactive elements in the destination vector register remain unmodified. Rounding to Odd (aka Von Neumann rounding) permits a two-step conversion from double-precision to half-precision without incurring intermediate rounding errors.
Operation
CheckSVEEnabled();
constant integer VL = CurrentVL;
constant integer PL = VL DIV 8;
constant integer elements = VL DIV esize;
bits(PL) mask = P[g, PL];
bits(VL) operand = if AnyActiveElement(mask, esize) then Z[n, VL] else Zeros(VL);
bits(VL) result = Z[d, VL];
for e = 0 to elements-1
if ActivePredicateElement(mask, e, esize) then
bits(esize) element = Elem[operand, e, esize];
Elem[result, 2*e + 1, esize DIV 2] = FPConvertSVE(element, FPCR, FPRounding_ODD, esize DIV 2);
Z[d, VL] = result;