[Linux] Fix Value::MulHi

This commit is contained in:
uytvbn 2017-10-24 22:57:10 +02:00 committed by Sandy Carter
parent c804b0dff9
commit 8817975912
1 changed files with 7 additions and 5 deletions

View File

@ -440,12 +440,14 @@ void Value::MulHi(Value* other, bool is_unsigned) {
#else
if (is_unsigned) {
constant.i64 = static_cast<uint64_t>(
static_cast<unsigned __int128>(constant.i64) *
static_cast<unsigned __int128>(other->constant.i64));
(static_cast<unsigned __int128>(constant.u64) *
static_cast<unsigned __int128>(other->constant.u64)) >>
64);
} else {
constant.i64 =
static_cast<uint64_t>(static_cast<__int128>(constant.i64) *
static_cast<__int128>(other->constant.i64));
constant.i64 = static_cast<uint64_t>(
(static_cast<__int128>(constant.i64) *
static_cast<__int128>(other->constant.i64)) >>
64);
}
#endif // XE_COMPILER_MSVC
break;