[Libre-soc-dev] pysvp64asm: opcode setvli not supported

Lauri Kasanen cand at gmx.com
Wed Jun 16 06:38:25 BST 2021


On Tue, 15 Jun 2021 19:19:56 +0100
Luke Kenneth Casson Leighton <lkcl at lkcl.net> wrote:

> i replaced the fmuls and fadds with fmadds, and also took the
> liberty of using fmsubs in appropriate locations, which also gave
> the opportunity to remove tmpsum and tmpsum2 because with
> fmsubs / fmadds both sum and sum2 can be directly used as
> accumulators, carrying on the subtract (or add).

I'm having some trouble understanding why fmsubs works at all. It
appears to be the wrong way around for this operation.

fmsubs res, a, b, c
res = a * b - c

while we want
res -= a * b

unless I made a mistake typing it out, it doesn't work out.

for range(2)
    fmsubs sum, fv0.v, fv1.v, sum

sum = fv0[0] * fv1[0] - sum = fv0[0] * fv1[0]
sum = fv0[1] * fv1[1] - sum = fv0[1] * fv1[1] - fv0[0] * fv1[0]

sum is mulres1 - mulres0, when it should be -mulres1 - mulres0. Note
the sign of the last mul res.

- Lauri



More information about the Libre-soc-dev mailing list