From: programmerjake Date: Wed, 2 Feb 2022 12:48:39 +0000 (+0000) Subject: add reason to prefer one reduce pseudo-code over the other X-Git-Tag: opf_rfc_ls005_v1~3225 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4e72bd821391cf495f72084c44cd9ec796ca9b1b;p=libreriscv.git add reason to prefer one reduce pseudo-code over the other --- diff --git a/openpower/sv/svp64/appendix.mdwn b/openpower/sv/svp64/appendix.mdwn index 3e626caaa..fca8502d4 100644 --- a/openpower/sv/svp64/appendix.mdwn +++ b/openpower/sv/svp64/appendix.mdwn @@ -720,7 +720,7 @@ For modes: /// `temp_pred` is a user-visible Vector Condition register /// /// all input arrays have length `vl` -def reduce( vl, vec, pred, pred,): +def reduce(vl, vec, pred): step = 1; while step < vl step *= 2; @@ -732,7 +732,13 @@ def reduce( vl, vec, pred, pred,): else if other_pred vec[i] = vec[other]; pred[i] |= other_pred; +``` +we'd want to use something based on the above pseudo-code +rather than the below pseudo-code -- reasoning here: + + +``` def reduce( vl, vec, pred, pred,): j = 0 vi = [] # array of lookup indices to skip nonpredicated