aboutsummaryrefslogtreecommitdiff
path: root/gcc/optabs.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2018-01-03 08:59:18 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2018-01-03 08:59:18 +0000
commit6b0630fbe8c34255f2739f63a8d3e5b636020bf4 (patch)
treee12d59269ca650f27b7141a5e825d503877ad63c /gcc/optabs.c
parent9f61be58cec631ded93e6b71940dacd14ce3f3f5 (diff)
downloadgcc-6b0630fbe8c34255f2739f63a8d3e5b636020bf4.zip
gcc-6b0630fbe8c34255f2739f63a8d3e5b636020bf4.tar.gz
gcc-6b0630fbe8c34255f2739f63a8d3e5b636020bf4.tar.bz2
poly_int: vec_perm_indices element type
This patch changes the vec_perm_indices element type from HOST_WIDE_INT to poly_int64, so that it can represent indices into a variable-length vector. 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org> gcc/ * vec-perm-indices.h (vec_perm_builder): Change element type from HOST_WIDE_INT to poly_int64. (vec_perm_indices::element_type): Update accordingly. (vec_perm_indices::clamp): Handle polynomial element_types. * vec-perm-indices.c (vec_perm_indices::series_p): Likewise. (vec_perm_indices::all_in_range_p): Likewise. (tree_to_vec_perm_builder): Check for poly_int64 trees rather than shwi trees. * vector-builder.h (vector_builder::stepped_sequence_p): Handle polynomial vec_perm_indices element types. * int-vector-builder.h (int_vector_builder::equal_p): Likewise. * fold-const.c (fold_vec_perm): Likewise. * optabs.c (shift_amt_for_vec_perm_mask): Likewise. * tree-vect-generic.c (lower_vec_perm): Likewise. * tree-vect-slp.c (vect_transform_slp_perm_load): Likewise. * config/aarch64/aarch64.c (aarch64_evpc_tbl): Cast d->perm element type to HOST_WIDE_INT. From-SVN: r256164
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r--gcc/optabs.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c
index c3ee454..5706205 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -5398,16 +5398,18 @@ shift_amt_for_vec_perm_mask (machine_mode mode, const vec_perm_indices &sel)
{
unsigned int nelt = GET_MODE_NUNITS (mode);
unsigned int bitsize = GET_MODE_UNIT_BITSIZE (mode);
- unsigned int first = sel[0];
- if (first >= nelt)
+ poly_int64 first = sel[0];
+ if (maybe_ge (sel[0], nelt))
return NULL_RTX;
if (!sel.series_p (0, 1, first, 1))
for (unsigned int i = 1; i < nelt; i++)
{
- unsigned int expected = i + first;
+ poly_int64 expected = i + first;
/* Indices into the second vector are all equivalent. */
- if (MIN (nelt, sel[i]) != MIN (nelt, expected))
+ if (maybe_lt (sel[i], nelt)
+ ? maybe_ne (sel[i], expected)
+ : maybe_lt (expected, nelt))
return NULL_RTX;
}