aboutsummaryrefslogtreecommitdiff
path: root/libphobos
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2020-04-07 14:39:24 +0200
committerJakub Jelinek <jakub@redhat.com>2020-04-07 14:39:24 +0200
commitd51af82b4cf4c95c4a7451df2180cc6ebb44856b (patch)
tree83cf14d47f41bf298b86f5e1d8960ede45a9ee9d /libphobos
parent4df50a059fbd4d4a1cb067bd43caccdfca0327a8 (diff)
downloadgcc-d51af82b4cf4c95c4a7451df2180cc6ebb44856b.zip
gcc-d51af82b4cf4c95c4a7451df2180cc6ebb44856b.tar.gz
gcc-d51af82b4cf4c95c4a7451df2180cc6ebb44856b.tar.bz2
i386: Fix V{64QI,32HI}mode constant permutations [PR94509]
The following testcases are miscompiled, because expand_vec_perm_pshufb incorrectly thinks it can use vpshufb instruction for the permutations when it can't. The if (vmode == V32QImode) { /* vpshufb only works intra lanes, it is not possible to shuffle bytes in between the lanes. */ for (i = 0; i < nelt; ++i) if ((d->perm[i] ^ i) & (nelt / 2)) return false; } intra-lane check which is correct has been copied and adjusted for 64-byte modes into: if (vmode == V64QImode) { /* vpshufb only works intra lanes, it is not possible to shuffle bytes in between the lanes. */ for (i = 0; i < nelt; ++i) if ((d->perm[i] ^ i) & (nelt / 4)) return false; } which is not correct, because 64-byte modes have 4 lanes rather than just two and the above is only testing that the permutation grabs even lane elts from even lanes and odd lane elts from odd lanes, but not that they are from the same 256-bit half. The following patch fixes it by using 3 * nelt / 4 instead of nelt / 4, so we actually check the most significant 2 bits rather than just one. 2020-04-07 Jakub Jelinek <jakub@redhat.com> PR target/94509 * config/i386/i386-expand.c (expand_vec_perm_pshufb): Fix the check for inter-lane permutation for 64-byte modes. * gcc.target/i386/avx512bw-pr94509-1.c: New test. * gcc.target/i386/avx512bw-pr94509-2.c: New test.
Diffstat (limited to 'libphobos')
0 files changed, 0 insertions, 0 deletions