[Libre-soc-bugs] [Bug 1155] O(n^2) multiplication REMAP mode(s)

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Fri Dec 22 14:30:50 GMT 2023


https://bugs.libre-soc.org/show_bug.cgi?id=1155

--- Comment #17 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to Jacob Lifshay from comment #14)
> i had an idea for SVSHAPE: if we can get a matrix mode with 3 spare bits
> (e.g. a flag that repurposes some bits somewhere), then we can use them like
> so:
> 000 normal matrix mode
> 001 x
> 010 y
> 011 x + y
> 100 z
> 101 x + z
> 110 y + z
> 111 x + y + z

*deep breath*... i love it!

> this gives us all the different things matrix mode can do for each of the
> x,y,z axes, and lets us extract just one axis, or sum axes together. invxyz
> lets us subtract them too.

aaawesome. no that's a bloody good idea.

let me walk through it on SVSHAPE (from comment #2)
and also do some clarification
https://git.libre-soc.org/?p=libreriscv.git;a=commitdiff;h=0b934a4d48d

> https://libre-soc.org/openpower/sv/remap/
> 
> 
> |0:5   |6:11  | 12:17   | 18:20   | 21:23   |24:27 |28:29  |30:31| Mode  |
> |----- |----- | ------- | ------- | ------  |------|------ |---- | ----- |
> |xdimsz|ydimsz| zdimsz  | permute | invxyz  |offset|skip   |0b00 |Matrix |
> |xdimsz|ydimsz|SVGPR    | 11/     |sk1/invxy|offset|elwidth|0b00 |Indexed|
> |xdimsz|mode  | zdimsz  | submode2| invxyz  |offset|submode|0b01 |DCT/FFT|
> | rsvd |rsvd  |xdimsz   | rsvd    | invxyz  |offset|submode|0b10 |Red/Sum|
> |      |      |         |         |         |      |       |0b11 |rsvd   |

we have mode=0b11 free!

i wasn't planning to allocate it as it's extremely precious space in what
is a seriously loaded 32-bit SPR, but the idea of adding up (and subtracting)
the three dimensions x y z is a damn good one, let's roll with it.

|0:5   |6:11  | 12:17   | 18:20   | 21:23   |24:27 |28:29  |30:31| Mode  |
|----- |----- | ------- | ------- | ------  |------|------ |---- | ----- |
|xdimsz|ydimsz| zdimsz  | permute | invxyz  |offset|skip   |0b01 |BigMul |

hmm hmm hmm skip doesn't make sense here, so can be used as a submode

|0:5   |6:11  | 12:17   | 18:20   | 21:23   |24:27 |28:29  |30:31| Mode  |
|----- |----- | ------- | ------- | ------  |------|------ |---- | ----- |
|xdimsz|ydimsz| zdimsz  | permute | invxyz  |offset|submode|0b01 |BigMul |

if a dimension is zero (which remember encoding is 0=1 1=2 2=3 because
the for-loops go "for i = 0 to xdimsz INCLUSIVE" then it can mean "disabled".

submode possibilities:

* submode=0b00 - triangular, no modulo
* submode=0b01 - rhombus, no modulo
* submode=0b10 -

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-soc-bugs mailing list