[Libre-soc-bugs] [Bug 656] add v3.0B BCD instructions to simulator

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Thu Jul 29 06:56:31 BST 2021


https://bugs.libre-soc.org/show_bug.cgi?id=656

--- Comment #9 from Jacob Lifshay <programmerjake at gmail.com> ---
(In reply to dmitry.selyutin from comment #8)
> So, to summarize, does the following work for us?
> 
>     dc[16] = [0]*16
>     do i = 0 to 15
>         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

Yes, it should for now, however it will likely be a total pain later when we
generate C code due to `temp` changing its type each iteration. The pseudocode
I suggested doesn't have that issue.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-soc-bugs mailing list