mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-30 12:32:43 +00:00
asm: Fix utils::rational_mul optimization
This commit is contained in:
parent
3378b03c1f
commit
a9a454faf7
@ -410,10 +410,12 @@ namespace utils
|
||||
return static_cast<T>(value * u64{numerator} / u64{denominator});
|
||||
}
|
||||
|
||||
#if is_u128_emulated
|
||||
if constexpr (sizeof(T) <= sizeof(u128) / 2)
|
||||
{
|
||||
return static_cast<T>(value * u128{numerator} / u64{denominator});
|
||||
return static_cast<T>(u128_from_mul(value, numerator) / u64{denominator});
|
||||
}
|
||||
#endif
|
||||
|
||||
return static_cast<T>(value / denominator * numerator + (value % denominator) * numerator / denominator);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user