Compilation hotfix

This commit is contained in:
elad335 2024-10-25 01:00:23 +03:00 committed by Elad
parent 84217917d5
commit a325eb52bd
3 changed files with 8 additions and 8 deletions

View File

@ -151,7 +151,7 @@ u64 get_timebased_time()
{
const u64 tsc = utils::get_tsc();
#if is_u128_emulated
#if _MSC_VER
const u64 result = static_cast<u64>(u128_from_mul(tsc, g_timebase_freq) / freq) * g_cfg.core.clocks_scale / 100u;
#else
const u64 result = (tsc / freq * g_timebase_freq + tsc % freq * g_timebase_freq / freq) * g_cfg.core.clocks_scale / 100u;
@ -168,7 +168,7 @@ u64 get_timebased_time()
const u64 time = count.QuadPart;
const u64 freq = s_time_aux_info.perf_freq;
#if is_u128_emulated
#if _MSC_VER
const u64 result = static_cast<u64>(u128_from_mul(time * g_cfg.core.clocks_scale, g_timebase_freq) / freq / 100u);
#else
const u64 result = (time / freq * g_timebase_freq + time % freq * g_timebase_freq / freq) * g_cfg.core.clocks_scale / 100u;
@ -211,7 +211,7 @@ u64 get_system_time()
{
const u64 tsc = utils::get_tsc();
#if is_u128_emulated
#if _MSC_VER
const u64 result = static_cast<u64>(u128_from_mul(tsc, 1000000ull) / freq) * g_cfg.core.clocks_scale / 100u;
#else
const u64 result = (tsc / freq * 1000000ull + tsc % freq * 1000000ull / freq) * g_cfg.core.clocks_scale / 100u;
@ -228,7 +228,7 @@ u64 get_system_time()
const u64 time = count.QuadPart;
const u64 freq = s_time_aux_info.perf_freq;
#if is_u128_emulated
#if _MSC_VER
const u64 result = static_cast<u64>(u128_from_mul(time, 1000000ull) / freq);
#else
const u64 result = time / freq * 1000000ull + (time % freq) * 1000000ull / freq;

View File

@ -466,3 +466,7 @@ namespace utils
} // namespace utils
using utils::busy_wait;
#ifdef _MSC_VER
using utils::operator/;
#endif

View File

@ -250,8 +250,6 @@ using __m128 = float __attribute__((vector_size(16)));
#ifndef _MSC_VER
using u128 = __uint128_t;
using s128 = __int128_t;
static constexpr bool is_u128_emulated = false;
#else
extern "C"
@ -566,8 +564,6 @@ struct s128 : u128
return *this;
}
};
static constexpr bool is_u128_emulated = true;
#endif
// Optimization for u64*u64=u128