From af28515bbd3c54a035309338f6a56653ffe19676 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Wed, 20 Sep 2023 21:22:29 +0300 Subject: [PATCH] softfloat fix (Previous) --- softfloat/softfloat.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/softfloat/softfloat.cpp b/softfloat/softfloat.cpp index b3c0117c..37f2c892 100644 --- a/softfloat/softfloat.cpp +++ b/softfloat/softfloat.cpp @@ -2319,11 +2319,19 @@ static floatx80 addFloatx80Sigs(floatx80 a, floatx80 b, flag zSign, bExp = extractFloatx80Exp( b ); #ifdef SOFTFLOAT_68K if ( aExp == 0 ) { - normalizeFloatx80Subnormal( aSig, &aExp, &aSig ); - } + if (aSig == 0) { + aExp = -64; + } else { + normalizeFloatx80Subnormal(aSig, &aExp, &aSig); + } + } if ( bExp == 0 ) { - normalizeFloatx80Subnormal( bSig, &bExp, &bSig ); - } + if (bSig == 0) { + bExp = -64; + } else { + normalizeFloatx80Subnormal(bSig, &bExp, &bSig); + } + } #endif expDiff = aExp - bExp; if ( 0 < expDiff ) { -- 2.47.3