This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: approaches to carry-flag modelling in RTL
- From: Hans-Peter Nilsson <hp at bitrange dot com>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 7 Feb 2012 17:14:20 -0500 (EST)
- Subject: Re: approaches to carry-flag modelling in RTL
- References: <CAPOJ94N-6Ek4-s6RJXDLHUCTN3EssVuYnh8xTZaeQR-0_cE3Og@mail.gmail.com> <4EAADF8F.2090002@redhat.com> <CAPOJ94P9ZuK50X7e+5zq7eu_73iJv1hwn+BUB5Ctu8nb9+RH2g@mail.gmail.com> <alpine.BSF.2.00.1110310107210.49224@dair.pair.com> <j8lq9d$e13$2@dough.gmane.org> <alpine.BSF.2.00.1110312228330.29768@dair.pair.com> <j8otf5$hq3$1@dough.gmane.org> <alpine.BSF.2.00.1111011723100.93007@dair.pair.com> <4EB1A1F4.5020808@redhat.com>
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