This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: How to implement pattens with more that 30 alternatives
On Tue, 2009-12-22 at 09:10 -0500, Daniel Jacobowitz wrote:
> On Tue, Dec 22, 2009 at 12:09:55PM +0000, Paul Brook wrote:
> > i.e. the following will work as expected:
> >
> > (define_insn "*my_movsi"
> > (set (match_operand:SI "..." "=a,b")
> > (match_operand:SI "..." "ab,ab")))
> >
> > However the following will not. Once gcc has picked a particular insn
> > (_a or _b), it will tend to stick with it and not try other patterns.
>
> This is my understanding too - but it's a real nuisance. Suppose you
> have two optional ISA extensions that have their own move
> instructions. For the sake of conversation I'll call them Alice and
> Bob... no, I'll call them TARGET_MAVERICK and TARGET_NEON. Now you
> need a minimum of three copies of the mov<mode> pattern that are
> mostly the same.
>
> It'd be nice if there was a way to compose instruction patterns :-(
>
There is. Look at attribute "enabled".
I've not worked out how to use that properly yet, but it is used in the
m68k back-end.
R.