SIMD module

lookup

procedureextensionsince 0.31.0Source

A byte table lookup: lane i is table[indices[i]] when that index is below 16, else 0. This is one instruction on SSSE3, NEON and wasm simd128, and the base of fast byte classification: split each byte into nibbles and look both up.

lookup :: (table: u8x16, indices: Vector(u8, $N)) -> Vector(u8, N)

Parameters

table: u8x16
indices: Vector(u8, $N)

Returns

Vector(u8, N)

See also