From 560001e02b09b64bc54ebc66ea8a11dd890cd1f9 Mon Sep 17 00:00:00 2001 From: riperiperi Date: Wed, 6 Jun 2018 23:43:09 +0100 Subject: [PATCH] smulh: Fixed mul with 0 acting like it had a negative 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 73ce5cdc93..fbc752c363 100644 --- a/ChocolArm64/Instruction/ASoftFallback.cs +++ b/ChocolArm64/Instruction/ASoftFallback.cs @@ -158,7 +158,7 @@ namespace ChocolArm64.Instruction long Result = (long)UMulHi128((ulong)(LSign ? -LHS : LHS), (ulong)(RSign ? -RHS : RHS)); - if (LSign != RSign) + if (LSign != RSign && LHS != 0 && RHS != 0) return (-Result) - 1; //for negative results, hi 64-bits start at 0xFFF... and count back return Result; }