luti4

Lookup Table Index (4-bit)

LUTI4 <Zd>.<T>, ZT0, <Zn>[<index>]

Looks up values in ZT0 table using 4-bit indices (SME2).

Pseudocode Operation

No pseudocode available.

Encoding

Binary Layout
1100000011001
31:19
01
18:17
i3
16:14
size
13:12
00
11:10
Zn
9:5
Zd
4:0
 
Format SME2 LUT
Opcode 0xC0CA0000
Extension SME2

Operands

  • Zd
    Dest
  • ZT0
    Table
  • Zn
    Indices

Related

More in SME2

Reference

Instruction Forms

Encoding Instruction ISA Bit pattern
0x4E402000 LUTI4 <Vd>.16B, { <Vn>.16B }, <Vm>[<index>] A64 0 | 1 | 001110 | 01 | 0 | Rm | 0 | len | 0 | 00 | Rn | Rd
0x4E401000 LUTI4 <Vd>.8H, { <Vn1>.8H, <Vn2>.8H }, <Vm>[<index>] A64 0 | 1 | 001110 | 01 | 0 | Rm | 0 | len | 1 | 00 | Rn | Rd
0xC08A4000 LUTI4 { <Zd1>.<T>-<Zd2>.<T> }, ZT0, <Zn>[<index>] A64 1100000010001 | 01 | i2 | 1 | size | 00 | Zn | Zd | 0
0xC09A4000 LUTI4 { <Zd1>.<T>, <Zd2>.<T> }, ZT0, <Zn>[<index>] A64 11 | 00000010011 | 01 | i2 | 1 | size | 00 | Zn | D | 0 | Zd
0xC08B0000 LUTI4 { <Zd1>.B-<Zd4>.B }, ZT0, { <Zn1>-<Zn2> } A64 110000001000101100 | size | 00 | Zn | 0 | Zd | 00
0xC09B0000 LUTI4 { <Zd1>.B, <Zd2>.B, <Zd3>.B, <Zd4>.B }, ZT0, { <Zn1>-<Zn2> } A64 11 | 0000001001 | 101100 | size | 00 | Zn | 0 | D | 0 | 0 | Zd
0xC08A8000 LUTI4 { <Zd1>.<T>-<Zd4>.<T> }, ZT0, <Zn>[<index>] A64 1100000010001 | 01 | i1 | 10 | size | 00 | Zn | Zd | 00
0xC09A8000 LUTI4 { <Zd1>.H, <Zd2>.H, <Zd3>.H, <Zd4>.H }, ZT0, <Zn>[<index>] A64 11 | 0000001001 | 1 | 01 | i1 | 10 | size | 00 | Zn | D | 0 | 0 | Zd
0xC0CA0000 LUTI4 <Zd>.<T>, ZT0, <Zn>[<index>] A64 1100000011001 | 01 | i3 | size | 00 | Zn | Zd
0x4560A400 LUTI4 <Zd>.B, { <Zn>.B }, <Zm>[<index>] A64 01000101 | i1 | 11 | Zm | 101001 | Zn | Zd
0x4520B400 LUTI4 <Zd>.H, { <Zn1>.H, <Zn2>.H }, <Zm>[<index>] A64 01000101 | i2 | 1 | Zm | 1011 | 0 | 1 | Zn | Zd
0x4520BC00 LUTI4 <Zd>.H, { <Zn>.H }, <Zm>[<index>] A64 01000101 | i2 | 1 | Zm | 1011 | 1 | 1 | Zn | Zd

Description

Copy 8-bit, 16-bit or 32-bit elements from ZT0 to one destination vector using packed 4-bit indices from a segment of the source vector register. A segment corresponds to a portion of the source vector that is consumed in order to fill the destination vector. The segment is selected by the vector segment index modulo the total number of segments. This instruction is unpredicated.

Operation

CheckStreamingSVEEnabled();
CheckSMEZT0Enabled();
constant integer VL = CurrentVL;
constant integer elements = VL DIV esize;
integer segments = esize DIV (isize * nreg);
integer segment = imm MOD segments;
bits(VL) indexes = Z[n, VL];
bits(512) table = ZT0[512];

for r = 0 to nreg-1
    integer base = (segment * nreg + r) * elements;
    bits(VL) result;
    for e = 0 to elements-1
        integer index = UInt(Elem[indexes, base+e, isize]);
        Elem[result, e, esize] = Elem[table, index, 32]<esize-1:0>;
    Z[d+r, VL] = result;