[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
Sun Oct 2 18:30:13 BST 2022


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

--- Comment #41 from Jacob Lifshay <programmerjake at gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #40)
> (In reply to Jacob Lifshay from comment #39)
> > (In reply to Jacob Lifshay from comment #38)
> > > https://www.mpg123.de/cgi-bin/scm/mpg123/trunk/src/libmpg123/layer3.c?revision=4971&view=markup#l622
> > > that while loop would be replaced with a loop on a pcdec. instruction and
> > > would need to loop 4/6 as often since pcdec. processes 6 bits at a time and
> > > that loop processes 4 bits at a time.
> > 
> > i'm sure that isn't the only loop that can be sped up with pcdec.
> 
> the bit i'd really like to see is, does "sv.pcdec./ff=SO"
> do what's expected (and useful): truncate VL at a point which
> can be easily detected, does "sv.bc SO" help in detecting that
> there was an overflow in the vector of ConditionCodes, and so on.

it turns out that because prefix-codes are almost always (at least in both JPEG
and DEFLATE) interleaved with plain binary bits or prefix-codes using different
`tree` values, attempting to vectorize prefix-code decoding doesn't really
work. even if it did, it wouldn't be much faster than a scalar pcdec. loop
because of the scalar dependency chain between each pcdec. and the next/prev
pcdec.

that said, sv.pcdec./ff=ne should do what you're imagining afaict.

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


More information about the Libre-SOC-ISA mailing list