On Thu, Jun 5, 2025 at 4:44 PM Robin Dapp <rdapp....@gmail.com> wrote:
>
> >> But that would not pass the alignment check either, no?  In fact, I assume
> >> that for strided loads we have a scalar type as component (ptype), so we
> >> always get supported unaligned accesses here?
>
> > Perhaps I'm missing something, though.
>
> What I was missing is that we're using the same element size for vect-vect and
> strided.  So no alignment fallback necessary.
>
> IMHO we can get unaligned accesses, though.

For vector components we check whether the target can handle those, for
scalar accesses we simply do those (with appropriately un-aligned MEM_ALIGN).
RTL expansion will fixup in case of STRICT_ALIGNMENT (so that might be a
pessimization we fail to take into account).

In case the riscv strided vector load instruction has additional requirements
on the loaded (scalar) element alignment then we'd have to implement this.
For the moment the vectorizer will really emit scalar loads here, so that's
fine (though eventually inefficient).  For the strided vector load there should
be an alignment argument specifying element alignment, like we have for
.MASK_LOAD, etc.

Richard.

>
> --
> Regards
>  Robin
>

Reply via email to