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: Shiva Chen <shiva0217 at gmail dot com>
- To: "Joseph S. Myers" <joseph at codesourcery 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: Mon, 1 Jul 2013 13:28:02 +0800
- 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> <Pine dot LNX dot 4 dot 64 dot 1306301505360 dot 23506 at digraph dot polyomino dot org dot uk>
Thank you for all your kindly help make the issue more clear.
Currently, we would disable abssi2 pattern and the soft-fp could work correctly.
Thanks all the explanation and assistance.
I really appreciate it.
2013/6/30 Joseph S. Myers <joseph@codesourcery.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