aboutsummaryrefslogtreecommitdiff
path: root/gcc/optabs-query.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/optabs-query.c')
-rw-r--r--gcc/optabs-query.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/gcc/optabs-query.c b/gcc/optabs-query.c
index 81b1bd9..ced6f57 100644
--- a/gcc/optabs-query.c
+++ b/gcc/optabs-query.c
@@ -353,8 +353,7 @@ can_conditionally_move_p (machine_mode mode)
zeroes; this case is not dealt with here. */
bool
-can_vec_perm_p (machine_mode mode, bool variable,
- const unsigned char *sel)
+can_vec_perm_p (machine_mode mode, bool variable, vec_perm_indices *sel)
{
machine_mode qimode;
@@ -368,7 +367,7 @@ can_vec_perm_p (machine_mode mode, bool variable,
if (direct_optab_handler (vec_perm_const_optab, mode) != CODE_FOR_nothing
&& (sel == NULL
|| targetm.vectorize.vec_perm_const_ok == NULL
- || targetm.vectorize.vec_perm_const_ok (mode, sel)))
+ || targetm.vectorize.vec_perm_const_ok (mode, &(*sel)[0])))
return true;
}
@@ -460,7 +459,6 @@ int
can_mult_highpart_p (machine_mode mode, bool uns_p)
{
optab op;
- unsigned char *sel;
unsigned i, nunits;
op = uns_p ? umul_highpart_optab : smul_highpart_optab;
@@ -472,7 +470,6 @@ can_mult_highpart_p (machine_mode mode, bool uns_p)
return 0;
nunits = GET_MODE_NUNITS (mode);
- sel = XALLOCAVEC (unsigned char, nunits);
op = uns_p ? vec_widen_umult_even_optab : vec_widen_smult_even_optab;
if (optab_handler (op, mode) != CODE_FOR_nothing)
@@ -480,9 +477,12 @@ can_mult_highpart_p (machine_mode mode, bool uns_p)
op = uns_p ? vec_widen_umult_odd_optab : vec_widen_smult_odd_optab;
if (optab_handler (op, mode) != CODE_FOR_nothing)
{
+ auto_vec_perm_indices sel (nunits);
for (i = 0; i < nunits; ++i)
- sel[i] = !BYTES_BIG_ENDIAN + (i & ~1) + ((i & 1) ? nunits : 0);
- if (can_vec_perm_p (mode, false, sel))
+ sel.quick_push (!BYTES_BIG_ENDIAN
+ + (i & ~1)
+ + ((i & 1) ? nunits : 0));
+ if (can_vec_perm_p (mode, false, &sel))
return 2;
}
}
@@ -493,9 +493,10 @@ can_mult_highpart_p (machine_mode mode, bool uns_p)
op = uns_p ? vec_widen_umult_lo_optab : vec_widen_smult_lo_optab;
if (optab_handler (op, mode) != CODE_FOR_nothing)
{
+ auto_vec_perm_indices sel (nunits);
for (i = 0; i < nunits; ++i)
- sel[i] = 2 * i + (BYTES_BIG_ENDIAN ? 0 : 1);
- if (can_vec_perm_p (mode, false, sel))
+ sel.quick_push (2 * i + (BYTES_BIG_ENDIAN ? 0 : 1));
+ if (can_vec_perm_p (mode, false, &sel))
return 3;
}
}