From: Konstantinos Margaritis Date: Fri, 28 Apr 2023 16:42:31 +0000 (+0000) Subject: working version, negatives work also X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b1050a3f9f3cf9eb8c80f43de98c1f0b37171150;p=libreriscv.git working version, negatives work also --- diff --git a/openpower/sv/twin_butterfly.mdwn b/openpower/sv/twin_butterfly.mdwn index c2014930b..deaf80d29 100644 --- a/openpower/sv/twin_butterfly.mdwn +++ b/openpower/sv/twin_butterfly.mdwn @@ -49,12 +49,14 @@ Pseudo-code: res1 <- ROTL64(prod1, XLEN-n) res2 <- ROTL64(prod2, XLEN-n) m <- MASK(n, (XLEN-1)) - s1 <- res1[0] - s2 <- res2[0] - smask1 <- ([s1]*XLEN) & ¬m - smask2 <- ([s2]*XLEN) & ¬m - RT <- res1 & m | smask1 - RS <- res2 & m | smask2 + signbit1 <- res1[0] + signbit2 <- res2[0] + smask1 <- ([signbit1]*XLEN) & ¬m + smask2 <- ([signbit2]*XLEN) & ¬m + s64_1 <- [0]*(XLEN-1) || signbit1 + s64_2 <- [0]*(XLEN-1) || signbit2 + RT <- (res1 & m | smask1) + s64_1 + RS <- (res2 & m | smask2) + s64_2 ``` Special Registers Altered: