This is the mail archive of the gcc-patches@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: [PATCH, rs6000] Fold vector absolutes in GIMPLE


On Mon, May 29, 2017 at 2:21 PM, Segher Boessenkool
<segher@kernel.crashing.org> wrote:
> On Mon, May 29, 2017 at 01:35:22PM +0200, Richard Biener wrote:
>> >> What's the documented behavior for vec_abs with respect to an
>> >argument
>> >> of value INT_MIN?
>> >
>> >The documentation says:
>> >
>> >     "For integer vectors, the arithmetic is modular."
>>
>> This means that folding as ABS_EXPR is not safe for !TYPE_OVERFLOW_WRAPS
>> Integral vector types.
>
> Is it still fine if TYPE_OVERFLOW_UNDEFINED?  So essentially always
> except with -ftrapv?

The docs say it needs to wrap so the correct check is TYPE_OVERFLOW_WRAPS.
It's not fine with TYPE_OVERFLOW_UNDEFINED as we will conclude the result
can never be INT_MIN while the spec says it can.

Richard.

>
>
> Segher


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