James Greenhalgh <james.greenha...@arm.com> writes: > If the output control string starts with a @samp{@@}, then it is actually > a series of templates, each on a separate line. (Blank lines and > leading spaces and tabs are ignored.) The templates correspond to the > -pattern's constraint alternatives (@pxref{Multi-Alternative}). For example, > -if a target machine has a two-address add instruction @samp{addr} to add > -into a register and another @samp{addm} to add a register to memory, you > -might write this pattern: > +pattern's constraint alternatives (@pxref{Multi-Alternative}). > + > +For example, if a target machine has a two-address add instruction > +@samp{addreg} to add into a register and another @samp{addmem} to add > +a register to memory, this pattern could be used to describe the > +instructions. > > @smallexample > (define_insn "addsi3" > [(set (match_operand:SI 0 "general_operand" "=r,m") > (plus:SI (match_operand:SI 1 "general_operand" "0,0") > - (match_operand:SI 2 "general_operand" "g,r")))] > + (match_operand:SI 2 "general_operand" "r,r")))] > "" > "@@ > - addr %2,%0 > - addm %2,%0") > + addreg %2,%0 > + addmem %2,%0") > @end smallexample
While there, I think we should tighten the predicates to nonimmediate_operand for operands 0 and 1 and -- given the new constraints -- register_operand for operand 2. Thanks, Richard