LUTI2

Lookup table read with 2-bit indices

This instruction copies indexed 8-bit or 16-bit elements from the table vector to the destination vector using packed 2-bit indices from a segment of the source vector. 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.

Encoding: Advanced SIMD

Variants: FEAT_AdvSIMD && FEAT_LUT (FEAT_AdvSIMD && FEAT_LUT)

313029282726252423222120191817161514131211109876543210
010011101x0000
Qop2RmlenopRnRd

Byte (op2 == 10 && op == 1)

LUTI2 <Vd>.16B, { <Vn>.16B }, <Vm>[<index>]

Halfword (op2 == 11)

LUTI2 <Vd>.8H, { <Vn>.8H }, <Vm>[<index>]

Decoding algorithm

if !IsFeatureImplemented(FEAT_AdvSIMD) || !IsFeatureImplemented(FEAT_LUT) then
    EndOfDecode(Decode_UNDEF);
if op2 == '10' && op == '0' then EndOfDecode(Decode_UNDEF);

constant integer d = UInt(Rd);
constant integer n = UInt(Rn);
constant integer m = UInt(Rm);
constant integer isize = 2;
constant integer esize = if op2 == '10' then 8 else 16;
constant integer part = if op2 == '10' then UInt(len) else UInt(len:op);

Operation

CheckFPAdvSIMDEnabled64();
constant integer elements = 128 DIV esize;
constant integer ibase = elements * part;
constant bits(128) indices = V[m, 128];
constant bits(128) table   = V[n, 128];
bits(128) result;

for e = 0 to elements-1
    constant integer index = UInt(Elem[indices, ibase + e, isize]);
    Elem[result, e, esize] = Elem[table, index, esize];

V[d, 128] = result;

Explanations

<Vd>: Is the name of the SIMD&FP destination register, encoded in the "Rd" field.
<Vn>: Is the name of the SIMD&FP table register, encoded in the "Rn" field.
<Vm>: Is the name of the SIMD&FP source register, encoded in the "Rm" field.
<index>: For the "Byte" variant: is the vector segment index, in the range 0 to 3, encoded in the "len" field.
<index>: For the "Halfword" variant: is the vector segment index, in the range 0 to 7, encoded in the "len:op" fields.

Operational Notes

If PSTATE.DIT is 1: