From: Nathan Moinvaziri Date: Sun, 2 Aug 2020 18:20:43 +0000 (-0700) Subject: Cast wsize as early as possible in slide_hash for AVX2 and SSE2. X-Git-Tag: 1.9.9-b1~112 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a0f9ea265f8c08256986a37e57baacf124db61dc;p=thirdparty%2Fzlib-ng.git Cast wsize as early as possible in slide_hash for AVX2 and SSE2. --- diff --git a/arch/x86/slide_avx.c b/arch/x86/slide_avx.c index 7ed7c029..6083dc7d 100644 --- a/arch/x86/slide_avx.c +++ b/arch/x86/slide_avx.c @@ -17,8 +17,8 @@ ZLIB_INTERNAL void slide_hash_avx2(deflate_state *s) { Pos *p; unsigned n; - unsigned wsize = s->w_size; - const __m256i zmm_wsize = _mm256_set1_epi16((uint16_t)wsize); + uint16_t wsize = (uint16_t)s->w_size; + const __m256i zmm_wsize = _mm256_set1_epi16(wsize); n = s->hash_size; p = &s->head[n] - 16; diff --git a/arch/x86/slide_sse.c b/arch/x86/slide_sse.c index f012e04f..f57a7d33 100644 --- a/arch/x86/slide_sse.c +++ b/arch/x86/slide_sse.c @@ -16,8 +16,8 @@ ZLIB_INTERNAL void slide_hash_sse2(deflate_state *s) { Pos *p; unsigned n; - unsigned wsize = s->w_size; - const __m128i xmm_wsize = _mm_set1_epi16((uint16_t)wsize); + uint16_t wsize = (uint16_t)s->w_size; + const __m128i xmm_wsize = _mm_set1_epi16(wsize); n = s->hash_size; p = &s->head[n] - 8;