From 9adab579d59ea50eeb6877df2292d9d5c7b20e3e Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Sat, 16 Dec 2017 14:04:46 +0000 Subject: Add VEC_SERIES_EXPR and associated optab Similarly to the VEC_DUPLICATE_EXPR, this patch adds a tree code equivalent of the VEC_SERIES rtx code: VEC_SERIES_EXPR. 2017-12-16 Richard Sandiford Alan Hayward David Sherwood gcc/ * doc/generic.texi (VEC_SERIES_EXPR): Document. * doc/md.texi (vec_series@var{m}): Document. * tree.def (VEC_SERIES_EXPR): New tree code. * tree.h (build_vec_series): Declare. * tree.c (build_vec_series): New function. * cfgexpand.c (expand_debug_expr): Handle VEC_SERIES_EXPR. * tree-pretty-print.c (dump_generic_node): Likewise. * gimple-pretty-print.c (dump_binary_rhs): Likewise. * tree-inline.c (estimate_operator_cost): Likewise. * expr.c (expand_expr_real_2): Likewise. * optabs-tree.c (optab_for_tree_code): Likewise. * tree-cfg.c (verify_gimple_assign_binary): Likewise. * fold-const.c (const_binop): Fold VEC_SERIES_EXPRs of constants. * expmed.c (make_tree): Handle VEC_SERIES. * optabs.def (vec_series_optab): New optab. * optabs.h (expand_vec_series_expr): Declare. * optabs.c (expand_vec_series_expr): New function. * tree-vect-generic.c (expand_vector_operations_1): Check that the operands also have vector type. Co-Authored-By: Alan Hayward Co-Authored-By: David Sherwood From-SVN: r255741 --- gcc/expmed.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gcc/expmed.c') diff --git a/gcc/expmed.c b/gcc/expmed.c index f072a94..5884560 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -5255,6 +5255,13 @@ make_tree (tree type, rtx x) tree elt_tree = make_tree (TREE_TYPE (type), XEXP (op, 0)); return build_vector_from_val (type, elt_tree); } + if (GET_CODE (op) == VEC_SERIES) + { + tree itype = TREE_TYPE (type); + tree base_tree = make_tree (itype, XEXP (op, 0)); + tree step_tree = make_tree (itype, XEXP (op, 1)); + return build_vec_series (type, base_tree, step_tree); + } return make_tree (type, op); } -- cgit v1.1