This is the mail archive of the 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: [RFC, 4.8] Magic matching for flags clobbering and setting

On Fri, 10 Feb 2012, Richard Henderson wrote:
> Seeing as how Uros is starting to go down the path of cleaning up the
> flags handling for x86, I thought I'd go ahead and knock up the idea
> that I've been tossing around to help automate the process of building
> patterns that match both clobbering the flags and setting the flags to
> a comparison.

Sometimes the destination too unless there's overlap, but I
don't know how often that matters.

> This is far from complete, but it at least shows the direction.

Yes, nice!

> What I know is missing off the top of my head are:

>  (2) Can't be usefully used with define_insn_and_split, and no way to tell.
>      This problem should simply be documented in the .texi file as user error.

Not sure I see the problem or the impact of the absence.  Would
it help if there was a way to match_dup the clobber/set?  Maybe
as a match_op_flags, the same as match_flags but with the first
argument being an assigning operand number.  You probably
wouldn't want to use this very often.)

>  (3) Can't be used for x86 add patterns, as the "clobber" version wants the
>      freedom to use "lea" and the "set flags" version cannot.  And there are
>      different sets of constraints if lea may be used or not.

Other targets too, but as it's warty for x86 I hope eventually
this'll see improvement...

> Comments?

Er... very interesting!  (The kind of patch you want to play
around with to have any further insightful comments.)

So I can use match_{operand,whatever} in the second, optional
operand to match_flags?  No, wait, no use to have anything but
a match_dup, hm.

I don't see where it'd make sense to have anything else but the
default, absent argument.  Example?

brgds, H-P

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