From eeb6df96c4a50f34749d1a168d799a06ca4fcbbe Mon Sep 17 00:00:00 2001 From: lkcl Date: Sun, 1 Aug 2021 11:40:04 +0100 Subject: [PATCH] --- openpower/sv/svp64/appendix.mdwn | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/openpower/sv/svp64/appendix.mdwn b/openpower/sv/svp64/appendix.mdwn index 8764fb765..db56a0a16 100644 --- a/openpower/sv/svp64/appendix.mdwn +++ b/openpower/sv/svp64/appendix.mdwn @@ -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 ``` -- 2.30.2