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: <aph at redhat dot com>, <fweimer at redhat dot com>, <gcc at gcc dot gnu dot org>, <marc dot glisse at inria dot fr>
- Date: Sun, 30 Jun 2013 15:07:46 +0000
- Subject: Re: Generate abs target assembly code with saturation behavior
- References: <CAH=PD7ZBeqpU6MTx8gv+kA1dc2uH+z+L9i7m-RS1qZOGUOtrow at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1306281328460 dot 27363 at digraph dot polyomino dot org dot uk> <CAH=PD7YgkSjTOQwAwj8ZtG_akJaRTrHmswzDnAC5x+pckXr0tA at mail dot gmail dot com>
On Sun, 30 Jun 2013, Shiva Chen wrote:
> 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.
If you want to use a saturating abs instruction for C code that exhibits
undefined behavior in cases where the instruction saturates, you need to
add support for ss_abssi2 patterns and teach the GIMPLE-to-RTL conversion
to use such patterns as appropriate (in the absence of -fwrapv/-ftrapv, of
course).
--
Joseph S. Myers
joseph@codesourcery.com