[Libre-soc-dev] Vectorised mtcr and mfcr

lkcl luke.leighton at gmail.com
Mon Aug 8 09:53:00 BST 2022


On Mon, Aug 8, 2022 at 4:05 AM Richard Wilbur <richard.wilbur at gmail.com> wrote:
>
> On Sat, Aug 6, 2022 at 10:29 AM lkcl via Libre-soc-dev
> <libre-soc-dev at lists.libre-soc.org> wrote:
> [...]
> > i have not got round to putting this in the spec because there is so much else to do, but it should also be obvious to use the upper half of the CR reg to store CR8-CR15 Fields and go from there, thus making it 64 bit and therefore only needing to set VL to 8 and perform a vector sv.mfcr only of length 8.
> >
> > it is something of a pain to have to set VL specifically for that, which was one of the motivations in early versions of SV for embedding VL into the prefix.  we ran out of space so it was removed. i do keep wondering how to bring it back.
>
> The elegance on context switch does make a strong argument for
> embedding VL into the prefix.

interestingly an additional discussion cropped up a case for
alternative prefixign as well:

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

the idea there is to take another of the 64 EXT001 areas
(page 1350 Table 12, Book III v3.1)

there are 20 bits available

> for mtcr and mfcr since we have only 16 registers.  Theoretically that
> would only require 4 bits:  VLbitfield=0000b => scalar case (VL=1),
> VLbitfield=1111b => the whole set of CR's (VL=16).  If we use your
> simplifying grouping of CR's into 64-bit blocks we should be able to
> get away with 3 bits:  VLbitfield=000b => (VL=1, which effectively
> saves two CR's), VLbitfield=111b => (VL=8, which effectively saves all
> 16 CR's).

i very much prefer general-purpose things to narrow-focus ones,
they stand a higher chance of acceptance, but the corollary is,
they take up more bits.  power-of-two VL is the
next step up, full VL (7 bits) the next one after that.

also bear in mind that a zero-test followed by predicate-masking would
also be extremely valuable (to save room on the stack)

or, even a hardware-level "between last context-switch was this register
ever changed" test.  that was discussed a couple years ago.

l.



More information about the Libre-soc-dev mailing list