diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2018-01-02 18:28:06 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2018-01-02 18:28:06 +0000 |
commit | 3d8ca53dd9b4c42b07ef974f92c3c4553cce3a79 (patch) | |
tree | a24895a3e9e27d5d1711474f8246f92559d37b64 /gcc/optabs.c | |
parent | 3877c560656f4961cc50952c3bba3c40812c36c3 (diff) | |
download | gcc-3d8ca53dd9b4c42b07ef974f92c3c4553cce3a79.zip gcc-3d8ca53dd9b4c42b07ef974f92c3c4553cce3a79.tar.gz gcc-3d8ca53dd9b4c42b07ef974f92c3c4553cce3a79.tar.bz2 |
Make more use of rtx_vector_builder
This patch makes various bits of CONST_VECTOR-building code use
rtx_vector_builder, operating directly on a specific encoding.
2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
gcc/
* expr.c: Include rtx-vector-builder.h.
(const_vector_mask_from_tree): Use rtx_vector_builder and operate
directly on the tree encoding.
(const_vector_from_tree): Likewise.
* optabs.c: Include rtx-vector-builder.h.
(expand_vec_perm_var): Use rtx_vector_builder and create a repeating
sequence of "u" values.
* vec-perm-indices.c: Include rtx-vector-builder.h.
(vec_perm_indices_to_rtx): Use rtx_vector_builder and operate
directly on the vec_perm_indices encoding.
From-SVN: r256103
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r-- | gcc/optabs.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c index dcd94cd..c3ee454 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see #include "emit-rtl.h" #include "recog.h" #include "diagnostic-core.h" +#include "rtx-vector-builder.h" /* Include insn-config.h before expr.h so that HAVE_conditional_move is properly defined. */ @@ -5609,7 +5610,6 @@ expand_vec_perm_var (machine_mode mode, rtx v0, rtx v1, rtx sel, rtx target) enum insn_code icode; unsigned int i, w, u; rtx tmp, sel_qi; - rtvec vec; w = GET_MODE_SIZE (mode); u = GET_MODE_UNIT_SIZE (mode); @@ -5661,10 +5661,10 @@ expand_vec_perm_var (machine_mode mode, rtx v0, rtx v1, rtx sel, rtx target) /* Add the byte offset to each byte element. */ /* Note that the definition of the indicies here is memory ordering, so there should be no difference between big and little endian. */ - vec = rtvec_alloc (w); - for (i = 0; i < w; ++i) - RTVEC_ELT (vec, i) = GEN_INT (i % u); - tmp = gen_rtx_CONST_VECTOR (qimode, vec); + rtx_vector_builder byte_indices (qimode, u, 1); + for (i = 0; i < u; ++i) + byte_indices.quick_push (GEN_INT (i)); + tmp = byte_indices.build (); sel_qi = expand_simple_binop (qimode, PLUS, sel, tmp, sel, 0, OPTAB_DIRECT); gcc_assert (sel_qi != NULL); |