exynos-linux-stable/lib/zstd
Nick Terrell 4cbf3d88c0 zstd: Improve fast huffman decoding speed in linux kernel
gcc in the linux kernel was not unrolling the inner loops of the Huffman
decoder, which was destroying decoding performance. The compiler was
generating crazy code with all sorts of branches. I suspect because of
Spectre mitigations, but I'm not certain. Once the loops were manually
unrolled, performance was restored.

Additionally, when gcc couldn't prove that the variable left shift in
the 4X2 decode loop wasn't greater than 63, it inserted checks to verify
it. To fix this, mask `entry.nbBits & 0x3F`, which allows gcc to eliete
this check. This is a no op, because  is guaranteed to be
less than 64.

Lastly, introduce the `HUF_DISABLE_FAST_DECODE` macro to disable the
fast C loops for Issue https://github.com/facebook/zstd/issues/3762 . So if even after this change, there is a
performance regression, users can opt-out at compile time.
2023-12-17 21:12:40 +03:00
..
common zstd: Backport fix for arry-index-out-of-bounds UBSAN warning 2023-12-17 21:12:40 +03:00
compress zstd: Import upstream v1.5.5 2023-04-11 19:03:42 +03:00
decompress zstd: Improve fast huffman decoding speed in linux kernel 2023-12-17 21:12:40 +03:00
decompress_sources.h zstd: Import upstream v1.5.4 2023-02-21 00:21:21 +03:00
Makefile zstd: Import upstream v1.5.4 2023-02-21 00:21:21 +03:00
zstd_common_module.c zstd: Import upstream v1.5.4 2023-02-21 00:21:21 +03:00
zstd_compress_module.c zstd: Import upstream v1.5.4 2023-02-21 00:21:21 +03:00
zstd_decompress_module.c zstd: Import upstream v1.5.4 2023-02-21 00:21:21 +03:00