From 8817975912ad2304f50f1210ad1045be49c8d8b9 Mon Sep 17 00:00:00 2001 From: uytvbn Date: Tue, 24 Oct 2017 22:57:10 +0200 Subject: [PATCH] [Linux] Fix Value::MulHi --- src/xenia/cpu/hir/value.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/xenia/cpu/hir/value.cc b/src/xenia/cpu/hir/value.cc index 666648b03..ed7bfc440 100644 --- a/src/xenia/cpu/hir/value.cc +++ b/src/xenia/cpu/hir/value.cc @@ -440,12 +440,14 @@ void Value::MulHi(Value* other, bool is_unsigned) { #else if (is_unsigned) { constant.i64 = static_cast( - static_cast(constant.i64) * - static_cast(other->constant.i64)); + (static_cast(constant.u64) * + static_cast(other->constant.u64)) >> + 64); } else { - constant.i64 = - static_cast(static_cast<__int128>(constant.i64) * - static_cast<__int128>(other->constant.i64)); + constant.i64 = static_cast( + (static_cast<__int128>(constant.i64) * + static_cast<__int128>(other->constant.i64)) >> + 64); } #endif // XE_COMPILER_MSVC break;