diff mbox series

[4/7] softfloat: do not set denominator high bit for floatx80 remainder

Message ID alpine.DEB.2.21.2006051900410.13777@digraph.polyomino.org.uk
State New
Headers show
Series softfloat, target/i386: fprem, fprem1 fixes | expand

Commit Message

Joseph Myers June 5, 2020, 7:01 p.m. UTC
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.

Signed-off-by: Joseph Myers <joseph@codesourcery.com>
---
 fpu/softfloat.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Richard Henderson June 6, 2020, 7:08 p.m. UTC | #1
On 6/5/20 12:01 PM, Joseph Myers wrote:
> 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.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~
diff mbox series

Patch

diff --git a/fpu/softfloat.c b/fpu/softfloat.c
index 00f362af23..423a815196 100644
--- a/fpu/softfloat.c
+++ b/fpu/softfloat.c
@@ -5734,7 +5734,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;