[Libre-soc-isa] [Bug 817] Big Integer Math (sv.adde, sv.subfe, sv.madded, 128 by 64-bit -> 64-bit div/rem, maybe more...)

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Mon Apr 25 18:12:47 BST 2022


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

--- Comment #29 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
 128         // Compute estimate qhat of q[j] from top 2 digits
 129         uint64_t dig2 = ((uint64_t)un[j + n] << 32) | un[j + n - 1];
 130         qhat = dig2 / vn[n - 1];
 131         rhat = dig2 % vn[n - 1];

ehm.... ehmehmehm... qhat and rhat are uint64_t (and un/vn 32 bit*)
therefore when vn/un
are uint64_t[] qhat and rhat must be uint128_t which is NOT happening,
we are NOT going to return QTY 4 64 bit registers from divmod2du.

thus even on scalar usage if un[j+n] > vn[n-1] an overflow on the 128/64
divide will occur.

any clues?

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


More information about the Libre-SOC-ISA mailing list