Bug 561 - fail-first gather/scatter LD/ST means "strided"
Summary: fail-first gather/scatter LD/ST means "strided"
Status: CONFIRMED
Alias: None
Product: Libre-SOC's first SoC
Classification: Unclassified
Component: Source Code (show other bugs)
Version: unspecified
Hardware: PC Linux
: --- enhancement
Assignee: Luke Kenneth Casson Leighton
URL:
Depends on:
Blocks: 213
  Show dependency treegraph
 
Reported: 2020-12-30 19:02 GMT by Luke Kenneth Casson Leighton
Modified: 2021-10-03 22:26 BST (History)
2 users (show)

See Also:
NLnet milestone: ---
total budget (EUR) for completion of task and all subtasks: 0
budget (EUR) for this task, excluding subtasks' budget: 0
parent task for budget allocation:
child tasks for budget allocation:
The table of payments (in EUR) for this task; TOML format:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Luke Kenneth Casson Leighton 2020-12-30 19:02:42 GMT
security issue noted in RVV 0.9, with base-strided vectors.

we could instead use this to mean "element strided" mode.  hurrah.
Comment 1 Jacob Lifshay 2020-12-30 19:45:39 GMT
Note I meant specifically for gather-load and scatter-store, where the base register is marked as a vector and when mode is set to fail-on-first, we would instead interpret that as a strided load/store with a scalar base register, since otherwise we wouldn't have an encoding for that.
Comment 2 Jacob Lifshay 2021-09-02 19:23:09 BST
(In reply to Jacob Lifshay from comment #1)
> Note I meant specifically for gather-load and scatter-store, where the base
> register is marked as a vector and when mode is set to fail-on-first, we
> would instead interpret that as a strided load/store with a scalar base
> register, since otherwise we wouldn't have an encoding for that.

strided load would mean something like:

for(i = 0; i < VL; i++)
    reg[rt + i] = mem[reg[ra] + i * imm];
Comment 3 Jacob Lifshay 2021-09-02 19:26:56 BST
(In reply to Jacob Lifshay from comment #2)
> strided load would mean something like:
> 
> for(i = 0; i < VL; i++)
>     reg[rt + i] = mem[reg[ra] + i * imm];

we will want imm to be signed
Comment 4 Luke Kenneth Casson Leighton 2021-09-02 20:06:07 BST
(In reply to Jacob Lifshay from comment #3)
> (In reply to Jacob Lifshay from comment #2)
> > strided load would mean something like:
> > 
> > for(i = 0; i < VL; i++)
> >     reg[rt + i] = mem[reg[ra] + i * imm];
> 
> we will want imm to be signed

that's an immediate variant - RA(D) - which is
already covered and separate and distinct from
Indexed variant (RA + RB).

it's looking like this one's an invalid bugreport
because ffirst *indexed* was supposed to be banned,
then used for sonething else, but it cannot be
an immediate-strided instruction because there is
no immediate.

it *could* however be used for

for(i = 0; i < VL; i++)
   reg[rt + i] = mem[reg[ra] + i * reg[rb]];

as long as RB is a scalar.
Comment 5 Jacob Lifshay 2021-09-02 20:08:07 BST
(In reply to Luke Kenneth Casson Leighton from comment #4)
> 
> it *could* however be used for
> 
> for(i = 0; i < VL; i++)
>    reg[rt + i] = mem[reg[ra] + i * reg[rb]];

ah, yeah, that's what I was thinking of.
Comment 6 Luke Kenneth Casson Leighton 2021-09-02 20:53:15 BST
(In reply to Jacob Lifshay from comment #5)

> ah, yeah, that's what I was thinking of.

i can see how it'd be useful, particularly as it only
needs 2 reg reads but feeds a Vector result.  now have to come up
with a name for it, sigh.

    sv.ld/str  RT.v, RA, RB
Comment 7 Jacob Lifshay 2021-09-02 20:56:41 BST
(In reply to Luke Kenneth Casson Leighton from comment #6)
> (In reply to Jacob Lifshay from comment #5)
> 
> > ah, yeah, that's what I was thinking of.
> 
> i can see how it'd be useful, particularly as it only
> needs 2 reg reads but feeds a Vector result.  now have to come up
> with a name for it, sigh.
> 
>     sv.ld/str  RT.v, RA, RB

ld-indexed-strided