diff options
author | Vlad Yaroslavlev <vladon@vladon.com> | 2022-02-10 16:46:25 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:25 +0300 |
commit | 344ea37b4a345701ab0e67de2266a1c1bd7baf2d (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/cpp/int128/bench/main.cpp | |
parent | 706b83ed7de5a473436620367af31fc0ceecde07 (diff) | |
download | ydb-344ea37b4a345701ab0e67de2266a1c1bd7baf2d.tar.gz |
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/int128/bench/main.cpp')
-rw-r--r-- | library/cpp/int128/bench/main.cpp | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/library/cpp/int128/bench/main.cpp b/library/cpp/int128/bench/main.cpp index 54d063cc40..be4f8d1500 100644 --- a/library/cpp/int128/bench/main.cpp +++ b/library/cpp/int128/bench/main.cpp @@ -1,45 +1,45 @@ #include <library/cpp/int128/int128.h> #include <library/cpp/testing/benchmark/bench.h> - -#include <util/generic/xrange.h> -#include <util/system/compiler.h> - -Y_CPU_BENCHMARK(LibraryDivisionUnsigned128, iface) { - ui128 b = {0, 10'000'000}; - for (const auto i : xrange(iface.Iterations())) { - ui128 a = i * 10'000'000; - ui128 c = a / b; - Y_FAKE_READ(c); - } -} - -#if defined(Y_HAVE_INT128) -Y_CPU_BENCHMARK(IntrinsicDivisionUnsigned128, iface) { - unsigned __int128 b = 10'000'000; - for (const auto i : xrange(iface.Iterations())) { - unsigned __int128 a = i * 10'000'000; - unsigned __int128 c = a / b; - Y_FAKE_READ(c); - } -} -#endif // Y_HAVE_INT128 - -Y_CPU_BENCHMARK(LibraryDivisionSigned128, iface) { - i128 b = {0, 10'000'000}; - for (const auto i : xrange(iface.Iterations())) { - i128 a = i * 10'000'000; - i128 c = a / b; - Y_FAKE_READ(c); - } -} - -#if defined(Y_HAVE_INT128) -Y_CPU_BENCHMARK(IntrinsicDivisionSigned128, iface) { - signed __int128 b = 10'000'000; - for (const auto i : xrange(iface.Iterations())) { - signed __int128 a = i * 10'000'000; - signed __int128 c = a / b; - Y_FAKE_READ(c); - } -} -#endif // Y_HAVE_INT128 + +#include <util/generic/xrange.h> +#include <util/system/compiler.h> + +Y_CPU_BENCHMARK(LibraryDivisionUnsigned128, iface) { + ui128 b = {0, 10'000'000}; + for (const auto i : xrange(iface.Iterations())) { + ui128 a = i * 10'000'000; + ui128 c = a / b; + Y_FAKE_READ(c); + } +} + +#if defined(Y_HAVE_INT128) +Y_CPU_BENCHMARK(IntrinsicDivisionUnsigned128, iface) { + unsigned __int128 b = 10'000'000; + for (const auto i : xrange(iface.Iterations())) { + unsigned __int128 a = i * 10'000'000; + unsigned __int128 c = a / b; + Y_FAKE_READ(c); + } +} +#endif // Y_HAVE_INT128 + +Y_CPU_BENCHMARK(LibraryDivisionSigned128, iface) { + i128 b = {0, 10'000'000}; + for (const auto i : xrange(iface.Iterations())) { + i128 a = i * 10'000'000; + i128 c = a / b; + Y_FAKE_READ(c); + } +} + +#if defined(Y_HAVE_INT128) +Y_CPU_BENCHMARK(IntrinsicDivisionSigned128, iface) { + signed __int128 b = 10'000'000; + for (const auto i : xrange(iface.Iterations())) { + signed __int128 a = i * 10'000'000; + signed __int128 c = a / b; + Y_FAKE_READ(c); + } +} +#endif // Y_HAVE_INT128 |