# [Libre-soc-dev] [RFC] SVP64 Vertical-First Mode loops

Richard Wilbur richard.wilbur at gmail.com
Thu Aug 19 23:41:16 BST 2021

```> On Aug 18, 2021, at 18:13, lkcl <luke.leighton at gmail.com> wrote:
>
> each row being a butterfly goes double the distance and therefore needs half the coefficients compared to the previous row.
>
> * when you have 16 values you need twin mul-add on 8 values and therefore 8 coefficients
> * next row you have 2 batches of 8 values therefore the 4 coefficients can be used 2x
> * next row you have 4 batches of 4 values, 2 coefficients can be used 4x
> * next row 8 batches of 2 values, the 1 coefficient can be used 8x
>
> 8 4 2 1 on batch sizes and num coefficients
> 1 2 4 8 times reuse on coefficients

Looks like, for this example,
N = 16 values,
number of unique coefficients = 8 + 4 + 2 + 1 = 15 = N - 1

Thatâ€™s interesting.  The total number of coefficients = (N / 2) * log(base=2, N)

Number of reuses = (N / 2) * log(base=2, N) - (N - 1)
= 32 - 15 = 17

```