[Libre-soc-bugs] [Bug 671] convert spec pseudocode to use XLEN width

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Mon Sep 6 04:37:03 BST 2021


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

--- Comment #63 from Jacob Lifshay <programmerjake at gmail.com> ---
(In reply to Jacob Lifshay from comment #62)
> In the case of addg6s, it totally can have XLEN overridden, since what it
> does is done on individual BCD digits (4-bit units), so elwidth override
> should work just fine:
> elwidth =
> 8: corrects for BCD addition of 2 BCD digits (like x86's daa instruction)

so adding an 8-bit BCD number on x86 does:
# inputs in al and cl
add al, cl
daa
# output in al

adding an 8-bit BCD number on SVP64 does:
# inputs in r3 and r4
sv.add/elwidth=8 r5.s, r3.s, r4.s
sv.addg6s/elwidth=8 r3.s, r3.s, r4.s
sv.add/elwidth=8 r3.s, r3.s, r5.s
# output in r3

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


More information about the libre-soc-bugs mailing list