]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Cast wsize as early as possible in slide_hash for AVX2 and SSE2.
authorNathan Moinvaziri <nathan@nathanm.com>
Sun, 2 Aug 2020 18:20:43 +0000 (11:20 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Fri, 14 Aug 2020 20:20:50 +0000 (22:20 +0200)
arch/x86/slide_avx.c
arch/x86/slide_sse.c

index 7ed7c029185008c61b25a7514cff91069feb01c4..6083dc7d6146879e4a1dd1cadbbdf6707e7cd592 100644 (file)
@@ -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;
index f012e04fa57eedd3bb4b5f871d7af82eaf47c490..f57a7d33e3f1dcfc19ee9df61a02f0c6379ba428 100644 (file)
@@ -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;