[libre-riscv-dev] Instruction sorta-prefixes for easier high-register access

Luke Kenneth Casson Leighton lkcl at lkcl.net
Thu Jan 31 06:56:25 GMT 2019


On Thursday, January 31, 2019, Jacob Lifshay <programmerjake at gmail.com>
wrote:

> On Wed, Jan 30, 2019, 20:34 Luke Kenneth Casson Leighton <lkcl at lkcl.net
> wrote:
>
> > ok so i thought about the vlpN concept, and if the register-prefixing
> > encodes scalar/vector already, then reserving '0b00 for "scalar" is
> > redundant.  it would therefore be better to split out VL from
> > predicate specs.
> >
> I disagree, having a combined field allows using the otherwise-reserved
> predicate of "never" to encode other less common VL-multipliers.
>
> predicate:
> 000: x0 (never)
> 001: pr1
> 010: pr2
> 011: pr3
> 100: ~x0 (always)
> 101: ~pr1
> 110: ~pr2
> 111: ~pr3


Ok, so there's reasonable justification.


>
> >
> > there is however a small problem with VL multipliers: they break the
> > Vectorisation Loop paradigm, turning it effectively into a SIMD-like
> > one instead.
>
> Not really, see following examples.
>
> >
> > i am slightly concerned that the templates for VL-based loops would
> > need to be much more complex (less uniform), as the multipliers now
> > need to be taken into account within the loop, on a per-instruction
> > basis instead of a per-loop basis.
> >
> VL multipliers are basically embedding the short-length (1 to 4) SIMD
> vectors used in Vulkan shaders into a VL-based vectorization loop.



Oink. Vulkan actually has a primitive of vectors of lengths between 1 and
4? Cool!

Ok so that makes a little more sense, although I have to admit it does seem
very specialist (non-generic), which makes me slightly nervous.

However, as a primitive type, the objection I had would go away, as the
code emitted would correspond directly, and, in fact, the generic case
would be the one that was more complex!


> The vl-multipliers that Vulkan needs are 1, 2, 3, and 4.
> The vl-multipliers that OpenCL needs are 1, 2, 3, 4, 8, and 16, though we
> can probably get away with just 1 to 4 and use multiple vectors for 8 and
> 16.
>
> So, hopefully, the examples I gave help show how vl-multipliers are
> probably the most straightforward way to vectorize graphics code with
> variable length vectors.


I get it now.


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


More information about the libre-riscv-dev mailing list