[Libre-soc-bugs] [Bug 972] addme/subfme carry/overflow likely incorrect

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Sat Oct 29 12:15:43 BST 2022


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

--- Comment #2 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to Jacob Lifshay from comment #1)
> imho lots more of our ops likely don't calculate CA correctly because
> SelectableInt doesn't propagate carries

see constructor, "overflow".

detecting CA rather unfortunately has to be done manually. this imposition
is expected based on how the Power ISA specification is written.

https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/openpower/decoder/isa/caller.py;h=de6719adf90dfb42f59d55539be837631c7906e6;hb=a5e874ed4f20a8febed2f7cf51715e2a930f1f01#l1390

yes, it's awful.

the value "-1" is being inserted into the inputs multiple times
(once by handle_carry() and twice by handle_overflow()) which
obviously it should not be, but it doesn't matter because all
code only looks at the first two inputs (sigh).

i suspect different logic is needed for handling add, analysing
the inputs and outputs in a similar fashion to how CA32 is
done.  a first attempt completely broke all other unit tests,
i'm not up to dealing with this.

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


More information about the libre-soc-bugs mailing list