From: lkcl Date: Sat, 4 Jun 2022 18:13:58 +0000 (+0100) Subject: (no commit message) X-Git-Tag: opf_rfc_ls005_v1~1975 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0cb09fe14fd39fa695da79d2c365ff5d82c1787a;p=libreriscv.git --- diff --git a/openpower/sv/shape_table_format.mdwn b/openpower/sv/shape_table_format.mdwn index 364dcb5ed..6e54cacff 100644 --- a/openpower/sv/shape_table_format.mdwn +++ b/openpower/sv/shape_table_format.mdwn @@ -110,7 +110,7 @@ In its simplest form (without elwidth overrides or other modes): ``` 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) = .... @@ -119,4 +119,21 @@ for i in 0..VL-1: 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) +``` +