From b1992b043e3d426bd6b23b75a6756a030f1c66d0 Mon Sep 17 00:00:00 2001 From: lkcl Date: Fri, 29 Apr 2022 12:38:22 +0100 Subject: [PATCH] --- openpower/sv/biginteger/analysis.mdwn | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openpower/sv/biginteger/analysis.mdwn b/openpower/sv/biginteger/analysis.mdwn index 960b50126..3024a02e7 100644 --- a/openpower/sv/biginteger/analysis.mdwn +++ b/openpower/sv/biginteger/analysis.mdwn @@ -458,6 +458,7 @@ Look closely at Algorithm D when the divisor is only a scalar Here, just as with `madded` which can put the hi-half of the 128 bit product back in as a form of 64-bit carry, a scalar divisor of a vector dividend puts the modulo back in as the hi-half of a 128/64-bit divide. + RT0 = (( 0<<64) | RA0) / RB0 RC0 = (( 0<<64) | RA0) % RB0 | @@ -472,8 +473,8 @@ puts the modulo back in as the hi-half of a 128/64-bit divide. RC2 = ((RC1<<64) | RA2) % RB2 By a nice coincidence this is exactly the same 128/64-bit operation -needed for the `qhat` estimate if it may produce both the quotient and -the remainder. +needed (once, rather than chained) for the `qhat` estimate if it may +produce both the quotient and the remainder. The pseudocode cleanly covering both scenarios (leaving out overflow for clarity) can be written as: -- 2.30.2