This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Generate abs target assembly code with saturation behavior
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Shiva Chen <shiva0217 at gmail dot com>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Fri, 28 Jun 2013 13:33:40 +0000
- Subject: Re: Generate abs target assembly code with saturation behavior
- References: <CAH=PD7ZBeqpU6MTx8gv+kA1dc2uH+z+L9i7m-RS1qZOGUOtrow at mail dot gmail dot 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