From f8719f5ae5acdc31d3794ddfea8ac963359de41e Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Tue, 11 Dec 2018 01:11:38 -0800 Subject: Speed up software CRC-32 computation by a factor of 1.5 to 3. Use the interleaved method of Kadatch and Jenkins in order to make use of pipelined instructions through multiple ALUs in a single core. This also speeds up and simplifies the combination of CRCs, and updates the functions to pre-calculate and use an operator for CRC combination. --- zutil.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'zutil.h') diff --git a/zutil.h b/zutil.h index 60a0bca..14277bc 100644 --- a/zutil.h +++ b/zutil.h @@ -42,6 +42,17 @@ typedef unsigned short ush; typedef ush FAR ushf; typedef unsigned long ulg; +#if !defined(Z_U8) && !defined(Z_SOLO) && defined(STDC) +# include +# if (ULONG_MAX == 0xffffffffffffffffULL) +# define Z_U8 unsigned long +# elif (ULLONG_MAX == 0xffffffffffffffffULL) +# define Z_U8 unsigned long long +# elif (UINT_MAX == 0xffffffffffffffffULL) +# define Z_U8 unsigned +# endif +#endif + extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ /* (size given to avoid silly warnings with Visual C++) */ -- cgit v1.2.3-55-g6feb