> > > Or use the more modern iterators approach. > > > > Aren't iterators for generating multiple insns (e.g. movsi and movdi) > > from the same pattern, whereas in this case we have a single insn that > > needs to accept many different operand combinartions? > > Yes, but that is often better, I suspect, than having too fancy a > pattern that breaks the optimization simplifications that genrecog does.
My understanding was that you should not have multiple patterns that match the same RTL. Especially with things like mov, it's important that all alternatives be the same insn so that register allocation and reload work. 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. (define_insn "*my_movsi_a" (set (match_operand:SI "..." "=a") (match_operand:SI "..." "ab"))) (define_insn "*my_movsi_b" (set (match_operand:SI "..." "=b") (match_operand:SI "..." "ab"))) Paul