From: Luke Kenneth Casson Leighton Date: Sun, 16 Apr 2023 14:34:12 +0000 (+0100) Subject: move REMAP pseudocode to later pages X-Git-Tag: opf_rfc_ls009_v1~1 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=db253abceb2516e3f3f07b45ba434bc3c92d2151;p=libreriscv.git move REMAP pseudocode to later pages --- diff --git a/openpower/sv/remap/appendix.mdwn b/openpower/sv/remap/appendix.mdwn index 6cb331106..843a712ce 100644 --- a/openpower/sv/remap/appendix.mdwn +++ b/openpower/sv/remap/appendix.mdwn @@ -1,3 +1,155 @@ +## REMAP Matrix pseudocode + +The algorithm below shows how REMAP works more clearly, and may be +executed as a python program: + +``` +[[!inline pages="openpower/sv/remap.py" quick="yes" raw="yes" ]] +``` + +An easier-to-read version (using python iterators) is given in +a later section of this Appendix. + +Each element index from the for-loop `0..VL-1` +is run through the above algorithm to work out the **actual** element +index, instead. Given that there are four possible SHAPE entries, up to +four separate registers in any given operation may be simultaneously +remapped: + +``` + function op_add(RT, RA, RB) # add not VADD! +  for (i=0,id=0,irs1=0,irs2=0; i < VL; i++) + SVSTATE.srcstep = i # save context + if (predval & 1<