summaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2017-12-16 14:04:46 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2017-12-16 14:04:46 +0000
commit7ed29fa20c8e86d23ea1daf88d7f36cd8935104d (patch)
tree57f653f6952ae9f50f71264350c15852415ebe51 /gcc/fold-const.c
parenta308fcf89a1ed087810b626b97300990a8f9d115 (diff)
downloadgcc-7ed29fa20c8e86d23ea1daf88d7f36cd8935104d.tar.gz
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 <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255741 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 6ce9ea111a0..2a08010d145 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -1526,6 +1526,12 @@ const_binop (enum tree_code code, tree type, tree arg1, tree arg2)
result as argument put those cases that need it here. */
switch (code)
{
+ case VEC_SERIES_EXPR:
+ if (CONSTANT_CLASS_P (arg1)
+ && CONSTANT_CLASS_P (arg2))
+ return build_vec_series (type, arg1, arg2);
+ return NULL_TREE;
+
case COMPLEX_EXPR:
if ((TREE_CODE (arg1) == REAL_CST
&& TREE_CODE (arg2) == REAL_CST)