[Libre-soc-dev] MVL unclear

Luke Kenneth Casson Leighton lkcl at lkcl.net
Fri May 21 14:00:53 BST 2021


---
crowd-funded eco-conscious hardware: https://www.crowdsupply.com/eoma68


On Fri, May 21, 2021 at 1:50 PM Lauri Kasanen <cand at gmx.com> wrote:

> On Fri, 21 May 2021 13:39:38 +0100
> Luke Kenneth Casson Leighton <lkcl at lkcl.net> wrote:
>
> > here, on this *last loop*, clearly and patently VL *IS NOT* equal to MVL.
> >
> > * MVL == 64
> > * VL == 16.
>
> It is, because on the last loop you set MVL = 16.


no.  MVL is compile-time static, i.e. an immediate.  it cannot be set to 16
without a JIT recompile or without total recompilation of the entire binary.

i say again: MVL *defines* - at compile-time - the *POSSIBLE* allocation
that VL *MAY* use up to during loops.

VL: dynamic, runtime.
MVL: static, compile-time.

Which then
> cascades to VL = 16.
>
> > with the last loop entry being possible for 0 <= VL <= MVL, Cray-style
> > Vectors cover *ALL* repeat *ALL* the ridiculous cleanup cases you see
> > in every single SIMD assembly listing.
>
> This is a benefit of an adjustable VL. The existence of MVL is not
> necessary to save the cleanup. On Cray it had a function, it was a hw
> limit. Here it appears to be nothing but a loop optimization.
>

no.  emphasise, again:

VL: dynamic, runtime.
MVL: static, compile-time.


> So per my other mail, in SV, is the only function of MVL to save a
> couple insns in setting the loop counter?
>

no.  it's fundamental and absolutely critical.  MVL is what the compiler
(and you, the assembly writer) have to know about, when writing the
program, to specify "how many entries of the regfile ***MIGHT*** be used")

VL - being dynamic - is the **actual** length at runtime.


> > and a MASSIVE stupid batch of cleanup instructions at the end.
>
> Again, the lack of cleanup is from setting VL. MVL does not factor into
> it, other than making it faster to set VL. Is this not so?
>

no.  MVL ensures that the regfile is not completely destroyed by over-runs
of allocations determined by the compiler, statically, at compile-time.

MVL: compile-time
VL: run-time.

l.


More information about the Libre-soc-dev mailing list