From: Andrew Stubbs Date: Fri, 28 Jun 2024 10:47:50 +0000 (+0000) Subject: amdgcn: Fix RDNA V32 permutations [PR115640] X-Git-Tag: basepoints/gcc-16~7848 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef0b30212f7756db15d7507bfd871bf377d7d648;p=thirdparty%2Fgcc.git 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. --- diff --git a/gcc/config/gcn/gcn.cc b/gcc/config/gcn/gcn.cc index d6531f55190..aab9b59c519 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,