From: Konstantinos Margaritis Date: Sat, 29 Apr 2023 15:30:01 +0000 (+0000) Subject: add +1 to products for rounding when shifting X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=14100af9abc0987c5bc17e762a645099336b90aa;p=libreriscv.git add +1 to products for rounding when shifting --- diff --git a/openpower/sv/twin_butterfly.mdwn b/openpower/sv/twin_butterfly.mdwn index c8571bd54..a5c29a379 100644 --- a/openpower/sv/twin_butterfly.mdwn +++ b/openpower/sv/twin_butterfly.mdwn @@ -67,8 +67,8 @@ Pseudo-code: n <- SH sum <- (RT) + (RA) diff <- (RT) - (RA) - prod1 <- MULS(RB, sum)[XLEN:(XLEN*2)-1] - prod2 <- MULS(RB, diff)[XLEN:(XLEN*2)-1] + prod1 <- MULS(RB, sum)[XLEN:(XLEN*2)-1] + 1 + prod2 <- MULS(RB, diff)[XLEN:(XLEN*2)-1] + 1 res1 <- ROTL64(prod1, XLEN-n) res2 <- ROTL64(prod2, XLEN-n) m <- MASK(n, (XLEN-1))