```
def index_remap(i):
- return GPR((SVSHAPE.SVGPR<<1)+i)
+ return GPR((SVSHAPE.SVGPR<<1)+i+SVSHAPE.offset)
for i in 0..VL-1:
GPR(RT + indexed_remap(i) + SVSHAPE.offset) = ....
Matrix-style reordering still applies to the indices, except limited
to up to 2 Dimensions (X,Y). Ordering is therefore limited to (X,Y) or
(Y,X). Only one dimension may optionally be skipped. Inversion of either
-X or Y or both is possible.
+X or Y or both is possible. Pseudocode for Indexed Mode (without elwidth
+overrides) may be written in terms of Matrix Mode:
+
+```
+def index_remap(ISHAPE, i):
+ MSHAPE.skip = 0b0 || ISHAPE.skip
+ MSHAPE.invxyz = 0b0 || ISHAPE.invxy
+ MSHAPE.xdimsz = ISHAPE.xdimsz
+ MSHAPE.ydimsz = ISHAPE.ydimsz
+ MSHAPE.zdimsz = 0
+ if ISHAPE.permute = 0b110 # 0,1
+ MSHAPE.permute = 0b000 # 0,1,2
+ if ISHAPE.permute = 0b111 # 1,0
+ MSHAPE.permute = 0b010 # 1,0,2
+ el_idx = remap_matrix(MSHAPE, i)
+ return GPR((ISHAPE.SVGPR<<1)+el_idx+ISHAPE.offset)
+```
+