Chromium Code Reviews| Index: third_party/zlib/deflate.h |
| diff --git a/third_party/zlib/deflate.h b/third_party/zlib/deflate.h |
| index 2fe6fd6670f5f6742655c736d08fd2c89b58dc6c..aff61a51f314fca12e38f1d27f7b67003750ccec 100644 |
| --- a/third_party/zlib/deflate.h |
| +++ b/third_party/zlib/deflate.h |
| @@ -107,6 +107,10 @@ typedef struct internal_state { |
| Byte method; /* STORED (for zip only) or DEFLATED */ |
| int last_flush; /* value of flush param for previous deflate call */ |
| +#ifdef HAVE_PCLMULQDQ |
| + unsigned __attribute__((aligned(16))) crc0[4 * 5]; |
| +#endif |
| + |
| /* used by deflate.c: */ |
| uInt w_size; /* LZ77 window size (32K by default) */ |
| @@ -344,4 +348,27 @@ void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf, |
| flush = _tr_tally(s, distance, length) |
| #endif |
| +/* =========================================================================== |
| + * Update a hash value with the given input byte |
| + * IN assertion: all calls to to UPDATE_HASH are made with consecutive |
| + * input characters, so that a running hash key can be computed from the |
| + * previous key instead of complete recalculation each time. |
| + */ |
| +#ifdef USE_SSE4_2_CRC_HASH |
|
agl
2014/09/23 21:41:40
don't define internal macros in public headers.
|
| +#define UPDATE_HASH(s,h,i) (\ |
| + {\ |
| + if (s->level < 6) \ |
| + h = (3483 * (s->window[i]) +\ |
| + 23081* (s->window[i+1]) +\ |
| + 6954 * (s->window[i+2]) +\ |
| + 20947* (s->window[i+3])) & s->hash_mask;\ |
| + else\ |
| + h = (25881* (s->window[i]) +\ |
| + 24674* (s->window[i+1]) +\ |
| + 25811* (s->window[i+2])) & s->hash_mask;\ |
| + }) |
| +#else |
| +#define UPDATE_HASH(s,h,i) (h = (((h)<<s->hash_shift) ^ (s->window[i + (MIN_MATCH-1)])) & s->hash_mask) |
| +#endif |
| + |
| #endif /* DEFLATE_H */ |