From: Jacob Lifshay Date: Tue, 16 May 2023 06:48:28 +0000 (-0700) Subject: fix mis-computed exponent in bfp_CONVERT_FROM_BFP64 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=11c3ed1b9b3fc40de0ac6910a4453ce73767371c;p=openpower-isa.git fix mis-computed exponent in bfp_CONVERT_FROM_BFP64 --- diff --git a/openpower/isafunctions/bfp.mdwn b/openpower/isafunctions/bfp.mdwn index 7ab2ab2b..08409e8f 100644 --- a/openpower/isafunctions/bfp.mdwn +++ b/openpower/isafunctions/bfp.mdwn @@ -57,7 +57,7 @@ section 7.6.2.2 # x is a Denormal result.class.Denormal <- 1 result.sign <- x[0] - result.exp <- -1022 + result.exponent <- -1022 result.significand[0] <- 0 result.significand[1:52] <- fraction do while result.significand[0] != 1 @@ -66,7 +66,10 @@ section 7.6.2.2 else result.class.Normal <- 1 result.sign <- x[0] - result.exponent <- exponent - 1023 + result.exponent <- exponent + # have to do the subtraction separately since SelectableInt won't + # give negative results + result.exponent <- result.exponent - 1023 result.significand[0] <- 1 result.significand[1:52] <- fraction return result