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
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: