diff options
author | eeight <eeight@yandex-team.ru> | 2022-02-10 16:46:19 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:19 +0300 |
commit | bd085aee9b4f7a0bee302ce687964ffb7098f986 (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/cpp/pop_count/popcount.h | |
parent | 475c0a46f28166e83fd263badc7546377cddcabe (diff) | |
download | ydb-bd085aee9b4f7a0bee302ce687964ffb7098f986.tar.gz |
Restoring authorship annotation for <eeight@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/pop_count/popcount.h')
-rw-r--r-- | library/cpp/pop_count/popcount.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/library/cpp/pop_count/popcount.h b/library/cpp/pop_count/popcount.h index 71ea2721e6..3d67737ed2 100644 --- a/library/cpp/pop_count/popcount.h +++ b/library/cpp/pop_count/popcount.h @@ -1,9 +1,9 @@ #pragma once #include <util/generic/typelist.h> -#include <util/system/cpu_id.h> +#include <util/system/cpu_id.h> #include <util/system/defaults.h> -#include <util/system/hi_lo.h> +#include <util/system/hi_lo.h> #include <util/system/platform.h> #if defined(_MSC_VER) @@ -38,7 +38,7 @@ static inline ui32 PopCountImpl(ui32 n) { return __popcnt(n); #else #if defined(_x86_64_) - if (NX86::CachedHavePOPCNT()) { + if (NX86::CachedHavePOPCNT()) { ui32 r; __asm__("popcnt %1, %0;" @@ -61,7 +61,7 @@ static inline ui32 PopCountImpl(ui32 n) { #endif #endif - return PopCountImpl((ui16)Lo16(n)) + PopCountImpl((ui16)Hi16(n)); + return PopCountImpl((ui16)Lo16(n)) + PopCountImpl((ui16)Hi16(n)); #endif } @@ -70,7 +70,7 @@ static inline ui32 PopCountImpl(ui64 n) { return __popcnt64(n); #else #if defined(_x86_64_) - if (NX86::CachedHavePOPCNT()) { + if (NX86::CachedHavePOPCNT()) { ui64 r; __asm__("popcnt %1, %0;" @@ -93,7 +93,7 @@ static inline ui32 PopCountImpl(ui64 n) { #endif #endif - return PopCountImpl((ui32)Lo32(n)) + PopCountImpl((ui32)Hi32(n)); + return PopCountImpl((ui32)Lo32(n)) + PopCountImpl((ui32)Hi32(n)); #endif } |