On Fri, Oct 24, 2008 at 07:06:29AM -0400, Hans-Peter Nilsson wrote: > You could use iterators... except you'd probably want to iterate > over text, not RTX codes or machine modes. Maybe a good reason > to introduce generalized (or maybe just text) iterators! > > (define_iterator i [foo bar]) > (define_text_attr i_constraint [(foo "constraint1") (bar "constraint2") > (define_text_attr i_condition [(foo "optimize_size") (bar "!optimize_size")]) > or something.
You still get a huge amount of generated code. Moreover, the .md file also doesn't get more readable if I replace a three character constraint string with a multiword iterator invocation... for something like eight out of 14 alternatives for some instructions. FWIW, I realized that overloaded constraints are not a panacea, either: I can prevent the use for reloading of the alternative for this particular operand, which is admittedly sometimes exactly what is wanted, but I can't use it to disable the use of the alternative altogether for reloading. I.e. if the non-matching part is a matching constraint, and I want to stop reload to 'fix' this operand to match, I need to manipulate the alternative cost. (If you are free to change the rtl structure of your insns, you can add clobbers of imaginary registers which are available for one invocation option but not the other... but I don't think we want to go there.)