From: lkcl Date: Wed, 27 Apr 2022 15:26:06 +0000 (+0100) Subject: (no commit message) X-Git-Tag: opf_rfc_ls005_v1~2553 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7e934f67f3d8be74288bfd813f1df05e54591b12;p=libreriscv.git --- diff --git a/openpower/sv/biginteger/analysis.mdwn b/openpower/sv/biginteger/analysis.mdwn index 719755e34..0ed378f06 100644 --- a/openpower/sv/biginteger/analysis.mdwn +++ b/openpower/sv/biginteger/analysis.mdwn @@ -477,8 +477,11 @@ the dividend then the result may not fit into 64 bit. Knuth's original algorithm detects overflow and manually places 0xffffffff (all ones) into `qhat`. With there being so many operands already in `divrem2du` a `cmpl` instruction can be used instead to detect -the overflow. This saves having to add an Rc=1 or OE. +the overflow. This saves having to add an Rc=1 or OE=1 mode when +the available space in VA-Form EXT04 is extremely limited. Looking closely at the loop however we can see that overflow will not occur. The initial value k is zero, and on subsequent iterations -new k, being the modulo, is always less than the divisor +new k, being the modulo, is always less than the divisor. Thus the +condition (the loop invariant) `RC < RA` is preserved, as long as RC +starts at zero.