From: Nathan Moinvaziri Date: Wed, 29 Dec 2021 23:51:00 +0000 (-0800) Subject: Fixed crc32 assembly not returning hash value to correct variable. X-Git-Tag: 2.1.0-beta1~464 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f14bffab8bbb17c577f6fae61a47b0a94f0486c;p=thirdparty%2Fzlib-ng.git Fixed crc32 assembly not returning hash value to correct variable. --- diff --git a/arch/x86/insert_string_sse.c b/arch/x86/insert_string_sse.c index 7a63b2a7b..b33a2c7cc 100644 --- a/arch/x86/insert_string_sse.c +++ b/arch/x86/insert_string_sse.c @@ -26,7 +26,7 @@ __asm mov edx, h\ __asm mov eax, val\ __asm crc32 eax, edx\ - __asm mov val, eax\ + __asm mov h, eax\ } # else # define HASH_CALC(s, h, val) \ diff --git a/cmake/detect-intrinsics.cmake b/cmake/detect-intrinsics.cmake index 39ae19ae9..e03daaa13 100644 --- a/cmake/detect-intrinsics.cmake +++ b/cmake/detect-intrinsics.cmake @@ -230,7 +230,7 @@ macro(check_sse4_intrinsics) "int main(void) { unsigned val = 0, h = 0; #if defined(_MSC_VER) - { __asm mov edx, h __asm mov eax, val __asm crc32 eax, edx __asm mov val, eax } + { __asm mov edx, h __asm mov eax, val __asm crc32 eax, edx __asm mov h, eax } #else __asm__ __volatile__ ( \"crc32 %1,%0\" : \"+r\" (h) : \"r\" (val) ); #endif