frintn

Floating-Point Round Nearest (SVE)

FRINTN <Zd>.<T>, <Pg>/M, <Zn>.<T>

Rounds float to integer (Nearest Even) (vector).

Pseudocode Operation

No pseudocode available.

Encoding

Binary Layout
01100101
31:24
size
23:22
000
21:19
00
18:17
0
16
101
15:13
Pg
12:10
Zn
9:5
Zd
4:0
 
Format SVE Float
Opcode 0x6500A000
Extension SVE

Operands

  • Zd
    Dest
  • Zn
    Src

Related

Other forms of frintn

  • frintn Floating-Point Round to Integral…

More in SVE

Reference

Instruction Forms

Encoding Instruction ISA Bit pattern
0x6500A000 FRINTN <Zd>.<T>, <Pg>/M, <Zn>.<T> A64 01100101 | size | 000 | 00 | 0 | 101 | Pg | Zn | Zd
0x0E798800 FRINTN <Vd>.<T>, <Vn>.<T> A64 0 | Q | 0 | 01110 | 0 | 1111001100 | 0 | 10 | Rn | Rd
0x0E218800 FRINTN <Vd>.<T>, <Vn>.<T> A64 0 | Q | 0 | 01110 | 0 | sz | 100001100 | 0 | 10 | Rn | Rd
0x1EE44000 FRINTN <Hd>, <Hn> A64 0 | 0 | 0 | 11110 | 11 | 1001 | 000 | 10000 | Rn | Rd
0x1E244000 FRINTN <Sd>, <Sn> A64 0 | 0 | 0 | 11110 | 00 | 1001 | 000 | 10000 | Rn | Rd
0x1E644000 FRINTN <Dd>, <Dn> A64 0 | 0 | 0 | 11110 | 01 | 1001 | 000 | 10000 | Rn | Rd
0xC1A8E000 FRINTN { <Zd1>.S-<Zd2>.S }, { <Zn1>.S-<Zn2>.S } A64 11000001 | 1 | 0 | 101 | 00 | 0 | 111000 | Zn | 0 | Zd | 0
0xC1B8E000 FRINTN { <Zd1>.S-<Zd4>.S }, { <Zn1>.S-<Zn4>.S } A64 11000001 | 1 | 0 | 111 | 00 | 0 | 111000 | Zn | 00 | Zd | 00

Description

Round to an integral floating-point value with the specified rounding option from each active floating-point element of the source vector, and place the results in the corresponding elements of the destination vector. Inactive elements in the destination vector register remain unmodified.

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, e, esize] = FPRoundInt(element, FPCR, rounding, exact);

Z[d, VL] = result;