From: Andrey Miroshnikov Date: Mon, 6 Nov 2023 17:56:11 +0000 (+0000) Subject: Add info on computing SVxd/yd/zd params X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e27736d030ed3a806a67652bac3fd3f436aba04e;p=libreriscv.git Add info on computing SVxd/yd/zd params --- diff --git a/openpower/sv/cookbook/remap_matrix.mdwn b/openpower/sv/cookbook/remap_matrix.mdwn index 787bc4360..e28b99fb4 100644 --- a/openpower/sv/cookbook/remap_matrix.mdwn +++ b/openpower/sv/cookbook/remap_matrix.mdwn @@ -270,6 +270,11 @@ Permute re-arranges the order of the nested for-loops used to iterate over the three dimensions. This allows for in-place transpose, in-place rotate, matrix multiply, convolutions, without the limitation of Power-of-Two matrices. +For normal matrix multiply, the permute setting is 0b010 (order 1,0,2, +or swap x and y loops). + +(*NOTE:* This is done automatically by the Matrix-Multiply REMAP mode, `SVRM=0`.) + Limitations of Matrix REMAP are currently: - Vector Length (VL) limited to 127, and up to 127 Multiply-Add Accumulates @@ -297,6 +302,24 @@ breakdown: - SVRM=0 (Matrix mode, uses `SVSHAPE0` SPR) - vf=0 (not using Vertical-First mode) +To determine the `SVxd`/`SVyd`/`SVzd` settings: + +- `SVxd` is equal to the number of columns in the second operand matrix. +Matrix Y has 2 columns, so `SVxd=2`. +- `SVyd` is equal to the number of rows in the first operand matrix. +Matrix X has 2 rows, so `SVyd=2`. +- `SVzd` is equal to the number of columns in the first operand matrix, +or the number of rows in the second operand matrix. +Matrix X has 3 columns, matrix Y has 3 rows, so `SVzd=3`. + +Table form + +``` + SVxd | mat_Y_num_cols + SVyd | mat_X_num_rows + SVzd | mat_X_num_cols OR mat_Y_num_rows +``` + ## SVREMAP ```