diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2018-12-11 01:11:38 -0800 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2018-12-26 12:26:52 -0800 |
commit | f8719f5ae5acdc31d3794ddfea8ac963359de41e (patch) | |
tree | 70327ff8a4953abd605665ecd458a3c4b1a66443 /zutil.h | |
parent | 41d86c73b21191a3fa9ea5f476fc9f1fc5e4f8b3 (diff) | |
download | zlib-f8719f5ae5acdc31d3794ddfea8ac963359de41e.tar.gz zlib-f8719f5ae5acdc31d3794ddfea8ac963359de41e.tar.bz2 zlib-f8719f5ae5acdc31d3794ddfea8ac963359de41e.zip |
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.
Diffstat (limited to 'zutil.h')
-rw-r--r-- | zutil.h | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -42,6 +42,17 @@ typedef unsigned short ush; | |||
42 | typedef ush FAR ushf; | 42 | typedef ush FAR ushf; |
43 | typedef unsigned long ulg; | 43 | typedef unsigned long ulg; |
44 | 44 | ||
45 | #if !defined(Z_U8) && !defined(Z_SOLO) && defined(STDC) | ||
46 | # include <limits.h> | ||
47 | # if (ULONG_MAX == 0xffffffffffffffffULL) | ||
48 | # define Z_U8 unsigned long | ||
49 | # elif (ULLONG_MAX == 0xffffffffffffffffULL) | ||
50 | # define Z_U8 unsigned long long | ||
51 | # elif (UINT_MAX == 0xffffffffffffffffULL) | ||
52 | # define Z_U8 unsigned | ||
53 | # endif | ||
54 | #endif | ||
55 | |||
45 | extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ | 56 | extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ |
46 | /* (size given to avoid silly warnings with Visual C++) */ | 57 | /* (size given to avoid silly warnings with Visual C++) */ |
47 | 58 | ||