add seeming-redundant addc/adde (actually part of big-mul-*add*)
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 27 Sep 2023 18:13:47 +0000 (19:13 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 30 Sep 2023 13:36:32 +0000 (14:36 +0100)
which completes the pattern for REMAP transformation

src/openpower/test/bigint/powmod.py

index 04ae35641325c47a202d7969d4e66376a745e065..d25486d395910e22f32494c3e95b714b52cee2ea 100644 (file)
@@ -97,6 +97,9 @@ def python_mul_algorithm2(a, b):
 
     y = [0] * 8
     t = [0] * 5
+    y[0], ca = addc(y[0], t[0])
+    for i in range(4):
+        y[1 + i], ca = adde(y[1 + i], t[1 + i], ca)
     for i in range(4):
         y[i], y[4] = maddedu(a[0], b[i], y[4])
     t[4] = 0
@@ -277,7 +280,7 @@ if __name__ == "__main__":
     # now test python_mul_algorithm2 *against* python_mul_algorithm
     import random
     random.seed(0) # reproducible values
-    for i in range(10):
+    for i in range(10000):
         a = []
         b = []
         for j in range(4):