aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2018-01-02 18:27:05 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2018-01-02 18:27:05 +0000
commitd980067b1e9394b2b8482b3fc888ac5e8e3ebe59 (patch)
treeebde117c5d31c80df9b86ffd24c029b7dfc3f5db /gcc/tree-vect-loop.c
parent736d0f28783f12fa042892bc186866dd5101088f (diff)
downloadgcc-d980067b1e9394b2b8482b3fc888ac5e8e3ebe59.zip
gcc-d980067b1e9394b2b8482b3fc888ac5e8e3ebe59.tar.gz
gcc-d980067b1e9394b2b8482b3fc888ac5e8e3ebe59.tar.bz2
Use explicit encodings for simple permutes
This patch makes users of vec_perm_builders use the compressed encoding where possible. This means that they work with variable-length vectors. 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org> gcc/ * optabs.c (expand_vec_perm_var): Use an explicit encoding for the broadcast of the low byte. (expand_mult_highpart): Use an explicit encoding for the permutes. * optabs-query.c (can_mult_highpart_p): Likewise. * tree-vect-loop.c (calc_vec_perm_mask_for_shift): Likewise. * tree-vect-stmts.c (perm_mask_for_reverse): Likewise. (vectorizable_bswap): Likewise. * tree-vect-data-refs.c (vect_grouped_store_supported): Use an explicit encoding for the power-of-2 permutes. (vect_permute_store_chain): Likewise. (vect_grouped_load_supported): Likewise. (vect_permute_load_chain): Likewise. From-SVN: r256097
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r--gcc/tree-vect-loop.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index fa33c7d..31a396b 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -3715,8 +3715,10 @@ static void
calc_vec_perm_mask_for_shift (unsigned int offset, unsigned int nelt,
vec_perm_builder *sel)
{
- sel->new_vector (nelt, nelt, 1);
- for (unsigned int i = 0; i < nelt; i++)
+ /* The encoding is a single stepped pattern. Any wrap-around is handled
+ by vec_perm_indices. */
+ sel->new_vector (nelt, 1, 3);
+ for (unsigned int i = 0; i < 3; i++)
sel->quick_push (i + offset);
}