From: lkcl Date: Sun, 24 Apr 2022 20:47:51 +0000 (+0100) Subject: (no commit message) X-Git-Tag: opf_rfc_ls005_v1~2603 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=876ac726e07b3c1ee26bccd8b596de424f0697be;p=libreriscv.git --- diff --git a/openpower/sv/biginteger/analysis.mdwn b/openpower/sv/biginteger/analysis.mdwn index 567975d5a..c77a7a859 100644 --- a/openpower/sv/biginteger/analysis.mdwn +++ b/openpower/sv/biginteger/analysis.mdwn @@ -368,3 +368,13 @@ there is no reason why it should not be adapted to Fixed Point. In this way a Scalar Integer divide can be performed in the same time-order as Newton-Raphson, using two hardware multipliers and a subtract. + +``` + k = 0; // the case of a + for (j = m - 1; j >= 0; j--) + { // single-digit + uint64_t dig2 = (k * b + u[j]); + q[j] = dig2 / v[0]; // divisor here. + k = dig2 % v[0]; // modulo bak into next loop + } +```