From e4cfbc1f06dfa4e0c81683fb7e7918fcd9fb578c Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Thu, 25 Feb 2021 13:37:12 -0500 Subject: [PATCH] softfloat: do not set denominator high bit for floatx80 remainder The floatx80 remainder implementation unnecessarily sets the high bit of bSig explicitly. By that point in the function, arguments that are invalid, zero, infinity or NaN have already been handled and subnormals have been through normalizeFloatx80Subnormal, so the high bit will already be set. Remove the unnecessary code. Backports commit 566601f1f9d972e44214696d3cb320e6c18880aa from qemu --- qemu/fpu/softfloat.c | 1 - 1 file changed, 1 deletion(-) diff --git a/qemu/fpu/softfloat.c b/qemu/fpu/softfloat.c index b5c80035..2cb89ffd 100644 --- a/qemu/fpu/softfloat.c +++ b/qemu/fpu/softfloat.c @@ -5713,7 +5713,6 @@ floatx80 floatx80_modrem(floatx80 a, floatx80 b, bool mod, if ( aSig0 == 0 ) return a; normalizeFloatx80Subnormal( aSig0, &aExp, &aSig0 ); } - bSig |= UINT64_C(0x8000000000000000); zSign = aSign; expDiff = aExp - bExp; aSig1 = 0;