aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2021-06-11 12:31:42 +0200
committerUros Bizjak <ubizjak@gmail.com>2021-06-11 12:32:40 +0200
commit1fa991d1d74cb1ce96c48ede70ae0be7a9683ce3 (patch)
treebc1ea9b598c736fa30bcd1faab10c94018a8ec09 /gcc/fold-const.c
parent8bf728aecc4fea46b4490e950b9ae229f90597b0 (diff)
downloadgcc-1fa991d1d74cb1ce96c48ede70ae0be7a9683ce3.zip
gcc-1fa991d1d74cb1ce96c48ede70ae0be7a9683ce3.tar.gz
gcc-1fa991d1d74cb1ce96c48ede70ae0be7a9683ce3.tar.bz2
i386: Try to avoid variable permutation instruction [PR101021]
Some permutations can be implemented without costly PSHUFB instruction, e.g.: { 8,9,10,11,12,13,14,15, 0,1,2,3,4,5,6,7 } with PALIGNR, { 0,1,2,3, 4,5,6,7, 4,5,6,7, 12,13,14,15 } with PSHUFD, { 0,1, 2,3, 2,3, 6,7, 8,9,10,11,12,13,14,15 } with PSHUFLW and { 0,1,2,3,4,5,6,7, 8,9, 10,11, 10,11, 14,15 } with PSHUFHW. All these instructions have constant shuffle control mask and do not need to load shuffle mask from a memory to a temporary XMM register. 2021-06-11 Uroš Bizjak <ubizjak@gmail.com> gcc/ PR target/101021 * config/i386/i386-expand.c (expand_vec_perm_pshufb): Return false if the permutation can be implemented with constant permutation instruction in wider mode. (canonicalize_vector_int_perm): Move above expand_vec_perm_pshufb. Handle V8QImode and V4HImode. gcc/testsuite/ PR target/101021 * gcc.target/i386/pr101021-1.c: New test. * gcc.target/i386/pr101021-2.c: Ditto.
Diffstat (limited to 'gcc/fold-const.c')
0 files changed, 0 insertions, 0 deletions