Skip to content

Add unrolled bit-packing kernels for longs (widths 1..63)#70

Open
raunaqmorarka wants to merge 1 commit into
fast-pack:masterfrom
raunaqmorarka:unrolled-long-bitpacking
Open

Add unrolled bit-packing kernels for longs (widths 1..63)#70
raunaqmorarka wants to merge 1 commit into
fast-pack:masterfrom
raunaqmorarka:unrolled-long-bitpacking

Conversation

@raunaqmorarka

Copy link
Copy Markdown

Unrolled bit-packing kernels for longs

Add unrolled fastpackwithoutmask{1..63} / fastunpack{1..63} to
LongBitPacking, mirroring the 32-bit BitPacking, and extend both
dispatchers to a 0..64 switch.

Performance

BenchmarkLongBitPacking, Graviton (aarch64), Corretto 21. Speedup of the
unrolled kernels over the generic path:

bit pack unpack
1 3.83x 1.99x
2 3.21x 2.36x
3 3.09x 2.26x
4 2.64x 2.25x
5 2.48x 2.31x
6 2.30x 2.34x
7 2.33x 2.33x
8 2.16x 2.25x
9 2.19x 2.37x
10 2.04x 2.40x
11 2.00x 2.41x
12 2.00x 2.41x
13 2.03x 2.47x
14 1.98x 2.46x
15 1.96x 2.49x
16 1.95x 2.28x
17 1.92x 2.52x
18 1.89x 2.53x
19 1.89x 2.58x
20 1.92x 2.54x
21 1.93x 2.60x
22 1.90x 2.60x
23 1.92x 2.60x
24 1.96x 2.55x
25 1.96x 2.62x
26 1.91x 2.60x
27 1.89x 2.62x
28 1.94x 2.63x
29 1.92x 2.65x
30 1.86x 2.66x
31 1.86x 2.66x
32 1.95x 2.35x
33 1.85x 2.67x
34 1.85x 2.65x
35 1.86x 2.69x
36 1.90x 2.67x
37 1.84x 2.68x
38 1.85x 2.70x
39 1.86x 2.69x
40 1.90x 2.67x
41 1.87x 2.71x
42 1.86x 2.71x
43 1.88x 2.68x
44 1.92x 2.71x
45 1.96x 2.74x
46 1.92x 2.71x
47 1.90x 2.73x
48 2.01x 2.67x
49 1.99x 2.75x
50 1.92x 2.75x
51 1.96x 2.75x
52 1.93x 2.73x
53 1.91x 2.72x
54 1.87x 2.73x
55 1.87x 2.76x
56 2.02x 2.76x
57 1.98x 2.79x
58 1.92x 2.76x
59 1.96x 2.75x
60 2.02x 2.77x
61 1.94x 2.80x
62 1.90x 2.79x
63 1.94x 2.79x

Branch-free unrolled fastpackwithoutmask/fastunpack for all widths,
mirroring the 32-bit BitPacking.

Measured on Graviton (aarch64), Corretto 21, median over widths 1..63:
pack 1.93x, unpack 2.66x.
@raunaqmorarka raunaqmorarka force-pushed the unrolled-long-bitpacking branch from 56c7af8 to 4beeed0 Compare June 17, 2026 07:32
@piotrrzysko piotrrzysko requested review from blacelle and lemire June 17, 2026 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant