diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:15 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:15 +0300 |
commit | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch) | |
tree | da2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/cpp/pop_count/popcount.cpp | |
parent | 778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff) | |
download | ydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/pop_count/popcount.cpp')
-rw-r--r-- | library/cpp/pop_count/popcount.cpp | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/library/cpp/pop_count/popcount.cpp b/library/cpp/pop_count/popcount.cpp index 49276424be..28743b4426 100644 --- a/library/cpp/pop_count/popcount.cpp +++ b/library/cpp/pop_count/popcount.cpp @@ -1,30 +1,30 @@ -#include "popcount.h" - +#include "popcount.h" + #include <util/system/defaults.h> -#include <util/system/yassert.h> - -#include <string.h> - -static const ui8 PopCountLUT8Impl[1 << 8] = { -#define B2(n) n, n + 1, n + 1, n + 2 -#define B4(n) B2(n), B2(n + 1), B2(n + 1), B2(n + 2) -#define B6(n) B4(n), B4(n + 1), B4(n + 1), B4(n + 2) - B6(0), B6(1), B6(1), B6(2)}; - -ui8 const* PopCountLUT8 = PopCountLUT8Impl; +#include <util/system/yassert.h> -#if !defined(_MSC_VER) -//ICE here for msvc +#include <string.h> + +static const ui8 PopCountLUT8Impl[1 << 8] = { +#define B2(n) n, n + 1, n + 1, n + 2 +#define B4(n) B2(n), B2(n + 1), B2(n + 1), B2(n + 2) +#define B6(n) B4(n), B4(n + 1), B4(n + 1), B4(n + 2) + B6(0), B6(1), B6(1), B6(2)}; -static const ui8 PopCountLUT16Impl[1 << 16] = { -#define B2(n) n, n + 1, n + 1, n + 2 -#define B4(n) B2(n), B2(n + 1), B2(n + 1), B2(n + 2) -#define B6(n) B4(n), B4(n + 1), B4(n + 1), B4(n + 2) -#define B8(n) B6(n), B6(n + 1), B6(n + 1), B6(n + 2) -#define B10(n) B8(n), B8(n + 1), B8(n + 1), B8(n + 2) -#define B12(n) B10(n), B10(n + 1), B10(n + 1), B10(n + 2) -#define B14(n) B12(n), B12(n + 1), B12(n + 1), B12(n + 2) - B14(0), B14(1), B14(1), B14(2)}; +ui8 const* PopCountLUT8 = PopCountLUT8Impl; + +#if !defined(_MSC_VER) +//ICE here for msvc + +static const ui8 PopCountLUT16Impl[1 << 16] = { +#define B2(n) n, n + 1, n + 1, n + 2 +#define B4(n) B2(n), B2(n + 1), B2(n + 1), B2(n + 2) +#define B6(n) B4(n), B4(n + 1), B4(n + 1), B4(n + 2) +#define B8(n) B6(n), B6(n + 1), B6(n + 1), B6(n + 2) +#define B10(n) B8(n), B8(n + 1), B8(n + 1), B8(n + 2) +#define B12(n) B10(n), B10(n + 1), B10(n + 1), B10(n + 2) +#define B14(n) B12(n), B12(n + 1), B12(n + 1), B12(n + 2) + B14(0), B14(1), B14(1), B14(2)}; -ui8 const* PopCountLUT16 = PopCountLUT16Impl; -#endif +ui8 const* PopCountLUT16 = PopCountLUT16Impl; +#endif |