From 4deaffb42010cb015499d669c0e04a649b401a69 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Mon, 24 Jul 2023 18:54:45 -0700 Subject: [PATCH] restore use of ? : operator in bfp_ROUND_TO_BFP32/64 pseudocode this changes it to match the PowerISA spec. better --- openpower/isafunctions/bfp.mdwn | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/openpower/isafunctions/bfp.mdwn b/openpower/isafunctions/bfp.mdwn index 52df8863..a4f09eb5 100644 --- a/openpower/isafunctions/bfp.mdwn +++ b/openpower/isafunctions/bfp.mdwn @@ -781,18 +781,11 @@ section 7.6.2.2 if ro=1 then r <- bfp_ROUND_ODD(53, x) if bfp_COMPARE_GT(bfp_ABSOLUTE(r), bfp_NMAX_BFP64()) then if FPSCR.OE=0 then - if x.sign then - if (ro=0) & (rmode=0b00) then r <- bfp_INFINITY() - if (ro=0) & (rmode=0b01) then r <- bfp_NMAX_BFP64() - if (ro=0) & (rmode=0b10) then r <- bfp_NMAX_BFP64() - if (ro=0) & (rmode=0b11) then r <- bfp_INFINITY() - if ro=1 then r <- bfp_NMAX_BFP64() - else - if (ro=0) & (rmode=0b00) then r <- bfp_INFINITY() - if (ro=0) & (rmode=0b01) then r <- bfp_NMAX_BFP64() - if (ro=0) & (rmode=0b10) then r <- bfp_INFINITY() - if (ro=0) & (rmode=0b11) then r <- bfp_NMAX_BFP64() - if ro=1 then r <- bfp_NMAX_BFP64() + if (ro=0) & (rmode=0b00) then r <- x.sign ? bfp_INFINITY() : bfp_INFINITY() + if (ro=0) & (rmode=0b01) then r <- x.sign ? bfp_NMAX_BFP64() : bfp_NMAX_BFP64() + if (ro=0) & (rmode=0b10) then r <- x.sign ? bfp_NMAX_BFP64() : bfp_INFINITY() + if (ro=0) & (rmode=0b11) then r <- x.sign ? bfp_INFINITY() : bfp_NMAX_BFP64() + if ro=1 then r <- x.sign ? bfp_NMAX_BFP64() : bfp_NMAX_BFP64() r.sign <- x.sign ox_flag <- 0b1 xx_flag <- 0b1 @@ -850,16 +843,10 @@ section 7.6.2.2 if bfp_COMPARE_GT(bfp_ABSOLUTE(r), bfp_NMAX_BFP32()) then if FPSCR.OE = 0 then - if x.sign then - if rmode=0b00 then r <- bfp_INFINITY() - if rmode=0b01 then r <- bfp_NMAX_BFP32() - if rmode=0b10 then r <- bfp_NMAX_BFP32() - if rmode=0b11 then r <- bfp_INFINITY() - else - if rmode=0b00 then r <- bfp_INFINITY() - if rmode=0b01 then r <- bfp_NMAX_BFP32() - if rmode=0b10 then r <- bfp_INFINITY() - if rmode=0b11 then r <- bfp_NMAX_BFP32() + if rmode=0b00 then r <- x.sign ? bfp_INFINITY() : bfp_INFINITY() + if rmode=0b01 then r <- x.sign ? bfp_NMAX_BFP32() : bfp_NMAX_BFP32() + if rmode=0b10 then r <- x.sign ? bfp_NMAX_BFP32() : bfp_INFINITY() + if rmode=0b11 then r <- x.sign ? bfp_INFINITY() : bfp_NMAX_BFP32() r.sign <- x.sign ox_flag <- 0b1 xx_flag <- 0b1 -- 2.30.2