From 7878aa8e35f71473c21d79d6e7f0547c60c1aab5 Mon Sep 17 00:00:00 2001 From: riperiperi Date: Thu, 7 Jun 2018 23:55:47 +0100 Subject: [PATCH] Use compliment for negative smulh result. --- ChocolArm64/Instruction/ASoftFallback.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChocolArm64/Instruction/ASoftFallback.cs b/ChocolArm64/Instruction/ASoftFallback.cs index fbc752c363..3f8ab5e3ef 100644 --- a/ChocolArm64/Instruction/ASoftFallback.cs +++ b/ChocolArm64/Instruction/ASoftFallback.cs @@ -159,7 +159,7 @@ namespace ChocolArm64.Instruction long Result = (long)UMulHi128((ulong)(LSign ? -LHS : LHS), (ulong)(RSign ? -RHS : RHS)); if (LSign != RSign && LHS != 0 && RHS != 0) - return (-Result) - 1; //for negative results, hi 64-bits start at 0xFFF... and count back + return ~Result; //for negative results, hi 64-bits start at 0xFFF... and count back return Result; }