From f39b92e2c485be81ec154d2986495305d5926688 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Mon, 25 Sep 2017 13:26:12 +0000 Subject: [PATCH] Change permute index type to unsigned short This patch changes the element type of (auto_)vec_perm_indices from unsigned char to unsigned short. This is needed for fixed-length 2048-bit SVE. (SVE is variable-length by default, but it's possible to ask for specific vector lengths if you want to.) 2017-09-25 Richard Sandiford gcc/ * target.h (vec_perm_indices): Use unsigned short rather than unsigned char. (auto_vec_perm_indices): Likewise. * config/aarch64/aarch64.c (aarch64_vectorize_vec_perm_const_ok): Use unsigned int rather than unsigned char. * config/arm/arm.c (arm_vectorize_vec_perm_const_ok): Likewise. From-SVN: r253150 --- gcc/ChangeLog | 9 +++++++++ gcc/config/aarch64/aarch64.c | 2 +- gcc/config/arm/arm.c | 2 +- gcc/target.h | 4 ++-- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f4060b103bf..b53da5390d5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2017-09-25 Richard Sandiford + + * target.h (vec_perm_indices): Use unsigned short rather than + unsigned char. + (auto_vec_perm_indices): Likewise. + * config/aarch64/aarch64.c (aarch64_vectorize_vec_perm_const_ok): + Use unsigned int rather than unsigned char. + * config/arm/arm.c (arm_vectorize_vec_perm_const_ok): Likewise. + 2017-09-25 Richard Biener * cfgloop.h (sort_sibling_loops): Declare. diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index f38540b396a..9b02c6e85e4 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -13820,7 +13820,7 @@ aarch64_vectorize_vec_perm_const_ok (machine_mode vmode, vec_perm_indices sel) nelt = sel.length (); for (i = which = 0; i < nelt; ++i) { - unsigned char e = d.perm[i]; + unsigned int e = d.perm[i]; gcc_assert (e < 2 * nelt); which |= (e < nelt ? 1 : 2); } diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 3671616cfa7..f9c1ce35f37 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -29261,7 +29261,7 @@ arm_vectorize_vec_perm_const_ok (machine_mode vmode, vec_perm_indices sel) nelt = GET_MODE_NUNITS (d.vmode); for (i = which = 0; i < nelt; ++i) { - unsigned char e = d.perm[i]; + unsigned int e = d.perm[i]; gcc_assert (e < 2 * nelt); which |= (e < nelt ? 1 : 2); } diff --git a/gcc/target.h b/gcc/target.h index 64e1d68f0e0..ac43b16a549 100644 --- a/gcc/target.h +++ b/gcc/target.h @@ -193,11 +193,11 @@ enum vect_cost_model_location { /* The type to use for vector permutes with a constant permute vector. Each entry is an index into the concatenated input vectors. */ -typedef vec vec_perm_indices; +typedef vec vec_perm_indices; /* Same, but can be used to construct local permute vectors that are automatically freed. */ -typedef auto_vec auto_vec_perm_indices; +typedef auto_vec auto_vec_perm_indices; /* The target structure. This holds all the backend hooks. */ #define DEFHOOKPOD(NAME, DOC, TYPE, INIT) TYPE NAME; -- 2.30.2