From c2fac68d1db95c67e3fa5fa9b1fdef5d97e3f1a1 Mon Sep 17 00:00:00 2001 From: Konstantinos Margaritis Date: Fri, 21 Jul 2023 10:23:39 +0000 Subject: [PATCH] fix wrong paste of pseudo-code --- openpower/sv/twin_butterfly.mdwn | 33 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/openpower/sv/twin_butterfly.mdwn b/openpower/sv/twin_butterfly.mdwn index 26b2484ef..faee1c2e9 100644 --- a/openpower/sv/twin_butterfly.mdwn +++ b/openpower/sv/twin_butterfly.mdwn @@ -147,35 +147,30 @@ A-Form Pseudo-code: +``` n <- SH prod <- MULS(RB, RA) if n = 0 then prod_lo <- prod[XLEN:(XLEN*2) - 1] RT <- (RT) + prod_lo - n <- SH - sum <- (RT) + (RA) - diff <- (RT) - (RA) - prod1 <- MULS(RB, sum) - prod1_lo <- prod1[XLEN:(XLEN*2)-1] - prod2 <- MULS(RB, diff) - prod2_lo <- prod2[XLEN:(XLEN*2)-1] - if n = 0 then - RT <- prod1_lo - RS <- prod2_lo + RS <- (RS) - prod_lo else - round <- [0]*XLEN - round[XLEN -n] <- 1 - prod1_lo <- prod1_lo + round - prod2_lo <- prod2_lo + round - m <- MASK(n, (XLEN-1)) - res1 <- ROTL64(prod1_lo, XLEN-n) & m - res2 <- ROTL64(prod2_lo, XLEN-n) & m - signbit1 <- prod1_lo[0] - signbit2 <- prod2_lo[0] + res1[0:XLEN*2-1] <- (EXTSXL((RT)[0], 1) || (RT)) + prod + res2[0:XLEN*2-1] <- (EXTSXL((RS)[0], 1) || (RS)) - prod + round <- [0]*XLEN*2 + round[XLEN*2 - n] <- 1 + res1 <- res1 + round + res2 <- res2 + round + signbit1 <- res1[0] + signbit2 <- res2[0] + m <- MASK(XLEN -n - 2, XLEN - 1) + res1 <- res1[XLEN - n:XLEN*2 - n -1] + res2 <- res2[XLEN - n:XLEN*2 - n -1] smask1 <- ([signbit1]*XLEN) & ¬m smask2 <- ([signbit2]*XLEN) & ¬m RT <- (res1 | smask1) RS <- (res2 | smask2) +``` Special Registers Altered: -- 2.30.2