diff options
author | Andrew Stubbs <ams@baylibre.com> | 2024-06-28 10:47:50 +0000 |
---|---|---|
committer | Andrew Stubbs <ams@baylibre.com> | 2024-06-28 11:08:37 +0000 |
commit | ef0b30212f7756db15d7507bfd871bf377d7d648 (patch) | |
tree | a0620ca7fcefde0fa7e2f6a3a4bc4660b3dc87a8 /gcc/config/gcn | |
parent | aa3599a10cab34104c0b9bd6951c5f0c420795d8 (diff) | |
download | gcc-ef0b30212f7756db15d7507bfd871bf377d7d648.zip gcc-ef0b30212f7756db15d7507bfd871bf377d7d648.tar.gz gcc-ef0b30212f7756db15d7507bfd871bf377d7d648.tar.bz2 |
amdgcn: Fix RDNA V32 permutations [PR115640]
There was an off-by-one error in the RDNA validation check, plus I forgot to
allow for two-to-one permute-and-merge operations.
PR target/115640
gcc/ChangeLog:
* config/gcn/gcn.cc (gcn_vectorize_vec_perm_const): Modify RDNA checks.
Diffstat (limited to 'gcc/config/gcn')
-rw-r--r-- | gcc/config/gcn/gcn.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/config/gcn/gcn.cc b/gcc/config/gcn/gcn.cc index d6531f5..aab9b59 100644 --- a/gcc/config/gcn/gcn.cc +++ b/gcc/config/gcn/gcn.cc @@ -5134,7 +5134,7 @@ gcn_vectorize_vec_perm_const (machine_mode vmode, machine_mode op_mode, Reject permutations that cross the boundary. */ if (TARGET_RDNA2_PLUS) for (unsigned int i = 0; i < nelt; i++) - if (i < 31 ? perm[i] > 31 : perm[i] < 32) + if (i < 32 ? (perm[i] % nelt) > 31 : (perm[i] % nelt) < 32) return false; /* All vector permutations are possible on other architectures, |