* [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
* Re: [PATCH] Don't fail on SS_ABS
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
0 siblings, 1 reply; 5+ messages in thread
From: Bernd Schmidt @ 2009-10-16 20:44 UTC (permalink / raw)
To: Jie Zhang; +Cc: GCC Patches
Jie Zhang wrote:
> 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?
> +@code{ss_abs} ensures that an out-of-bounds result saturates to the
> +maximum signed value.
> +
Maybe clarify that as "maximum positive number representable as a signed
value"? Otherwise ok.
Bernd
--
This footer brought to you by insane German lawmakers.
Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen
Sitz der Gesellschaft Muenchen, Registergericht Muenchen HRB 40368
Geschaeftsfuehrer Thomas Wessel, William A. Martin, Margaret Seif
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Don't fail on SS_ABS
2009-10-16 20:44 ` Bernd Schmidt
@ 2009-10-19 9:02 ` Jie Zhang
2009-10-19 23:20 ` Bernd Schmidt
0 siblings, 1 reply; 5+ messages in thread
From: Jie Zhang @ 2009-10-19 9:02 UTC (permalink / raw)
To: Bernd Schmidt; +Cc: GCC Patches
Hi Bernd,
Bernd Schmidt wrote:
> Jie Zhang wrote:
>> 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?
>
>> +@code{ss_abs} ensures that an out-of-bounds result saturates to the
>> +maximum signed value.
>> +
>
> Maybe clarify that as "maximum positive number representable as a signed
> value"? Otherwise ok.
>
But "maximum signed value" is the same meaning of "maximum positive
number representable as a signed value", isn't? I prefer the former,
which is simple and short. Is it OK if I commit the original patch?
Jie
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Don't fail on SS_ABS
2009-10-19 9:02 ` Jie Zhang
@ 2009-10-19 23:20 ` Bernd Schmidt
2009-10-20 7:48 ` Jie Zhang
0 siblings, 1 reply; 5+ messages in thread
From: Bernd Schmidt @ 2009-10-19 23:20 UTC (permalink / raw)
To: Jie Zhang; +Cc: GCC Patches
Jie Zhang wrote:
> Hi Bernd,
>
> Bernd Schmidt wrote:
>> Jie Zhang wrote:
>>> 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?
>>
>>> +@code{ss_abs} ensures that an out-of-bounds result saturates to the
>>> +maximum signed value.
>>> +
>>
>> Maybe clarify that as "maximum positive number representable as a signed
>> value"? Otherwise ok.
>>
> But "maximum signed value" is the same meaning of "maximum positive
> number representable as a signed value", isn't? I prefer the former,
> which is simple and short. Is it OK if I commit the original patch?
Go on then. If there's a native speaker reading this who prefers one
form or the other we should probably let them choose, but I guess it's
not that important.
Bernd
--
This footer brought to you by insane German lawmakers.
Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen
Sitz der Gesellschaft Muenchen, Registergericht Muenchen HRB 40368
Geschaeftsfuehrer Thomas Wessel, William A. Martin, Margaret Seif
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Don't fail on SS_ABS
2009-10-19 23:20 ` Bernd Schmidt
@ 2009-10-20 7:48 ` Jie Zhang
0 siblings, 0 replies; 5+ messages in thread
From: Jie Zhang @ 2009-10-20 7:48 UTC (permalink / raw)
To: Bernd Schmidt; +Cc: GCC Patches
Bernd Schmidt wrote:
> Jie Zhang wrote:
>> Hi Bernd,
>>
>> Bernd Schmidt wrote:
>>> Jie Zhang wrote:
>>>> 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?
>>>> +@code{ss_abs} ensures that an out-of-bounds result saturates to the
>>>> +maximum signed value.
>>>> +
>>> Maybe clarify that as "maximum positive number representable as a signed
>>> value"? Otherwise ok.
>>>
>> But "maximum signed value" is the same meaning of "maximum positive
>> number representable as a signed value", isn't? I prefer the former,
>> which is simple and short. Is it OK if I commit the original patch?
>
> Go on then. If there's a native speaker reading this who prefers one
> form or the other we should probably let them choose, but I guess it's
> not that important.
>
Thanks. Committed on trunk.
Jie
^ 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).