Result needs rounding so add +1 to prod*
authorKonstantinos Margaritis <konstantinos.margaritis@vectorcamp.gr>
Sat, 29 Apr 2023 15:29:32 +0000 (15:29 +0000)
committerKonstantinos Margaritis <konstantinos.margaritis@vectorcamp.gr>
Thu, 4 May 2023 15:31:10 +0000 (15:31 +0000)
openpower/isa/butterfly.mdwn

index 555e8abd120bc1252c52c2610a5afabe888136f3..94840b03be05987daecb63f4616e43d48635c240 100644 (file)
@@ -13,8 +13,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))