From c6734ac409f5339586f5b9c2185478914dec83dd Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Fri, 30 Jul 2021 18:33:03 +0000 Subject: [PATCH] isa/bcd.mdwn: update addg6s pseudocode Not only this pseudocode is wrong, since some actions are put inside the loop, but also the algorithm as is cannot be translated due to use of function call (carry_out). For more details, check these discussions: https://libre-soc.org/irclog/%23libre-soc.2021-07-28.log.html https://bugs.libre-soc.org/show_bug.cgi?id=656 --- openpower/isa/bcd.mdwn | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/openpower/isa/bcd.mdwn b/openpower/isa/bcd.mdwn index 30bb1619..04753ed6 100644 --- a/openpower/isa/bcd.mdwn +++ b/openpower/isa/bcd.mdwn @@ -33,13 +33,15 @@ XO-Form Pseudo-code: + dc[16] = [0]*16 do i = 0 to 15 - dci <- carry_out(RA[4*i:63] + RB[4*i:63]) - c <- ([dc[0]]*4 || [dc[1]]*4 || [dc[2]]*4 || [dc[3]]*4 || - [dc[4]]*4 || [dc[5]]*4 || [dc[6]]*4 || [dc[7]]*4 || - [dc[8]]*4 || [dc[9]]*4 || [dc[10]]*4 || [dc[11]]*4 || - [dc[12]]*4 || [dc[13]]*4 || [dc[14]]*4 || [dc[15]]*4) - RT <- (¬c) & 0x6666_6666_6666_6666 + temp <- (0b0 || RA[4*i:63]) + (0b0 || RB[4*i:63]) + dc[i] <- temp[0] + c <- ([dc[0]]*4 || [dc[1]]*4 || [dc[2]]*4 || [dc[3]]*4 || + [dc[4]]*4 || [dc[5]]*4 || [dc[6]]*4 || [dc[7]]*4 || + [dc[8]]*4 || [dc[9]]*4 || [dc[10]]*4 || [dc[11]]*4 || + [dc[12]]*4 || [dc[13]]*4 || [dc[14]]*4 || [dc[15]]*4) + RT <- (¬c) & 0x6666_6666_6666_6666 Special Registers Altered: -- 2.30.2