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.
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,