diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2017-12-16 14:04:46 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2017-12-16 14:04:46 +0000 |
commit | 9adab579d59ea50eeb6877df2292d9d5c7b20e3e (patch) | |
tree | 57f653f6952ae9f50f71264350c15852415ebe51 /gcc/doc | |
parent | be4c1d4a42c5c7dc8bffbc5c9e3250f02be0d922 (diff) | |
download | gcc-9adab579d59ea50eeb6877df2292d9d5c7b20e3e.zip gcc-9adab579d59ea50eeb6877df2292d9d5c7b20e3e.tar.gz gcc-9adab579d59ea50eeb6877df2292d9d5c7b20e3e.tar.bz2 |
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.
Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r255741
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/generic.texi | 9 | ||||
-rw-r--r-- | gcc/doc/md.texi | 13 |
2 files changed, 22 insertions, 0 deletions
diff --git a/gcc/doc/generic.texi b/gcc/doc/generic.texi index 640eb3b..29d8531 100644 --- a/gcc/doc/generic.texi +++ b/gcc/doc/generic.texi @@ -1769,6 +1769,7 @@ a value from @code{enum annot_expr_kind}, the third is an @code{INTEGER_CST}. @node Vectors @subsection Vectors @tindex VEC_DUPLICATE_EXPR +@tindex VEC_SERIES_EXPR @tindex VEC_LSHIFT_EXPR @tindex VEC_RSHIFT_EXPR @tindex VEC_WIDEN_MULT_HI_EXPR @@ -1788,6 +1789,14 @@ a value from @code{enum annot_expr_kind}, the third is an @code{INTEGER_CST}. This node has a single operand and represents a vector in which every element is equal to that operand. +@item VEC_SERIES_EXPR +This node represents a vector formed from a scalar base and step, +given as the first and second operands respectively. Element @var{i} +of the result is equal to @samp{@var{base} + @var{i}*@var{step}}. + +This node is restricted to integral types, in order to avoid +specifying the rounding behavior for floating-point types. + @item VEC_LSHIFT_EXPR @itemx VEC_RSHIFT_EXPR These nodes represent whole vector left and right shifts, respectively. diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi index f9d997a..a131e59 100644 --- a/gcc/doc/md.texi +++ b/gcc/doc/md.texi @@ -4899,6 +4899,19 @@ vectors go through the @code{mov@var{m}} pattern instead. This pattern is not allowed to @code{FAIL}. +@cindex @code{vec_series@var{m}} instruction pattern +@item @samp{vec_series@var{m}} +Initialize vector output operand 0 so that element @var{i} is equal to +operand 1 plus @var{i} times operand 2. In other words, create a linear +series whose base value is operand 1 and whose step is operand 2. + +The vector output has mode @var{m} and the scalar inputs have the mode +appropriate for one element of @var{m}. This pattern is not used for +floating-point vectors, in order to avoid having to specify the +rounding behavior for @var{i} > 1. + +This pattern is not allowed to @code{FAIL}. + @cindex @code{vec_cmp@var{m}@var{n}} instruction pattern @item @samp{vec_cmp@var{m}@var{n}} Output a vector comparison. Operand 0 of mode @var{n} is the destination for |