This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Don't fail on SS_ABS
- From: Jie Zhang <jie dot zhang at analog dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 16 Oct 2009 18:23:54 +0800
- Subject: [PATCH] Don't fail on SS_ABS
SS_ABS is not handled in simplify_const_unary_operation and ss_abs is
not documented. This patch fixes these. Is it OK for mainline?
Jie
* simplify-rtx.c (simplify_const_unary_operation): Handle
SS_ABS.
* doc/rtl.texi: Document ss_abs.
Index: doc/rtl.texi
===================================================================
--- doc/rtl.texi (revision 152895)
+++ doc/rtl.texi (working copy)
@@ -2364,9 +2364,14 @@ Similar but represent left and right rot
use @code{rotate}.
@findex abs
+@findex ss_abs
@cindex absolute value
@item (abs:@var{m} @var{x})
+@item (ss_abs:@var{m} @var{x})
Represents the absolute value of @var{x}, computed in mode @var{m}.
+@code{ss_abs} ensures that an out-of-bounds result saturates to the
+maximum signed value.
+
@findex sqrt
@cindex square root
Index: simplify-rtx.c
===================================================================
--- simplify-rtx.c (revision 152895)
+++ simplify-rtx.c (working copy)
@@ -1245,6 +1245,7 @@ simplify_const_unary_operation (enum rtx
case US_TRUNCATE:
case SS_NEG:
case US_NEG:
+ case SS_ABS:
return 0;
default: