m68k: fix floatx80_mod() (Coverity CID1390568)
authorLaurent Vivier <laurent@vivier.eu>
Tue, 8 May 2018 20:39:37 +0000 (22:39 +0200)
committerLaurent Vivier <laurent@vivier.eu>
Mon, 14 May 2018 17:13:07 +0000 (19:13 +0200)
Update the variable checked by the loop condition (expDiff).
Backport the update from Previous.

Fixes: 591596b77a ("target/m68k: add fmod/frem")
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Thomas Huth <huth@tuxfamily.org>
Message-Id: <20180508203937.16796-1-laurent@vivier.eu>

target/m68k/softfloat.c

index e41b07d042c0bcff24754fe36356e5e8f9d3c4d1..d0939972194ec7adb529c2055d39164b1c5db475 100644 (file)
@@ -103,6 +103,7 @@ floatx80 floatx80_mod(floatx80 a, floatx80 b, float_status *status)
         mul64To128(bSig, qTemp, &term0, &term1);
         sub128(aSig0, aSig1, term0, term1, &aSig0, &aSig1);
         shortShift128Left(aSig0, aSig1, 62, &aSig0, &aSig1);
+        expDiff -= 62;
     }
     expDiff += 64;
     if (0 < expDiff) {