This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Generate abs target assembly code with saturation behavior


Therefore, the macro in libgcc should be fine for GCC even if there
may occur signed overflow.
Because we have GCC implementation defined to follow.

GCC implementation defined could be guarantee even if generate abs.
Because abssi2 shouldn't do saturation.

But how the target generate abs instruction if the target abs have
saturation behavior ?
We couldn't use abssi2 naming pattern and ss_abssi2 naming pattern
doesn't exist.

Or we should suggest CPU provider define another abs instruction
without saturation ?


2013/6/28 Joseph S. Myers <joseph@codesourcery.com>:
> On Fri, 28 Jun 2013, Shiva Chen wrote:
>
>> Does the abssi2 semantically assume target abs shouldn't do saturation ?
>
> Yes.  The semantics of RTL abs are modulo, whereas ss_abs does signed
> saturation.  Likewise for addition, subtraction and multiplication.
> (Some RTL codes have more complicated target-specific semantics, e.g.
> shifts, and signed INT_MIN / -1 and INT_MIN % -1 should currently be
> considered undefined in RTL rather than defined with modulo semantics.)
>
> --
> Joseph S. Myers
> joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]