[Libre-soc-isa] [Bug 933] prefix-code (like huffman code) decode/encode instructions

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Sat Sep 24 02:31:01 BST 2022


https://bugs.libre-soc.org/show_bug.cgi?id=933

--- Comment #29 from Jacob Lifshay <programmerjake at gmail.com> ---
Additional Notes:

it turns out that with a 64-bit tree the code length limit is 5-bits:
2 possible 1-bit codes
4 possible 2-bit codes
8 possible 3-bit codes
16 possible 4-bit codes
32 possible 5-bit codes
sum: 62 which just barely fits in a 64-bit register


a prefix-code encode instruction is possibly not as necessary, since it's
possible to encode in parallel by looking up the symbol's bits and lengths in a
table, and shifting them into position in parallel and or-ing them all
together.
This doesn't have a serial dependency like prefix-code decoding does, so is
much easier to vectorize.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Libre-SOC-ISA mailing list