(no commit message)
authorlkcl <lkcl@web>
Sun, 1 Aug 2021 10:40:04 +0000 (11:40 +0100)
committerIkiWiki <ikiwiki.info>
Sun, 1 Aug 2021 10:40:04 +0000 (11:40 +0100)
openpower/sv/svp64/appendix.mdwn

index 8764fb76542defb4d4270706de19400505f43986..db56a0a166b6505b3eeec75d51186c3fe5086087 100644 (file)
@@ -764,17 +764,16 @@ def reduce(  vl,  vec, pred, pred,):
        if pbit:
            vi[j] = i
            j += 1
-    step = 1
-    while step < vl
-        step *= 2
+    step = 2
+    while step <= vl
+        halfstep = step // 2
         for i in (0..vl).step_by(step)
-            other = vi[i + step / 2]
+            other = vi[i + halfstep]
             i = vi[i]
             other_pred = other < vl && pred[other]
             if pred[i] && other_pred
                 vec[i] += vec[other]
             pred[i] |= other_pred
-
-
+         step *= 2
 
 ```