From 48a8facdd100ede2fddca5b03da91c5a57184e03 Mon Sep 17 00:00:00 2001 From: lkcl Date: Tue, 26 Apr 2022 21:38:15 +0100 Subject: [PATCH] --- openpower/sv/biginteger/analysis.mdwn | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 -- 2.30.2