add +1 to products for rounding when shifting
authorKonstantinos Margaritis <konstantinos.margaritis@vectorcamp.gr>
Sat, 29 Apr 2023 15:30:01 +0000 (15:30 +0000)
committerKonstantinos Margaritis <konstantinos.margaritis@vectorcamp.gr>
Sat, 29 Apr 2023 15:30:08 +0000 (15:30 +0000)
openpower/sv/twin_butterfly.mdwn

index c8571bd549ad4ab9953f495f751368f304804463..a5c29a379ce27d45dc70db572f42dd764edd7509 100644 (file)
@@ -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))