From 4be5bec8309348e84bfd3c35df0aebc1a82c5ac7 Mon Sep 17 00:00:00 2001 From: Andrey Miroshnikov Date: Mon, 6 Nov 2023 19:26:01 +0000 Subject: [PATCH] Added section on remapyield --- openpower/sv/cookbook/remap_matrix.mdwn | 42 +++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/openpower/sv/cookbook/remap_matrix.mdwn b/openpower/sv/cookbook/remap_matrix.mdwn index 14df32fe3..4f0757a63 100644 --- a/openpower/sv/cookbook/remap_matrix.mdwn +++ b/openpower/sv/cookbook/remap_matrix.mdwn @@ -399,5 +399,47 @@ Screenshots: [[!img mat_mul_sim_results.png size="600x" ]] +### Remapyield showing how the matrix indices are generated + +*(more work required not critically important right now)* + +This table was drawn up using the `remapyield.py` code found +[here](https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/openpower/decoder/isa/remapyield.py;h=d7b4bdeff2ae5d5f319ae036e4dff70de194dc67;hb=HEAD). + +The xdim, ydim, and zdim were set to match the values specified in the svshape +instruction for the above matrix multiply example. + +`x`, 'y`, and `z` are iterators for the three loops, with a range between 0 and +`SVxd-1`, `SVyd-1`, `SVzd-1` respectively. + +For the above `svshape` instruction example: + +- `x` takes values between 0 and 1 (`SVxd=2`) +- `y` takes values between 0 and 1 (`SVyd=2`) +- `z` takes values between 0 and 2 (`SVzd=3`) +- `x_end`, `y_end`, and `z_end` correspond to the largest permitted values for +`x`, `y`, and `z` (1, 1, and 2 respectively). + + | (x == | (y == | (z == + index | x | y | z | x_end) | y_end) | z_end) + 0 | 0 | 0 | 0 | F | F | F + 1 | 1 | 0 | 0 | T | F | F + 2 | 0 | 1 | 0 | F | T | F + 3 | 1 | 1 | 0 | T | T | F + 4 | 0 | 0 | 1 | F | F | F + 5 | 1 | 0 | 1 | T | F | F + 6 | 0 | 1 | 1 | F | T | F + 7 | 1 | 1 | 1 | T | T | F + 8 | 0 | 0 | 2 | F | F | T + 9 | 1 | 0 | 2 | T | F | T + 10 | 0 | 1 | 2 | F | T | T + 11 | 1 | 1 | 2 | T | T | T + +If the `x`, `y`, and `z` sequences are compared with the inner product index +table, there are some resemblances. Swapping the `x` and `y` (permute=0b10) +shows that matrix X indices correspond to `y`, matrix Y indices correspond to +`x` (if the following equation used: `x+z*z_end`), and matrix Z indices +correspond to `z`. + [[!tag svp64_cookbook ]] -- 2.30.2