]> git.ipfire.org Git - thirdparty/gcc.git/commit
amdgcn: Remove vector alignment restrictions
authorAndrew Stubbs <ams@baylibre.com>
Wed, 24 Sep 2025 11:58:23 +0000 (11:58 +0000)
committerAndrew Stubbs <ams@baylibre.com>
Fri, 26 Sep 2025 11:23:06 +0000 (11:23 +0000)
commitfdc8037a592901a47fee51484a4830643f25aea7
treec2278d9c28561f3f760bfd963ab3cc8b8d766b62
parent1b876bdffd875ce061b35c7bb73f76a9bf7ec9f2
amdgcn: Remove vector alignment restrictions

The supported misalignment logic seems to be a bit arbitrary.  Some of it looks
like it was copied from the Arm implementation, although testing shows that the
packed accesses do not work (weird subregs happen).

AMD GCN does have some alignment restrictions on Buffer instructions, but as we
don't use those that's irrelvant.  The Flat and Global instructions (that we do
use) have no such restrictions.

LDS memory -- which can be accessed via Flat instructions -- does have
alignment restrictions, but the compiler is not using LDS for arbitrary
vectors.  If the user deliberately choses to place unaligned data in
low-latency memory then a runtime exception should occur (no silent bad
behaviour), so there's no reason to pessimise the normal case.

gcc/ChangeLog:

* config/gcn/gcn.cc
(gcn_vectorize_support_vector_misalignment): Allow any alignment, as
long as it's not packed.
gcc/config/gcn/gcn.cc