This is the mail archive of the
mailing list for the GCC project.
Re: PATCH RFA: Change MIPS ffs<mode>2 from define_insn to define_expand
- From: Richard Sandiford <richard at codesourcery dot com>
- To: Ian Lance Taylor <ian at airs dot com>
- Cc: gcc-patches at gcc dot gnu dot org, echristo at redhat dot com
- Date: Sat, 09 Jul 2005 07:20:57 +0100
- Subject: Re: PATCH RFA: Change MIPS ffs<mode>2 from define_insn to define_expand
- References: <email@example.com>
Nice analysis again. ;)
Ian Lance Taylor <firstname.lastname@example.org> writes:
> Of course, it would be even better if we expanded earlier, into trees,
> so that the instructions were exposed to the tree optimizers. And for
> that matter this code is essentially generic and not really MIPS
> specific at all.
The second sentence is why I don't think this patch is a good idea. I
don't want to see us add new target-independent expansions to the MIPS
backend. If you want to change the way that ffs is implemented, please
either provide this expansion in the tree->rtl expanders or do it as
a tree-level reduction in the way you suggest.
(FWIW, a similar issue came up a while back wrt variable doubleword shifts.
I raised the same objection then (and ended up coding the middle-end
bits myself ;) so I hope I'm being vaguely consistent here.)
Like you say, the pattern was probably added to get "optimal" filling
of delay slots. That meant keeping the instruction in one piece
until final, so a MIPS-specific pattern was justified in that
situation. I don't think it is with this sort of approach.