[Libre-soc-bugs] [Bug 555] encode a dotproduct in a single instruction

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Wed Dec 23 22:25:46 GMT 2020

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

--- Comment #9 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to Jacob Lifshay from comment #8)
> (In reply to Luke Kenneth Casson Leighton from comment #3)
> > jacob notes: fma reduction would be a polynomial reduction but it would be a
> > Bad Idea (tm) to implement in hardware
>
> *could* be a polynomial reduction:
> v = a
> v = x * v + b
> v = x * v + c
> v = x * v + d
>
> produces:
> v == d + x * c + x^2 * b + x^3 * a

once a b and c are factored out, yes.
above is more (with substitution)

d + (v * (c + (v * (b + (v * a)))))

which i think may be doable with some overlapping fmas (no reduce required)

the polynomial version: i love it.  it's so cool that i think we should give it
a shot.  interestingly it may be possible to detect from the src/dest
scalar/vector marking.

this one is

dest=v (needed in case of intermediaries)
src1=s
src2=s
src3=v

and also, note, RT == RB

>
> having fma reduction be a dot product is also valid, easier to implement in
> hardware,

well we are waay past the point where stuff is "easy" :)  we are long into FSMs
and micro-coding.

> and more useful:
> v = a
> v = b * c + v
> v = d * e + v
> v = f * g + v
>
> v == a + dot(<b, d, f>, <c, e, g>)

this one is

dest=v (needed for intermediary results)
src1=v
src2=v
src3=s

and note, RT == RC

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