From c84aceea3f36542dbe3ef08af74c567f20270a4e Mon Sep 17 00:00:00 2001 From: Alden Torres Date: Fri, 24 Jun 2016 17:43:29 -0400 Subject: [PATCH] using bsr even with no popcnt present (#852) --- src/sha1_hash.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/sha1_hash.cpp b/src/sha1_hash.cpp index 055fde893..b78788d62 100644 --- a/src/sha1_hash.cpp +++ b/src/sha1_hash.cpp @@ -76,16 +76,13 @@ namespace libtorrent } #if TORRENT_HAS_SSE - if (aux::mmx_support) - { #ifdef __GNUC__ - return ret + __builtin_clz(v); + return ret + __builtin_clz(v); #else - DWORD pos; - _BitScanReverse(&pos, v); - return ret + 31 - pos; + DWORD pos; + _BitScanReverse(&pos, v); + return ret + 31 - pos; #endif - } #else // http://graphics.stanford.edu/~seander/bithacks.html#IntegerLogObvious static const int MultiplyDeBruijnBitPosition[32] =