From 14100af9abc0987c5bc17e762a645099336b90aa Mon Sep 17 00:00:00 2001 From: Konstantinos Margaritis Date: Sat, 29 Apr 2023 15:30:01 +0000 Subject: [PATCH] add +1 to products for rounding when shifting --- openpower/sv/twin_butterfly.mdwn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)) -- 2.30.2