From d083ee47a9828236016841356fc7207e7c90bbbd Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Thu, 14 Nov 2019 14:39:57 +0000 Subject: Replace mode_for_int_vector with related_int_vector_mode mode_for_int_vector, like mode_for_vector, can sometimes return an integer mode or an unsupported vector mode. But no callers are interested in that case, and only want supported vector modes. This patch therefore replaces mode_for_int_vector with related_int_vector_mode, which gives the target a chance to pick its preferred vector mode for the given element mode and size. 2019-11-14 Richard Sandiford gcc/ * machmode.h (mode_for_int_vector): Delete. (related_int_vector_mode): Declare. * stor-layout.c (mode_for_int_vector): Delete. (related_int_vector_mode): New function. * optabs.c (expand_vec_perm_1): Use related_int_vector_mode instead of mode_for_int_vector. (expand_vec_perm_const): Likewise. * config/aarch64/aarch64.c (aarch64_emit_approx_sqrt): Likewise. (aarch64_evpc_sve_tbl): Likewise. * config/s390/s390.c (s390_expand_vec_compare_cc): Likewise. (s390_expand_vcond): Likewise. From-SVN: r278230 --- gcc/optabs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'gcc/optabs.c') diff --git a/gcc/optabs.c b/gcc/optabs.c index d6701df..3c3dd9e 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -5542,7 +5542,7 @@ expand_vec_perm_1 (enum insn_code icode, rtx target, class expand_operand ops[4]; gcc_assert (GET_MODE_CLASS (smode) == MODE_VECTOR_INT - || mode_for_int_vector (tmode).require () == smode); + || related_int_vector_mode (tmode).require () == smode); create_output_operand (&ops[0], target, tmode); create_input_operand (&ops[3], sel, smode); @@ -5679,8 +5679,7 @@ expand_vec_perm_const (machine_mode mode, rtx v0, rtx v1, /* The optabs are only defined for selectors with the same width as the values being permuted. */ machine_mode required_sel_mode; - if (!mode_for_int_vector (mode).exists (&required_sel_mode) - || !VECTOR_MODE_P (required_sel_mode)) + if (!related_int_vector_mode (mode).exists (&required_sel_mode)) { delete_insns_since (last); return NULL_RTX; -- cgit v1.1