Re: Move ABS detection from fold-const.c to match.pd

2015-06-29 Thread Richard Biener
On Sun, Jun 28, 2015 at 8:34 PM, Marc Glisse marc.gli...@inria.fr wrote: (this message looks like it was lost in my draft folder...) On Tue, 26 May 2015, Richard Biener wrote: +(match zerop integer_zerop) +(match zerop real_zerop) Would it also include fixed_zerop? Probably, yes. The

Re: Move ABS detection from fold-const.c to match.pd

2015-06-28 Thread Marc Glisse
(this message looks like it was lost in my draft folder...) On Tue, 26 May 2015, Richard Biener wrote: +(match zerop integer_zerop) +(match zerop real_zerop) Would it also include fixed_zerop? Probably, yes. The main issue is that I know next to nothing about fixed-point types, so I am

Re: Move ABS detection from fold-const.c to match.pd

2015-05-26 Thread Richard Biener
On Sun, May 24, 2015 at 3:17 PM, Marc Glisse marc.gli...@inria.fr wrote: I forgot to mention I optimistically tried to write something like this: (match (negated_value_for_comparison @0) (negate @0)) (match (negated_value_for_comparison (negate @0)) @0) (match

Re: Move ABS detection from fold-const.c to match.pd

2015-05-24 Thread Marc Glisse
I forgot to mention I optimistically tried to write something like this: (match (negated_value_for_comparison @0) (negate @0)) (match (negated_value_for_comparison (negate @0)) @0) (match (negated_value_for_comparison (minus @0 @1)) (if (!HONOR_SIGN_DEPENDENT_ROUNDING (type)) (minus @1

Move ABS detection from fold-const.c to match.pd

2015-05-24 Thread Marc Glisse
Hello, I don't think this pattern is done in the branch. Here I am trying to match what is done in fold-const, but the idea is that we can later add an extra block where we replace (cmp (minus @2 @3) zerop) with (cmp @2 @3), maybe with some adjustments (convert? all over the place), to help