From: Luke Kenneth Casson Leighton Date: Fri, 22 Dec 2023 09:16:32 +0000 (+0000) Subject: bug 1155: comments updating link back to bugreport X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e037ebba4b1071d5812d5f0ef89896d0a4d13f5c;p=openpower-isa.git bug 1155: comments updating link back to bugreport --- diff --git a/src/openpower/test/bigint/powmod.py b/src/openpower/test/bigint/powmod.py index 6ceb9f7f..289f472e 100644 --- a/src/openpower/test/bigint/powmod.py +++ b/src/openpower/test/bigint/powmod.py @@ -105,11 +105,11 @@ def python_mul_remap_yielder(a_sz, b_sz): yield ai, bi, ai + bi, ai + bi + 1 def python_mul_remap_algorithm(a, b): - # version 2 of the MUL_256_X_256_TO_512_ASM algorithm using base 100 rather - # than 2^64, since that's easier to read. - a_sz, b_sz = len(a), len(b) - y = [0] * (a_sz + b_sz) - ca = 0 + # version 3 that is identical in effect to the python_mul_algorithm above. + # yielding indices massively compacts down the function, the assembler is + # ridiculously short https://bugs.libre-soc.org/show_bug.cgi?id=1155#c10 + a_sz, b_sz = len(a), len(b) # lengths of a and b + y, ca = [0] * (a_sz + b_sz), 0 # initialise array y, carry to zero for ai, bi, apbi, apbp1 in python_mul_remap_yielder(a_sz, b_sz): # no need to clear ca between ai outer loops, since the partial # products can't get big enough to have a carry out, so ca will