approaches to carry-flag modelling in RTL
Hans-Peter Nilsson
hp@bitrange.com
Tue Feb 7 22:42:00 GMT 2012
Since this came up the other day in the "post-reload compare
optimization pass" discussion, I thought better comment on
this old post in case someone is tempted to do something...
On Wed, 2 Nov 2011, Richard Henderson wrote:
> Frankly, I'd prefer to flip the default. It does seem to make the most sense.
> We shan't do that until we tackle...
>
> On 11/01/2011 02:59 PM, Hans-Peter Nilsson wrote:
> > I'm still thinking of a generic md iterator mechanism (one that
> > doesn't restrict the form of the expansion in ways getting in
> > the way with expanding to both a clobber and a set, and in
> > swapped locations as above), to make the troubles go away...
> > But maybe expanding them by a pass through e.g. m4 would be
> > better than cooking up something new there.
>
> ... this, so that it can all be done automatically.
>
> I think some sort of iterator mechanism is best, much like we
> automate cond_exec and other sorts of macro-izations.
>
> I can imagine a sort of
>
> (define_insn_with_flags "name"
> [(set ...)
> (set (reg:cc) (...)]
> ""
> ...)
>
> where we automatically expand to
>
> (define_insn "name"
> [(set ...)
> (clobber (reg:cc))]
> ...)
>
> (define_insn "name_flags"
> [(set ...)
> (set (reg:cc) (...)]
> ...)
>
> or something like that.
Of equal value would be an optional third expansion for that
define_insn_with_flags thing with just the plain "main" set, for
the cases where (for some alternatives) the plain set can be
emitted without CC side effects.
brgds, H-P
More information about the Gcc
mailing list