From e037ebba4b1071d5812d5f0ef89896d0a4d13f5c Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 22 Dec 2023 09:16:32 +0000 Subject: [PATCH] bug 1155: comments updating link back to bugreport --- src/openpower/test/bigint/powmod.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 -- 2.30.2