aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorCong Hou <congh@google.com>2014-06-24 22:58:43 -0400
committerCong Hou <congh@gcc.gnu.org>2014-06-24 22:58:43 -0400
commit79d652a570805345efea0ee370c0f7f07eada78c (patch)
tree84fbd0fced8d4e426b96dfd6edf4dfa423455a70 /gcc/doc
parent22543f17af2e2f04ab57d7fc9bfed94da90345ba (diff)
downloadgcc-79d652a570805345efea0ee370c0f7f07eada78c.zip
gcc-79d652a570805345efea0ee370c0f7f07eada78c.tar.gz
gcc-79d652a570805345efea0ee370c0f7f07eada78c.tar.bz2
tree-vect-patterns.c (vect_recog_sad_pattern): New function for SAD pattern recognition.
2014-06-24 Cong Hou <congh@google.com> * tree-vect-patterns.c (vect_recog_sad_pattern): New function for SAD pattern recognition. (type_conversion_p): PROMOTION is true if it's a type promotion conversion, and false otherwise. Return true if the given expression is a type conversion one. * tree-vectorizer.h: Adjust the number of patterns. * tree.def: Add SAD_EXPR. * optabs.def: Add sad_optab. * cfgexpand.c (expand_debug_expr): Add SAD_EXPR case. * expr.c (expand_expr_real_2): Likewise. * gimple-pretty-print.c (dump_ternary_rhs): Likewise. * gimple.c (get_gimple_rhs_num_ops): Likewise. * optabs.c (optab_for_tree_code): Likewise. * tree-cfg.c (estimate_operator_cost): Likewise. * tree-ssa-operands.c (get_expr_operands): Likewise. * tree-vect-loop.c (get_initial_def_for_reduction): Likewise. * config/i386/sse.md: Add SSE2 and AVX2 expand for SAD. * doc/generic.texi: Add document for SAD_EXPR. * doc/md.texi: Add document for ssad and usad. 2014-06-24 Cong Hou <congh@google.com> * gcc.dg/vect/vect-reduc-sad.c: New. * lib/target-supports.exp (check_effective_target_vect_usad_char): New. From-SVN: r211966
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/generic.texi10
-rw-r--r--gcc/doc/md.texi10
2 files changed, 20 insertions, 0 deletions
diff --git a/gcc/doc/generic.texi b/gcc/doc/generic.texi
index 7afb055..4476f28 100644
--- a/gcc/doc/generic.texi
+++ b/gcc/doc/generic.texi
@@ -1702,6 +1702,7 @@ a value from @code{enum annot_expr_kind}.
@tindex VEC_PACK_TRUNC_EXPR
@tindex VEC_PACK_SAT_EXPR
@tindex VEC_PACK_FIX_TRUNC_EXPR
+@tindex SAD_EXPR
@table @code
@item VEC_LSHIFT_EXPR
@@ -1782,6 +1783,15 @@ value, it is taken from the second operand. It should never evaluate to
any other value currently, but optimizations should not rely on that
property. In contrast with a @code{COND_EXPR}, all operands are always
evaluated.
+
+@item SAD_EXPR
+This node represents the Sum of Absolute Differences operation. The three
+operands must be vectors of integral types. The first and second operand
+must have the same type. The size of the vector element of the third
+operand must be at lease twice of the size of the vector element of the
+first and second one. The SAD is calculated between the first and second
+operands, added to the third operand, and returned.
+
@end table
diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi
index 1c3a326..539865e 100644
--- a/gcc/doc/md.texi
+++ b/gcc/doc/md.texi
@@ -4842,6 +4842,16 @@ wider mode, is computed and added to operand 3. Operand 3 is of a mode equal or
wider than the mode of the product. The result is placed in operand 0, which
is of the same mode as operand 3.
+@cindex @code{ssad@var{m}} instruction pattern
+@item @samp{ssad@var{m}}
+@cindex @code{usad@var{m}} instruction pattern
+@item @samp{usad@var{m}}
+Compute the sum of absolute differences of two signed/unsigned elements.
+Operand 1 and operand 2 are of the same mode. Their absolute difference, which
+is of a wider mode, is computed and added to operand 3. Operand 3 is of a mode
+equal or wider than the mode of the absolute difference. The result is placed
+in operand 0, which is of the same mode as operand 3.
+
@cindex @code{ssum_widen@var{m3}} instruction pattern
@item @samp{ssum_widen@var{m3}}
@cindex @code{usum_widen@var{m3}} instruction pattern