1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// Shuffle tables shared by the SSSE3 and NEON paths.
// Always compiled on x86_64/aarch64 to catch compile errors even when no SIMD
// feature is active; dead_code suppressed because use is feature-gated.
// ── Decode table ─────────────────────────────────────────────────────────────
//
// Entry `c` is the 16-byte PSHUFB / vqtbl1q_u8 mask that expands the
// variable-width data bytes for control byte value `c` into 8 fixed-width
// u16 output slots (little-endian).
//
// Bit k of `c`: 0 = 1-byte value, 1 = 2-byte value.
// output byte 2k → index of value's low data byte in the input chunk
// output byte 2k+1 → index of high byte (2-byte) or 0x80 (zero fill, 1-byte)
//
// Both PSHUFB and vqtbl1q_u8 zero the output byte when the mask byte has
// its high bit set (≥ 16 and ≥ 128 respectively). 0x80 satisfies both, so
// the same table works for SSE/NEON without modification.
const
pub static TABLE: = make_decode;
// ── Encode table ─────────────────────────────────────────────────────────────
//
// Entry `c` is the 16-byte PSHUFB mask that packs 8 u16 values (laid out as
// 16 LE bytes in a register) into the compact SVB16 data stream.
//
// Bit k of `c`: 0 = 1-byte value → emit only byte 2k (low byte of value k).
// 1 = 2-byte value → emit byte 2k then byte 2k+1.
//
// The packed bytes occupy the first (8 + popcount(c)) positions of the result.
// Positions beyond that are don't-care (filled with 0, never read).
const
pub static ENCODE_TABLE: = make_encode;