[Libre-soc-dev] LD/ST Elwidth Overrides

Jacob Lifshay programmerjake at gmail.com
Wed Sep 1 18:40:07 BST 2021


On Wed, Sep 1, 2021, 10:27 Luke Kenneth Casson Leighton <lkcl at lkcl.net>
wrote:

> ---
> crowd-funded eco-conscious hardware: https://www.crowdsupply.com/eoma68
>
> On Wed, Sep 1, 2021 at 6:23 PM Jacob Lifshay <programmerjake at gmail.com>
> wrote:
>
> > I realized that it would be more useful to let the src elwidth override
> > apply to the index register for lbzx (and all ld/st indexed instructions)
>
> there's a special detection for Vector Indexed Mode: RA.isvec is set.
> when that occurs there's nothing stopping us from treating it entirely
> differently from unitstride and elstride modes.
>
> > instead of using the src elwidth to change the memory access size, which
> is
> > redundant:
> >
> https://libre-soc.org/irclog/%23libre-soc.2021-09-01.log.html#t2021-09-01T17:54:16
> >
> > Note that how I'm proposing is exactly how gather/scatter works on x86
> and
> > Arm and probably waay more...it's also useful for doing webassembly
> > load/stores in one instruction, rather than 3 (explained in irclog link).
>
> yeah i don't have a problem with that, at all.  what do we "lose" by
> enabling Indexed mode to have the elwidth override on RA?
> (and, what are the 3 instructions that would otherwise be needed?)
>

the instructions would be something like:
clrldi 4, 4, 32 # r4 &= 0xFFFF_FFFF
lbzx 3, 4, 3

https://gcc.godbolt.org/z/8fTEdGdfz

Jacob


More information about the Libre-soc-dev mailing list