From: lkcl Date: Tue, 26 Apr 2022 20:38:15 +0000 (+0100) Subject: (no commit message) X-Git-Tag: opf_rfc_ls005_v1~2575 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=48a8facdd100ede2fddca5b03da91c5a57184e03;p=libreriscv.git --- diff --git a/openpower/sv/biginteger/analysis.mdwn b/openpower/sv/biginteger/analysis.mdwn index 7c1f423e2..e38038672 100644 --- a/openpower/sv/biginteger/analysis.mdwn +++ b/openpower/sv/biginteger/analysis.mdwn @@ -414,9 +414,9 @@ Just as with `divdeu` on which this instruction is based an overflow detection is required. When the divisor is too small compared to 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`. It makes sense for `divrem2du` to do -this, and also to return an overflow indicator: this can be done -by always setting Rc=1 as a way to save opcode space +(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. Looking closely at the loop however we can see that overflow will not occur. The initial value k is zero, and on subsequent iterations