diff options
author | Hans Kristian Rosbach <hk-git@circlestorm.org> | 2015-11-04 20:58:56 +0100 |
---|---|---|
committer | Hans Kristian Rosbach <hk-git@circlestorm.org> | 2015-11-04 20:58:56 +0100 |
commit | 2c4ec8a5a3eba31aae6488c0981dc23b36b24d26 (patch) | |
tree | b36200cbf0735551bef23c8b840ab8b8d1ba773a /deflate_p.h | |
parent | 9e37e38bc2e640818281bbfb2687dd9356b8aa95 (diff) |
Split insert_string_sse into separate file in arch folder.
Diffstat (limited to 'deflate_p.h')
-rw-r--r-- | deflate_p.h | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/deflate_p.h b/deflate_p.h index 25923a7..7fee6f0 100644 --- a/deflate_p.h +++ b/deflate_p.h @@ -31,35 +31,9 @@ void flush_pending(z_stream *strm); * input characters and the first MIN_MATCH bytes of str are valid * (except for the last MIN_MATCH-1 bytes of the input file). */ -#ifdef X86_SSE4_2_CRC_HASH -local inline Pos insert_string_sse(deflate_state *const s, const Pos str, uInt count) { - Pos ret = 0; - uInt idx; - unsigned *ip, val, h = 0; - - for (idx = 0; idx < count; idx++) { - ip = (unsigned *)&s->window[str+idx]; - val = *ip; - h = 0; - - if (s->level >= 6) - val &= 0xFFFFFF; - -#ifdef _MSC_VER - h = _mm_crc32_u32(h, val); -#else - __asm__ __volatile__ ( - "crc32 %1,%0\n\t" - : "+r" (h) - : "r" (val) - ); -#endif - ret = s->prev[(str+idx) & s->w_mask] = s->head[h & s->hash_mask]; - s->head[h & s->hash_mask] = str+idx; - } - return ret; -} +#ifdef X86_SSE4_2_CRC_HASH +extern Pos insert_string_sse(deflate_state *const s, const Pos str, uInt count); #endif local inline Pos insert_string_c(deflate_state *const s, const Pos str, uInt count) { |