]> git.ipfire.org Git - thirdparty/zlib-ng.git/log
thirdparty/zlib-ng.git
3 years agoIntel compilers: update deprecated -wn to -Wall style
Michael Hirsch [Tue, 25 Jan 2022 00:22:01 +0000 (19:22 -0500)] 
Intel compilers: update deprecated -wn to -Wall style

This removes warnings on every single target like:
icx: command line warning #10430: Unsupported command line options encountered
These options as listed are not supported.
For more information, use '-qnextgen-diag'.
option list:
        -w3

Signed-off-by: Michael Hirsch <michael@scivision.dev>
3 years agoFixed GCC warning about unused variable in longest_match.
Nathan Moinvaziri [Mon, 24 Jan 2022 04:15:40 +0000 (20:15 -0800)] 
Fixed GCC warning about unused variable in longest_match.

match_tpl.h:47:13: warning: unused variable ‘scan_start’ [-Wunused-variable]
   47 |     uint8_t scan_start[8], scan_end[8];

3 years agoMake cmake and configure release flags consistent
Adam Stylinski [Tue, 25 Jan 2022 05:16:37 +0000 (00:16 -0500)] 
Make cmake and configure release flags consistent

CMake sufficiently appends -DNDEBUG to the preprocessor macros when not
compiling with debug symbols.  This turns off debug level assertions and
has some other side effects.  As such, we should equally append this
define to the configure scripts' CFLAGS.

3 years agoRemove unused fdopen define for MSVC.
Nathan Moinvaziri [Mon, 24 Jan 2022 00:18:05 +0000 (16:18 -0800)] 
Remove unused fdopen define for MSVC.

3 years agoUse pigz version 2.6 due to bug in NOTHREADS support.
Nathan Moinvaziri [Sat, 22 Jan 2022 21:06:14 +0000 (13:06 -0800)] 
Use pigz version 2.6 due to bug in NOTHREADS support.
https://github.com/madler/pigz/issues/97

3 years agoAllow setting of version when building with pigz.
Nathan Moinvaziri [Sat, 22 Jan 2022 21:05:44 +0000 (13:05 -0800)] 
Allow setting of version when building with pigz.

3 years agoMove cpu feature variant callback typedefs to cpu_features header.
Nathan Moinvaziri [Sat, 22 Jan 2022 17:49:13 +0000 (09:49 -0800)] 
Move cpu feature variant callback typedefs to cpu_features header.

3 years agoUse extern keyword in slide_hash function definitions.
Nathan Moinvaziri [Sat, 22 Jan 2022 17:38:20 +0000 (09:38 -0800)] 
Use extern keyword in slide_hash function definitions.

3 years agoGroup together functable definitions that use deflate_state.
Nathan Moinvaziri [Sat, 22 Jan 2022 17:37:13 +0000 (09:37 -0800)] 
Group together functable definitions that use deflate_state.

3 years agoUse cpu_check_features in inflate and deflate.
Nathan Moinvaziri [Sat, 22 Jan 2022 17:28:37 +0000 (09:28 -0800)] 
Use cpu_check_features in inflate and deflate.

3 years agoMove cpu_feature includes out of zutil.h.
Nathan Moinvaziri [Sat, 22 Jan 2022 17:27:58 +0000 (09:27 -0800)] 
Move cpu_feature includes out of zutil.h.

3 years agoUse fixed width types in compare256 definition.
Nathan Moinvaziri [Sat, 22 Jan 2022 17:17:19 +0000 (09:17 -0800)] 
Use fixed width types in compare256 definition.

3 years agoFixed inadvertent breakage of CPUID usage
Adam Stylinski [Sun, 23 Jan 2022 01:47:45 +0000 (20:47 -0500)] 
Fixed inadvertent breakage of CPUID usage

In removing the AVX512 "well-suited" flag, a second cpuid call that's
needed for feature detection was accidently removed.  This brings that
back.

3 years agoRemove the "avx512_well_suited" cpu flag
Adam Stylinski [Tue, 18 Jan 2022 14:47:45 +0000 (09:47 -0500)] 
Remove the "avx512_well_suited" cpu flag

Now that we have confirmation that the AVX512 variants so far have been
universally better on every capable CPU we've tested them on, there's no
sense in trying to maintain a whitelist.

3 years agoImprovements to avx512 adler32 implementations
Adam Stylinski [Mon, 17 Jan 2022 14:27:32 +0000 (09:27 -0500)] 
Improvements to avx512 adler32 implementations

Now that better benchmarks are in place, it became apparent that masked
broadcast was _not_ faster and it's actually faster to use vmovd, as
suspected.  Additionally, for the VNNI variant, we've unlocked some
additional ILP by doing a second dot product in the loop to a different
running sum that gets recombined later.  This broke a data dependency
chain and allowed the IPC be ~2.75. The result is about a 40-50%
improvement in runtime.

Additionally, we've called the lesser SIMD sized variants if the input
is too small and they happen to be compiled in.  This helps for the
impossibly small input that still is large enough to be a vector length.
For size 16 and 32 inputs I was seeing something like sub 10 ns instead
of 50 ns.

3 years agoFixed AVX512-VNNI detection when compiling with ClangCl.
Nathan Moinvaziri [Tue, 18 Jan 2022 00:17:00 +0000 (16:17 -0800)] 
Fixed AVX512-VNNI detection when compiling with ClangCl.

3 years agoRemove crc32 and adler32 shared library tests which don't test anyting further than...
Nathan Moinvaziri [Tue, 18 Jan 2022 00:32:02 +0000 (16:32 -0800)] 
Remove crc32 and adler32 shared library tests which don't test anyting further than what is provided by crc32 static build or examplesh.

3 years agoRename test binaries with test_ prefix.
Nathan Moinvaziri [Tue, 18 Jan 2022 00:30:10 +0000 (16:30 -0800)] 
Rename test binaries with test_ prefix.

3 years agoFixed incorrect version of AVX specified for inflate chunk copying in feature list.
Nathan Moinvaziri [Fri, 14 Jan 2022 20:19:11 +0000 (12:19 -0800)] 
Fixed incorrect version of AVX specified for inflate chunk copying in feature list.

3 years agoMerge feature list entries for crc32.
Nathan Moinvaziri [Fri, 14 Jan 2022 20:15:50 +0000 (12:15 -0800)] 
Merge feature list entries for crc32.

3 years agoClean up and remove bestcmp_t type for longest_match. Use 8 byte buffer (max int...
Nathan Moinvaziri [Sat, 15 Jan 2022 21:30:08 +0000 (13:30 -0800)] 
Clean up and remove bestcmp_t type for longest_match. Use 8 byte buffer (max int comparison size) and cast to integer type when making comparison.

3 years agoClean up crc32_fold structure and clearly define the size of the fold buffer.
Nathan Moinvaziri [Sun, 2 Jan 2022 23:27:00 +0000 (15:27 -0800)] 
Clean up crc32_fold structure and clearly define the size of the fold buffer.

3 years agoAdded adler32, compare256, crc32, and slide_hash benchmarks using Google Benchmark.
Nathan Moinvaziri [Sat, 8 Jan 2022 21:28:41 +0000 (13:28 -0800)] 
Added adler32, compare256, crc32, and slide_hash benchmarks using Google Benchmark.

Co-authored-by: Adam Stylinski <kungfujesus06@gmail.com>
3 years agoChange fuzzer binaries and solutions to prefix with fuzzer_.
Nathan Moinvaziri [Mon, 3 Jan 2022 21:07:24 +0000 (13:07 -0800)] 
Change fuzzer binaries and solutions to prefix with fuzzer_.

3 years agoImproved AVX2 adler32 performance
Adam Stylinski [Sun, 9 Jan 2022 16:57:24 +0000 (11:57 -0500)] 
Improved AVX2 adler32 performance

Did this by simply doing 32 bit horizontal sums and using the same sum
of absolute difference instructions as done in the SSE4 and AVX512_VNNI
versions.

3 years agoConvert compare258 to compare256 and moved 2 byte check into deflate_quick. Prevents...
Nathan Moinvaziri [Sat, 8 Jan 2022 22:42:09 +0000 (14:42 -0800)] 
Convert compare258 to compare256 and moved 2 byte check into deflate_quick. Prevents having multiple compare258 functions with 2 byte checks.

3 years agoMerge crc32_little and crc32_big with preprocessor macros for each endian. Removed...
Nathan Moinvaziri [Sun, 9 Jan 2022 15:35:10 +0000 (07:35 -0800)] 
Merge crc32_little and crc32_big with preprocessor macros for each endian. Removed crc32_generic since it is not being used.

3 years agoRemove unmaintained index markdown in arch/x86.
Nathan Moinvaziri [Fri, 14 Jan 2022 01:05:16 +0000 (17:05 -0800)] 
Remove unmaintained index markdown in arch/x86.

3 years agoRemove unmaintained and out-dated DLL FAQ.
Nathan Moinvaziri [Fri, 14 Jan 2022 01:02:49 +0000 (17:02 -0800)] 
Remove unmaintained and out-dated DLL FAQ.

3 years agoRename x86 source files with instruction set version.
Nathan Moinvaziri [Sun, 2 Jan 2022 21:19:47 +0000 (13:19 -0800)] 
Rename x86 source files with instruction set version.

3 years agoRemove unused COMPARE258 macro since longest_match only uses COMPARE256.
Nathan Moinvaziri [Sat, 8 Jan 2022 21:28:41 +0000 (13:28 -0800)] 
Remove unused COMPARE258 macro since longest_match only uses COMPARE256.

3 years agobuild: fix check for SSSE3 when using Emscripten
merceyz [Sat, 1 Jan 2022 14:57:31 +0000 (15:57 +0100)] 
build: fix check for SSSE3 when using Emscripten

3 years agoVPCLMULQDQ implementation for Intel's CRC32 folding.
Nathan Moinvaziri [Wed, 15 Dec 2021 22:21:58 +0000 (14:21 -0800)] 
VPCLMULQDQ implementation for Intel's CRC32 folding.
Based on PR https://github.com/jtkukunas/zlib/pull/28.

Co-authored-by: Wangyang Guo <wangyang.guo@intel.com>
3 years agoAdded an SSE4 optimized adler32 checksum
Adam Stylinski [Tue, 4 Jan 2022 15:38:39 +0000 (10:38 -0500)] 
Added an SSE4 optimized adler32 checksum

This variant uses the lower number of cycles psadw insruction in place
of pmaddubsw for the running sum that does not need multiplication.

This allows this sum to be done independently, partially overlapping the
running "sum2" half of the checksum.  We also have moved the shift
outside of the loop, breaking a small data dependency chain. The code
also now does a vectorized horizontal sum without having to rebase to
the adler32 base, as NMAX is defined as the maximum number of scalar
sums that can be peformed, so we're actually safe in doing this without
upgrading to higher precision.  We can do a partial horizontal sum
because psadw only ends up accumulating 16 bit words in 2 vector lanes,
the other two can safely be assumed as 0.

3 years agoAdd SSE4.1 detection
Adam Stylinski [Tue, 4 Jan 2022 15:37:24 +0000 (10:37 -0500)] 
Add SSE4.1 detection

Code leveraging this for the adler checksum is forthcoming

3 years agoUse memcpy for unaligned reads.
Nathan Moinvaziri [Mon, 27 Dec 2021 03:56:12 +0000 (19:56 -0800)] 
Use memcpy for unaligned reads.

Co-authored-by: Matija Skala <mskala@gmx.com>
3 years agoFixed missing pointers to functions when assigning to functable.
Nathan Moinvaziri [Fri, 7 Jan 2022 17:44:12 +0000 (09:44 -0800)] 
Fixed missing pointers to functions when assigning to functable.

3 years agoClean up crc32 extern using #elif same as in crc32_stub.
Nathan Moinvaziri [Fri, 31 Dec 2021 17:28:34 +0000 (09:28 -0800)] 
Clean up crc32 extern using #elif same as in crc32_stub.

3 years agoRemove use_byfour compile time detection of the existence of four byte integer types...
Nathan Moinvaziri [Tue, 4 Jan 2022 16:30:39 +0000 (08:30 -0800)] 
Remove use_byfour compile time detection of the existence of four byte integer types since we are targeting newer systems.

3 years agoMove generic crc32 assignment to else statement so it can be optimized away if use_by...
Nathan Moinvaziri [Fri, 31 Dec 2021 16:22:35 +0000 (08:22 -0800)] 
Move generic crc32 assignment to else statement so it can be optimized away if use_byfour is true.

3 years agoDon't assign C versions of compare258 and longest_match if we don't use them.
Nathan Moinvaziri [Fri, 31 Dec 2021 16:15:34 +0000 (08:15 -0800)] 
Don't assign C versions of compare258 and longest_match if we don't use them.

3 years agoHave functioning avx512{,_vnni} adler32
Adam Stylinski [Fri, 7 Jan 2022 20:51:09 +0000 (15:51 -0500)] 
Have functioning avx512{,_vnni} adler32

The new adler32 checksum uses the VNNI instructions with appreciable
gains when possible. Otherwise, a pure avx512f variant exists which
still gives appreciable gains.

3 years agoCheck for err == Z_OK is always true in minideflate loops.
Nathan Moinvaziri [Thu, 30 Dec 2021 04:48:47 +0000 (20:48 -0800)] 
Check for err == Z_OK is always true in minideflate loops.

3 years agoFixed main function does not return value which may indicated unintended behavior.
Nathan Moinvaziri [Thu, 30 Dec 2021 04:45:12 +0000 (20:45 -0800)] 
Fixed main function does not return value which may indicated unintended behavior.

3 years agoFixed part of conditional expression is always true since size is always greater...
Nathan Moinvaziri [Thu, 30 Dec 2021 04:33:08 +0000 (20:33 -0800)] 
Fixed part of conditional expression is always true since size is always greater than 0.

3 years agoFixed crc32 assembly not returning hash value to correct variable.
Nathan Moinvaziri [Wed, 29 Dec 2021 23:51:00 +0000 (15:51 -0800)] 
Fixed crc32 assembly not returning hash value to correct variable.

3 years agoDon't build DLL sources if BUILD_SHARED_LIBS=OFF.
Nathan Moinvaziri [Sat, 25 Dec 2021 04:18:05 +0000 (20:18 -0800)] 
Don't build DLL sources if BUILD_SHARED_LIBS=OFF.

3 years agoFixed duplicate symbol zng_inflate_table and zng_inflate_copyright when BUILD_SHARED_...
Nathan Moinvaziri [Sat, 25 Dec 2021 04:19:03 +0000 (20:19 -0800)] 
Fixed duplicate symbol zng_inflate_table and zng_inflate_copyright when BUILD_SHARED_LIBS=OFF.

3 years agoMove stdint.h below zconf include to prevent unexpected characters warning on ClangCl.
Nathan Moinvaziri [Sat, 25 Dec 2021 01:02:13 +0000 (17:02 -0800)] 
Move stdint.h below zconf include to prevent unexpected characters warning on ClangCl.

3 years agoFixed incorrect flag used for SSE 4.2 support with ClangCl.
Nathan Moinvaziri [Sat, 25 Dec 2021 00:42:23 +0000 (16:42 -0800)] 
Fixed incorrect flag used for SSE 4.2 support with ClangCl.

3 years agoFixed implicit declaration of _mm_extract_epi32 when compiling with ClangCl.
Nathan Moinvaziri [Fri, 24 Dec 2021 21:08:32 +0000 (13:08 -0800)] 
Fixed implicit declaration of _mm_extract_epi32 when compiling with ClangCl.

3 years agoFixed wrong alignment definition used when compiling with ClangCl.
Nathan Moinvaziri [Fri, 24 Dec 2021 20:33:15 +0000 (12:33 -0800)] 
Fixed wrong alignment definition used when compiling with ClangCl.

3 years agoFix building shared tests
Mika Lindqvist [Thu, 6 Jan 2022 15:29:19 +0000 (17:29 +0200)] 
Fix building shared tests
* Don't add non-PIC gz sources to shared executables if they are already included in shared library as PIC sources

3 years agoRemove old win32 readme.
Nathan Moinvaziri [Tue, 4 Jan 2022 22:57:18 +0000 (14:57 -0800)] 
Remove old win32 readme.

3 years agoRemove double check for SSE4 in configure.
Nathan Moinvaziri [Tue, 4 Jan 2022 03:48:06 +0000 (19:48 -0800)] 
Remove double check for SSE4 in configure.

3 years agoFixed crc32_combine_gen declaration warning in zlib-ng API.
Nathan Moinvaziri [Mon, 20 Dec 2021 16:23:44 +0000 (08:23 -0800)] 
Fixed crc32_combine_gen declaration warning in zlib-ng API.

3 years agoUpgrade version of GitHub checkout actions. #1078
Nathan Moinvaziri [Mon, 20 Dec 2021 16:15:40 +0000 (08:15 -0800)] 
Upgrade version of GitHub checkout actions. #1078

3 years agoFix deflateBound and compressBound returning very small size estimates.
Hans Kristian Rosbach [Mon, 13 Dec 2021 21:30:58 +0000 (22:30 +0100)] 
Fix deflateBound and compressBound returning very small size estimates.
Remove workaround in switchlevels.c, so we do actual testing of this.
Use named defines instead of magic numbers where we can.

3 years agoAvoid warning C4295 when using Visual C++ and maintainer warnings are enabled.
Mika Lindqvist [Wed, 15 Dec 2021 07:18:03 +0000 (09:18 +0200)] 
Avoid warning C4295 when using Visual C++ and maintainer warnings are enabled.

3 years agoRemove gz_intmax implementation, since INT_MAX is always available in modern C implem...
Hans Kristian Rosbach [Mon, 13 Dec 2021 15:24:20 +0000 (16:24 +0100)] 
Remove gz_intmax implementation, since INT_MAX is always available in modern C implementations.

3 years agointtypes.h includes stdint.h, so only include one of them.
Hans Kristian Rosbach [Mon, 13 Dec 2021 15:46:21 +0000 (16:46 +0100)] 
inttypes.h includes stdint.h, so only include one of them.

3 years agoAdded checks and comments to ensure that when using raw mode no checksumming takes...
Nathan Moinvaziri [Wed, 8 Dec 2021 00:29:01 +0000 (19:29 -0500)] 
Added checks and comments to ensure that when using raw mode no checksumming takes place.

3 years agoAdded unit test to ensure that inflate with adler32 hash works on previously failed...
Nathan Moinvaziri [Tue, 7 Dec 2021 21:24:26 +0000 (16:24 -0500)] 
Added unit test to ensure that inflate with adler32 hash works on previously failed test case.

3 years agoDon't overwrite adler32 hash with crc32 hash. #1066
Nathan Moinvaziri [Tue, 7 Dec 2021 20:52:05 +0000 (15:52 -0500)] 
Don't overwrite adler32 hash with crc32 hash. #1066

3 years agoWorkaround for installation failure of wine32.
Mika Lindqvist [Sat, 4 Dec 2021 06:25:17 +0000 (08:25 +0200)] 
Workaround for installation failure of wine32.

3 years agoMade this work on 32 bit compilations
Adam Stylinski [Thu, 2 Dec 2021 22:05:55 +0000 (17:05 -0500)] 
Made this work on 32 bit compilations

For some reason the movq instruction from a 128 bit register to a 64 bit
GPR is not supported in 32 bit code.  A simple workaround seems to be to
invoke movl if compiling with -m32.

Also addressing some style nits.

3 years agoHave horizontal sum here, decent wins
Adam Stylinski [Sun, 24 Oct 2021 21:44:33 +0000 (17:44 -0400)] 
Have horizontal sum here, decent wins

3 years agoMinor efficiency improvement
Adam Stylinski [Sun, 24 Oct 2021 23:24:53 +0000 (19:24 -0400)] 
Minor efficiency improvement

This now leverages the broadcasting instrinsics with an AND mask
to load up the registers.  Additionally, there's a minor efficiency
boost here by casting up to 64 bit precision (by means of register
aliasing) so that the modulo can be safely deferred until the write
back to the full sums.

The "write" back to the stack here is actually optimized out by GCC
and turned into a write directly to a 32 bit GPR for each of the 8
elements.  This much is not new, but now, since we don't have to do a
modulus with the BASE value, we can bypass 8 64 bit multiplications,
shifts, and subtractions while in those registers.

I tried to do a horizontal reduction sum on the 8 64 bit elements since
the vpextract* set of instructions aren't exactly low latency, however
to do this safely (no overflow) it requires 2 128 bit register extractions,
8 vpmovsxdq to bring the things up to 64 bit precision, some shuffles, more
128 bit extractions to get around the 128 bit lane requirement of the shuffles,
and finally a trip to a GPR and back to do the modulus on the scalar value.
This method could have been more efficient if there were an inexpensive 64 bit
horizontal addition instruction for AVX, but there isn't.

To test this, I wrote a pretty basic benchmark using Python's zlib bindings on
a huge set of random data, carefully timing only the checksum bits.  Invoking
perf stat from within the python process after the RNG shows a lower average
number of cycles to complete and a shorter runtime.

3 years agoUse immediate variant of shift instruction
Adam Stylinski [Sat, 23 Oct 2021 16:38:12 +0000 (12:38 -0400)] 
Use immediate variant of shift instruction

Since this is constant, anyway, we may as well use the variant that
doesn't add vector register pressure, has better ILP opportunities,
and has shorter instruction latency.

3 years agoReuse adler32_len_64 in adler32_c.
Nathan Moinvaziri [Mon, 15 Nov 2021 04:58:01 +0000 (20:58 -0800)] 
Reuse adler32_len_64 in adler32_c.

3 years agoFixed inflateGetDictionary length check may include bytes added by last call to inflate.
Nathan Moinvaziri [Thu, 28 Oct 2021 00:58:21 +0000 (17:58 -0700)] 
Fixed inflateGetDictionary length check may include bytes added by last call to inflate.

3 years agoDFLTCC update for window optimization from Jim & Nathan
Ilya Leoshkevich [Mon, 25 Oct 2021 22:50:26 +0000 (18:50 -0400)] 
DFLTCC update for window optimization from Jim & Nathan

Stop relying on software and hardware inflate window formats being the
same and act the way we already do for deflate: provide and implement
window-related hooks.

Another possibility would be to use an in-line history buffer (by not
setting HBT_CIRCULAR), but this would require an extra memmove().

Also fix a couple corner cases in the software implementation of
inflateGetDictionary() and inflateSetDictionary().

3 years agoAdd back original version of inflate_fast for use with inflateBack.
Nathan Moinvaziri [Mon, 23 Aug 2021 19:21:40 +0000 (12:21 -0700)] 
Add back original version of inflate_fast for use with inflateBack.

3 years agoReorganize inflate window layout
Jim Kukunas [Wed, 30 Jun 2021 23:36:08 +0000 (19:36 -0400)] 
Reorganize inflate window layout

This commit significantly improves inflate performance by reorganizing the window buffer into a contiguous window and pending output buffer. The goal of this layout is to reduce branching, improve cache locality, and enable for the use of crc folding with gzip input.

The window buffer is allocated as a multiple of the user-selected window size. In this commit, a factor of 2 is utilized.

The layout of the window buffer is divided into two sections. The first section, window offset [0, wsize), is reserved for history that has already been output. The second section, window offset [wsize, 2 * wsize), is reserved for buffering pending output that hasn't been flushed to the user's output buffer yet.

The history section grows downwards, towards the window offset of 0. The pending output section grows upwards, towards the end of the buffer. As a result, all of the possible distance/length data that may need to be copied is contiguous. This removes the need to stitch together output from 2 separate buffers.

In the case of gzip input, crc folding is used to copy the pending output to the user's buffers.

Co-authored-by: Nathan Moinvaziri <nathan@nathanm.com>
3 years agoFixed minideflate write buffers being overwritten.
Nathan Moinvaziri [Fri, 12 Nov 2021 01:55:13 +0000 (17:55 -0800)] 
Fixed minideflate write buffers being overwritten.

3 years ago[ARM] Try to compile test for float-abi detection code.
Mika Lindqvist [Fri, 29 Oct 2021 17:08:30 +0000 (20:08 +0300)] 
[ARM] Try to compile test for float-abi detection code.

3 years ago[MacOS] Downgrade to XCode 11.7.0 for pkgcheck.
Mika Lindqvist [Fri, 29 Oct 2021 17:57:31 +0000 (20:57 +0300)] 
[MacOS] Downgrade to XCode 11.7.0 for pkgcheck.

4 years agoIBM Z: Run DFLTCC tests on the self-hosted builder
Ilya Leoshkevich [Wed, 4 Aug 2021 22:27:31 +0000 (00:27 +0200)] 
IBM Z: Run DFLTCC tests on the self-hosted builder

* Use the self-hosted builder instead of ubuntu-latest.
* Drop qemu-related settings from DFLTCC configurations.
* Install codecov only for the current user, since the self-hosted
  builder runs under a restricted non-root account.
* Use actions/checkout@v2 for configure checks, since for some reason
  actions/checkout@v1 cannot find git on the self-hosted builder.
* Update the testing section of the DFLTCC README.
* Add the infrastructure code for the self-hosted builder.

4 years agoENH: Transition to Ubuntu 18.04 in `GitHub` actions workflows
Jon Haitz Legarreta Gorroño [Wed, 13 Oct 2021 13:58:41 +0000 (09:58 -0400)] 
ENH: Transition to Ubuntu 18.04 in `GitHub` actions workflows

Transition to Ubuntu 18.04 in `GitHub` actions workflows.

Fixes:
```
Ubuntu 16.04 Clang
This request was automatically failed because there were no enabled runners online to process the request for more than 1 days.

Ubuntu 16.04 GCC
This request was automatically failed because there were no enabled runners online to process the request for more than 1 days.
```

reported for example at:
https://github.com/zlib-ng/zlib-ng/actions/runs/1326434358

Official `GitHub` notice related to the removal of the 16.04 virtual
environments:
https://github.blog/changelog/2021-04-29-github-actions-ubuntu-16-04-lts-virtual-environment-will-be-removed-on-september-20-2021/

4 years agoFix minor formatting issues
Dženan Zukić [Mon, 6 Sep 2021 18:38:09 +0000 (14:38 -0400)] 
Fix minor formatting issues

From ITK PR: https://github.com/InsightSoftwareConsortium/ITK/pull/2803
CI check: https://github.com/InsightSoftwareConsortium/ITK/runs/3864083025

commit 5434d42 adds bad whitespace:
README.md:223: new blank line at EOF.

commit 5434d42 is not allowed; missing newline at the end of file in .gitattributes.

4 years agoCOMP: Fix data loss warning
Jon Haitz Legarreta Gorroño [Sun, 10 Oct 2021 14:51:09 +0000 (10:51 -0400)] 
COMP: Fix data loss warning

Fix data loss warning.

Fixes:
```
itkzlib-ng/inflate.c(1209,24): warning C4267: '=': conversion from 'size_t' to 'unsigned long', possible loss of data
itkzlib-ng/inflate.c(1210,26): warning C4267: '=': conversion from 'size_t' to 'unsigned long', possible loss of data
```

4 years agoMake integration into bigger projects easier
Dženan Zukić [Mon, 6 Sep 2021 18:26:56 +0000 (14:26 -0400)] 
Make integration into bigger projects easier

4 years agoIBM Z: Adjust compressBound() for DFLTCC
Ilya Leoshkevich [Mon, 11 Oct 2021 10:24:20 +0000 (12:24 +0200)] 
IBM Z: Adjust compressBound() for DFLTCC

When DFLTCC was introduced, deflateBound() was adjusted, but
compressBound() was not, leading to compression failures when using
compressBound() + compress() with poorly compressible data.

4 years agoIBM Z: Sync crc_fold with DFLTCC
Ilya Leoshkevich [Mon, 11 Oct 2021 11:22:13 +0000 (13:22 +0200)] 
IBM Z: Sync crc_fold with DFLTCC

Intermediate CRC32 value was moved from strm->adler to
state->crc_fold.

4 years agoIBM Z: Do not check inflateGetDictionary() with DFLTCC
Ilya Leoshkevich [Mon, 11 Oct 2021 11:47:20 +0000 (13:47 +0200)] 
IBM Z: Do not check inflateGetDictionary() with DFLTCC

The zlib manual does not specify a strict contract for
inflateGetDictionary(), it merely says that it "Returns the sliding
dictionary being maintained by inflate", which is an implementation
detail. IBM Z inflate's behavior differs from that of software, and
may change in the future to boot.

4 years agoLink crc32_test and infcover with $(CFLAGS)
Ilya Leoshkevich [Mon, 11 Oct 2021 10:36:28 +0000 (12:36 +0200)] 
Link crc32_test and infcover with $(CFLAGS)

This fixes link failures when using CFLAGS=-m31 on IBM Z. All the
other tests are already linked this way.

4 years agoIBM Z: Fix building outside of a source directory
Ilya Leoshkevich [Mon, 11 Oct 2021 11:12:42 +0000 (13:12 +0200)] 
IBM Z: Fix building outside of a source directory

Do not use relative includes, since they are valid only within the
source directory. Rely on the build system to pass the necessary
include flags instead.

4 years agoExercise the new symbol prefix option in CI tests
Dženan Zukić [Wed, 22 Sep 2021 21:08:06 +0000 (17:08 -0400)] 
Exercise the new symbol prefix option in CI tests

4 years agoAdd support for name mangling
Dženan Zukić [Mon, 6 Sep 2021 20:39:28 +0000 (16:39 -0400)] 
Add support for name mangling

This is useful when zlib-ng is embedded into another library,
such as ITK: https://itk.org/

Closes #1025.

Co-authored-by: Mika Lindqvist <postmaster@raasu.org>
4 years agoUse helper function for printing error and exiting in example.
Nathan Moinvaziri [Mon, 12 Jul 2021 03:31:08 +0000 (20:31 -0700)] 
Use helper function for printing error and exiting in example.

4 years agoAdded code coverage for inflateGetDictionary in example.
Nathan Moinvaziri [Sun, 11 Jul 2021 23:17:30 +0000 (16:17 -0700)] 
Added code coverage for inflateGetDictionary in example.

4 years agoCall deflateBound to calculate length with custom gzip header in example.
Nathan Moinvaziri [Sun, 11 Jul 2021 23:58:48 +0000 (16:58 -0700)] 
Call deflateBound to calculate length with custom gzip header in example.

4 years agoFill out gzheader before calling deflateSetHeader for better code coverage in example.
Nathan Moinvaziri [Sun, 11 Jul 2021 23:59:21 +0000 (16:59 -0700)] 
Fill out gzheader before calling deflateSetHeader for better code coverage in example.

4 years agoAdded CI instances for CTZLL and CTZ builtin existence to improve code coverage.
Nathan Moinvaziri [Sat, 10 Jul 2021 17:08:53 +0000 (10:08 -0700)] 
Added CI instances for CTZLL and CTZ builtin existence to improve code coverage.

4 years agoFix UB in inffast.c when not using window
Ori Livneh [Mon, 23 Aug 2021 16:40:19 +0000 (12:40 -0400)] 
Fix UB in inffast.c when not using window

When not using window, `window + wsize` applies a zero offset to a null pointer, which is undefined behavior.

4 years agoFixed trailing whitespaces and missing new lines.
Nathan Moinvaziri [Sat, 4 Sep 2021 19:16:16 +0000 (12:16 -0700)] 
Fixed trailing whitespaces and missing new lines.

4 years agoFix hangs on macOS due to loading of misaligned addresses in chunkmemset_8.
Sergey Markelov [Thu, 22 Jul 2021 17:23:26 +0000 (10:23 -0700)] 
Fix hangs on macOS due to loading of misaligned addresses in chunkmemset_8.

4 years agoInclude win directory in pigz even if not using threads.
Nathan Moinvaziri [Thu, 1 Jul 2021 21:06:06 +0000 (14:06 -0700)] 
Include win directory in pigz even if not using threads.

4 years agoFixed undefined behavior of isgraph when character is not in the range 0 through...
Nathan Moinvaziri [Tue, 17 Aug 2021 17:12:37 +0000 (10:12 -0700)] 
Fixed undefined behavior of isgraph when character is not in the range 0 through 0xFF inclusive.

4 years agoUse static inline functions for crc32 folding load/save.
Nathan Moinvaziri [Sat, 3 Jul 2021 19:40:55 +0000 (12:40 -0700)] 
Use static inline functions for crc32 folding load/save.