This is the mail archive of the
mailing list for the GCC project.
Re: Canonicalization of compares performed as side-effect operations
On Tue, Aug 06, 2019 at 05:49:17PM +0100, Richard Earnshaw (lists) wrote:
> On 06/08/2019 17:39, Segher Boessenkool wrote:
> >>>What's wrong with describing the canonical form in your MD? You'll need
> >>>some reversed condition code thingy, but that's it?
> >>It doesn't describe what the instruction does. The negation has a side
> >>effect of setting the flags, but the flags are swapped because the
> >>side-effect comparison is swapped from a normal compare. As I
> >>mentioned, SELECT_CC_MODE doesn't help because it can't see the context
> >>and the comparison just looks 'normal'.
> >Sure, and we can work on making combine do what you want, but your existing
> >pattern is *incorrect*. It needs fixing, and probably before we do other
> Why is it incorrect? It's not canonical, sure. But the cannonical form
> does NOT describe what the instruction does.
More precisely: not having the canonical form of this in your MD is what