public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Don't fail on SS_ABS
@ 2009-10-16 10:26 Jie Zhang
  2009-10-16 20:44 ` Bernd Schmidt
  0 siblings, 1 reply; 5+ messages in thread
From: Jie Zhang @ 2009-10-16 10:26 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 140 bytes --]

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

[-- Attachment #2: gcc-fix-ss_abs.diff --]
[-- Type: text/x-patch, Size: 975 bytes --]


	* 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:

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-10-20  7:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-16 10:26 [PATCH] Don't fail on SS_ABS Jie Zhang
2009-10-16 20:44 ` Bernd Schmidt
2009-10-19  9:02   ` Jie Zhang
2009-10-19 23:20     ` Bernd Schmidt
2009-10-20  7:48       ` Jie Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).