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

Jacob Lifshay programmerjake at gmail.com
Wed Sep 1 19:24:15 BST 2021


On Wed, Sep 1, 2021, 11:20 lkcl <luke.leighton at gmail.com> wrote:

>
>
> On September 1, 2021 5:40:07 PM UTC, Jacob Lifshay <
> programmerjake at gmail.com> wrote:
>
> >the instructions would be something like:
> >clrldi 4, 4, 32 # r4 &= 0xFFFF_FFFF
> >lbzx 3, 4, 3
>
> ah ok so actually truncating the range of the offset (RB) to 32 bits, 16
> bits, 8 bits, then sign-extending or zero-extending it *back* to 64 bit
> before adding to RA.
>
> hmmm, i wasn't expecting that.
>
> the problem i can see with this is, should it be signed or unsigned? if
> both are 64 bit the question does not arise of course.
>
> questions.
>
> 1) is there a spare bit in Indexed Mode which can specify signed/unsigned
>
> 2) if src elwidth applies to RB are we "losing" anything?
>
> lw:
>
> EA = [0] * 64
> EA += RA
> EA += RB[0:SRCLEN-1] # something like that
> RS[XLEN-32:XLEN-1] = MEM(EA, 32)
>
> mmm.... i'm not seeing any downside here.  just need to work out, signed
> or unsigned.
>

wasm requires unsigned. x86 uses unsigned, idk for other archs, I suggest
just always use unsigned if there aren't any spare bits.

Jacob


More information about the Libre-soc-dev mailing list