From db253abceb2516e3f3f07b45ba434bc3c92d2151 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sun, 16 Apr 2023 15:34:12 +0100 Subject: [PATCH] move REMAP pseudocode to later pages --- openpower/sv/remap/appendix.mdwn | 304 +++++++++++++++---------------- 1 file changed, 152 insertions(+), 152 deletions(-) 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<