Skip to content

Commit

Permalink
lib/x86/adler32: refactor and improve implementations
Browse files Browse the repository at this point in the history
- Refactor the x86 implementations of Adler-32 to be organized like the
  x86 implementations of CRC-32, where there's an x86-specific template
  that expands into the different implementations.

- Add an AVX512VNNI implementation using 256-bit vectors.

- Increase the number of vectors processed per iteration of the inner
  loop of the AVX512VNNI implementations from 2 to 4.

- Handle small amounts of data more efficiently.  If the length is
  small, don't bother aligning the pointer at the beginning.  Also
  optimize the handling of any bytes left over after the inner loop.
  Also avoid doing redundant reductions mod 65521.

- Make the AVX-VNNI implementation dot with 1's so that all VNNI
  implementations use the same strategy.

- Put "_x86" in the name of the functions, like what is done for CRC-32.
  • Loading branch information
ebiggers committed Mar 4, 2024
1 parent 1bc5a19 commit 8d9c33f
Show file tree
Hide file tree
Showing 5 changed files with 584 additions and 364 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ if(LIBDEFLATE_ZLIB_SUPPORT)
lib/adler32_vec_template.h
lib/arm/adler32_impl.h
lib/x86/adler32_impl.h
lib/x86/adler32_template.h
lib/zlib_constants.h
)
if(LIBDEFLATE_COMPRESSION_SUPPORT)
Expand Down
Loading

0 comments on commit 8d9c33f

Please sign in to comment.