aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc/md.texi
diff options
context:
space:
mode:
authorOluwatamilore Adebayo <oluwatamilore.adebayo@arm.com>2023-06-15 07:36:48 +0100
committerRichard Sandiford <richard.sandiford@arm.com>2023-06-15 07:36:48 +0100
commit710b8dec61a73cbbf5dadbdd2070a85e690e8184 (patch)
tree2add3b812d5bff97cd4ad1a36dced05070d1d6d1 /gcc/doc/md.texi
parent6cf8989c6e63ef07b0516d19ce86bbe921f1a485 (diff)
downloadgcc-710b8dec61a73cbbf5dadbdd2070a85e690e8184.zip
gcc-710b8dec61a73cbbf5dadbdd2070a85e690e8184.tar.gz
gcc-710b8dec61a73cbbf5dadbdd2070a85e690e8184.tar.bz2
Missed opportunity to use [SU]ABD
This adds a recognition pattern for the non-widening absolute difference (ABD). gcc/ChangeLog: * doc/md.texi (sabd, uabd): Document them. * internal-fn.def (ABD): Use new optab. * optabs.def (sabd_optab, uabd_optab): New optabs, * tree-vect-patterns.cc (vect_recog_absolute_difference): Recognize the following idiom abs (a - b). (vect_recog_sad_pattern): Refactor to use vect_recog_absolute_difference. (vect_recog_abd_pattern): Use patterns found by vect_recog_absolute_difference to build a new ABD internal call.
Diffstat (limited to 'gcc/doc/md.texi')
-rw-r--r--gcc/doc/md.texi10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi
index 95f7fe1..4490507 100644
--- a/gcc/doc/md.texi
+++ b/gcc/doc/md.texi
@@ -5809,6 +5809,16 @@ Other shift and rotate instructions, analogous to the
Vector shift and rotate instructions that take vectors as operand 2
instead of a scalar type.
+@cindex @code{uabd@var{m}} instruction pattern
+@cindex @code{sabd@var{m}} instruction pattern
+@item @samp{uabd@var{m}}, @samp{sabd@var{m}}
+Signed and unsigned absolute difference instructions. These
+instructions find the difference between operands 1 and 2
+then return the absolute value. A C code equivalent would be:
+@smallexample
+op0 = op1 > op2 ? op1 - op2 : op2 - op1;
+@end smallexample
+
@cindex @code{avg@var{m}3_floor} instruction pattern
@cindex @code{uavg@var{m}3_floor} instruction pattern
@item @samp{avg@var{m}3_floor}