From: Andrey Miroshnikov Date: Thu, 9 Nov 2023 18:36:00 +0000 (+0000) Subject: Add table of row/column indices X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=68c1a4d9d3200c4b625e1a84d962b9234128e6b6;p=libreriscv.git Add table of row/column indices --- diff --git a/openpower/sv/cookbook/remap_matrix.mdwn b/openpower/sv/cookbook/remap_matrix.mdwn index 146457659..701c9c01c 100644 --- a/openpower/sv/cookbook/remap_matrix.mdwn +++ b/openpower/sv/cookbook/remap_matrix.mdwn @@ -358,6 +358,34 @@ REMAP, or setvl is setup. Assigns the configured SVSHAPEs to the relevant operand/result registers of the consecutive instruction/s (depending on if REMAP is set to persistent). +The index table shown for the inner method above shows indices for a 'flattened' +matrix (how it would be arranged in sequential GPR registers), whereas +SVSHAPE0, 1, 2 registers setup the indices in relation to rows and columns +of the matrix. + +This is how the indices compare: + +``` + Row/Column Indices + Flattened Indices | Mat X | Mat Y | Mat Z | +| Mat X | Mat Y | Mat Z | | r c | r c | r c | +| 0 | 0 | 0 | | 0 0 | 0 0 | 0 0 | +| 0 | 1 | 1 | | 0 0 | 0 1 | 0 1 | +| 3 | 0 | 2 | | 1 0 | 0 0 | 1 0 | +| 3 | 1 | 3 | | 1 0 | 0 1 | 1 1 | +| 1 | 2 | 0 | | 0 1 | 1 0 | 0 0 | +| 1 | 3 | 1 | | 0 1 | 1 1 | 0 1 | +| 4 | 2 | 2 | | 1 1 | 1 0 | 1 0 | +| 4 | 3 | 3 | | 1 1 | 1 1 | 1 1 | +| 2 | 4 | 0 | | 0 2 | 2 0 | 0 0 | +| 2 | 5 | 1 | | 0 2 | 2 1 | 0 1 | +| 5 | 4 | 2 | | 1 2 | 2 0 | 1 0 | +| 5 | 5 | 3 | | 1 2 | 2 1 | 1 1 | +``` + +See [[openpower/sv/remap]] Section 3.3 Matrix Mode for more information on +the index sequences which can be produced with SVSHAPE SPRs. + ## maddld - Multiply-Add Low Doubleword VA-form ```