At least on aarch64, the gathers and scatters use (mem:BLK (scratch:P)),
i.e. a wildcard memory access.  There's no good way in RTL to represent
multiplie distinct locations in a single reference.

(unspec on its own doesn't imply a memory access)

At first I thought if we only cared about element misalignment checking the first element/pointer should be sufficient. But riscv's gathers as well as strided loads allow byte offsets rather than element-sized offsets so there could be 16-bit loads with a stride of e.g. 1 byte.

How would we query the target on whether it can handle the alignment
here?

I think for gathers, STRICT_ALIGNMENT rules apply: if STRICT_ALIGNMENT
is true then each scalar element must be aligned to its size, otherwise
the elements can be misaligned.

On riscv we can have separate strict-alignment values for scalar and vector.
A uarch can theoretically allow (element-)misaligned vector accesses but not scalar ones.

--
Regards
Robin

Reply via email to