Add ABI files for MIPS/MIPS64.

GitOrigin-RevId: a3874ef0070b16eaed8c9923488bb2cca17fd110
Change-Id: Ia86432d99816e40f34955a79ddaf8ab89b191578
4 files changed
tree: 84284e97f9c30ba5d8ecbac8250ee0f448f1a146
  1. .github/
  2. arch/
  3. cmake/
  4. doc/
  5. test/
  6. tools/
  7. win32/
  8. .codecov.yaml
  9. .gitattributes
  10. .gitignore
  11. .shellcheckrc
  12. adler32.c
  13. adler32_fold.c
  14. adler32_fold.h
  15. adler32_p.h
  16. chunkset.c
  17. chunkset_tpl.h
  18. CMakeLists.txt
  19. compare256.c
  20. compare256_rle.h
  21. compress.c
  22. configure
  23. cpu_features.c
  24. cpu_features.h
  25. crc32_braid.c
  26. crc32_braid_comb.c
  27. crc32_braid_comb_p.h
  28. crc32_braid_p.h
  29. crc32_braid_tbl.h
  30. crc32_fold.c
  31. crc32_fold.h
  32. deflate.c
  33. deflate.h
  34. deflate_fast.c
  35. deflate_huff.c
  36. deflate_medium.c
  37. deflate_p.h
  38. deflate_quick.c
  39. deflate_rle.c
  40. deflate_slow.c
  41. deflate_stored.c
  42. fallback_builtins.h
  43. FAQ.zlib
  44. functable.c
  45. functable.h
  46. gzguts.h
  47. gzlib.c
  48. gzread.c.in
  49. gzwrite.c
  50. INDEX.md
  51. infback.c
  52. inffast_tpl.h
  53. inffixed_tbl.h
  54. inflate.c
  55. inflate.h
  56. inflate_p.h
  57. inftrees.c
  58. inftrees.h
  59. insert_string.c
  60. insert_string_roll.c
  61. insert_string_tpl.h
  62. LICENSE.md
  63. Makefile.in
  64. match_tpl.h
  65. PORTING.md
  66. README.md
  67. slide_hash.c
  68. trees.c
  69. trees.h
  70. trees_emit.h
  71. trees_tbl.h
  72. uncompr.c
  73. zbuild.h
  74. zconf-ng.h.in
  75. zconf.h.in
  76. zendian.h
  77. zlib-ng.h.in
  78. zlib-ng.map
  79. zlib.h.in
  80. zlib.map
  81. zlib.pc.cmakein
  82. zlib.pc.in
  83. zlib_name_mangling-ng.h.in
  84. zlib_name_mangling.h.empty
  85. zlib_name_mangling.h.in
  86. zutil.c
  87. zutil.h
  88. zutil_p.h
README.md
CIStableDevelop
GitHub ActionsStable Status
Stable Status
Stable Status
Develop Status
Develop Status
Develop Status
CodeFactorCodeFactorCodeFactor
OSS-FuzzFuzzing StatusFuzzing Status
Codecovcodecovcodecov

zlib-ng

zlib data compression library for the next generation systems

Maintained by Hans Kristian Rosbach aka Dead2 (zlib-ng àt circlestorm dót org)

Features

  • Zlib compatible API with support for dual-linking
  • Modernized native API based on zlib API for ease of porting
  • Modern C11 syntax and a clean code layout
  • Deflate medium and quick algorithms based on Intel’s zlib fork
  • Support for CPU intrinsics when available
    • Adler32 implementation using SSSE3, AVX2, AVX512, AVX512-VNNI, Neon, VMX & VSX
    • CRC32-B implementation using PCLMULQDQ, VPCLMULQDQ, ACLE, & IBM Z
    • Hash table implementation using CRC32-C intrinsics on x86 and ARM
    • Slide hash implementations using SSE2, AVX2, Neon, VMX & VSX
    • Compare256 implementations using SSE2, AVX2, Neon, & POWER9
    • Inflate chunk copying using SSE2, SSSE3, AVX, Neon & VSX
    • Support for hardware-accelerated deflate using IBM Z DFLTCC
  • Unaligned memory read/writes and large bit buffer improvements
  • Includes improvements from Cloudflare and Intel forks
  • Configure, CMake, and NMake build system support
  • Comprehensive set of CMake unit tests
  • Code sanitizers, fuzzing, and coverage
  • GitHub Actions continuous integration on Windows, macOS, and Linux
    • Emulated CI for ARM, AARCH64, PPC, PPC64, RISCV, SPARC64, S390x using qemu

History

The motivation for this fork was seeing several 3rd party contributions with new optimizations not getting implemented into the official zlib repository.

Mark Adler has been maintaining zlib for a very long time, and he has done a great job and hopefully he will continue for a long time yet. The idea of zlib-ng is not to replace zlib, but to co-exist as a drop-in replacement with a lower threshold for code change.

zlib has a long history and is incredibly portable, even supporting many systems that predate the Internet.
That is great, but it can complicate further development and maintainability. The zlib code contains many workarounds for really old compilers or to accommodate systems with limitations such as operating in a 16-bit environment.

Many of these workarounds are only maintenance burdens, some of them are pretty huge code-wise. With many workarounds cluttered throughout the code, it makes it harder for new programmers with an idea/interest for zlib to contribute.

I decided to make a fork, merge all the Intel optimizations, some of the Cloudflare optimizations, plus a couple other smaller patches. Then started cleaning out workarounds, various dead code, all contrib and example code.
The result is a better performing and easier to maintain zlib-ng.

A lot of improvements have gone into zlib-ng since its start, and numerous people and companies have contributed both small and big improvements, or valuable testing.

Build

Please read LICENSE.md, it is very simple and very liberal.

There are two ways to build zlib-ng:

Cmake

To build zlib-ng using the cross-platform makefile generator cmake.

cmake .
cmake --build . --config Release
ctest --verbose -C Release

Alternatively, you can use the cmake configuration GUI tool ccmake:

ccmake .

Configure

To build zlib-ng using the bash configure script:

./configure
make
make test

Build Options

CMakeconfigureDescriptionDefault
ZLIB_COMPAT--zlib-compatCompile with zlib compatible APIOFF
ZLIB_ENABLE_TESTSBuild test binariesON
WITH_GZFILEOP--without-gzfileopsCompile with support for gzFile related functionsON
WITH_OPTIM--without-optimizationsBuild with optimisationsON
WITH_NEW_STRATEGIES--without-new-strategiesUse new strategiesON
WITH_NATIVE_INSTRUCTIONS--nativeCompiles with full instruction set supported on this host (gcc/clang -march=native)OFF
WITH_SANITIZERBuild with sanitizer (memory, address, undefined)OFF
WITH_GTESTBuild gtest_zlibON
WITH_FUZZERSBuild test/fuzzOFF
WITH_BENCHMARKSBuild test/benchmarksOFF
WITH_MAINTAINER_WARNINGSBuild with project maintainer warningsOFF
WITH_CODE_COVERAGEEnable code coverage reportingOFF

Install

WARNING: We do not recommend manually installing unless you really know what you are doing, because this can potentially override the system default zlib library, and any incompatibility or wrong configuration of zlib-ng can make the whole system unusable, requiring recovery or reinstall. If you still want a manual install, we recommend using the /opt/ path prefix.

For Linux distros, an alternative way to use zlib-ng (if compiled in zlib-compat mode) instead of zlib, is through the use of the LD_PRELOAD environment variable. If the program is dynamically linked with zlib, then the program will temporarily attempt to use zlib-ng instead, without risking system-wide instability.

LD_PRELOAD=/opt/zlib-ng/libz.so.1.2.13.zlib-ng /usr/bin/program

Cmake

To install zlib-ng system-wide using cmake:

cmake --build . --target install

Configure

To install zlib-ng system-wide using the configure script:

make install

Vcpkg

Alternatively, you can build and install zlib-ng using the vcpkg dependency manager:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh # "./bootstrap-vcpkg.bat" for powershell
./vcpkg integrate install
./vcpkg install zlib-ng

The zlib-ng port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

Contributing

Zlib-ng is aiming to be open to contributions, and we would be delighted to receive pull requests on github. Help with testing and reviewing pull requests etc is also very much appreciated.

Please check the Wiki for more info: Contributing

Acknowledgments

Thanks go out to all the people and companies who have taken the time to contribute code reviews, testing and/or patches. Zlib-ng would not have been nearly as good without you.

The deflate format used by zlib was defined by Phil Katz.
The deflate and zlib specifications were written by L. Peter Deutsch.

zlib was originally created by Jean-loup Gailly (compression) and Mark Adler (decompression).

Advanced Build Options

CMakeconfigureDescriptionDefault
FORCE_SSE2--force-sse2Skip runtime check for SSE2 instructions (Always on for x86_64)OFF (x86)
WITH_AVX2Build with AVX2 intrinsicsON
WITH_AVX512Build with AVX512 intrinsicsON
WITH_AVX512VNNIBuild with AVX512VNNI intrinsicsON
WITH_SSE2Build with SSE2 intrinsicsON
WITH_SSSE3Build with SSSE3 intrinsicsON
WITH_SSE42Build with SSE42 intrinsicsON
WITH_PCLMULQDQBuild with PCLMULQDQ intrinsicsON
WITH_VPCLMULQDQ--without-vpclmulqdqBuild with VPCLMULQDQ intrinsicsON
WITH_ACLE--without-acleBuild with ACLE intrinsicsON
WITH_NEON--without-neonBuild with NEON intrinsicsON
WITH_ALTIVEC--without-altivecBuild with AltiVec (VMX) intrinsicsON
WITH_POWER8--without-power8Build with POWER8 optimisationsON
WITH_RVVBuild with RVV intrinsicsON
WITH_CRC32_VX--without-crc32-vxBuild with vectorized CRC32 on IBM ZON
WITH_DFLTCC_DEFLATE--with-dfltcc-deflateBuild with DFLTCC intrinsics for compression on IBM ZOFF
WITH_DFLTCC_INFLATE--with-dfltcc-inflateBuild with DFLTCC intrinsics for decompression on IBM ZOFF
WITH_UNALIGNED--without-unalignedAllow optimizations that use unaligned reads if safe on current archON
WITH_INFLATE_STRICTBuild with strict inflate distance checkingOFF
WITH_INFLATE_ALLOW_INVALID_DISTBuild with zero fill for inflate invalid distancesOFF
INSTALL_UTILSCopy minigzip and minideflate during installOFF
ZLIBNG_ENABLE_TESTSTest zlib-ng specific APION

Related Projects