On Tue, Sep 24, 2019 at 11:33:56AM -0500, William Tambe wrote: > On Tue, Sep 24, 2019 at 10:52 AM Segher Boessenkool > <segher@xxxxxxxxxxxxxxxxxxx> wrote: > > Don't use "+", just use matching constraints, like the "0" you already > > have, but then "1"? Like > > > > (define_insn "atomic_exchangesi" > > [(set (match_operand:SI 0 "register_operand" "=r,r") > > (match_operand:SI 1 "memory_operand" "B,W")) > > (set (match_operand:SI 2 "memory_operand" "=1,1") > > (unspec:SI > > [(match_operand:SI 3 "register_operand" "0,0") > > (match_operand:SI 4 "const_int_operand")] > > 0))] > > > Per https://gcc.gnu.org/onlinedocs/gccint/Standard-Names.html , > atomic_exchangesi only has 4 operands instead of 5 operands as it is > the case in your example. Yeah. So do a define_expand for atomic_exchangesi that has only the four operands, and which expands to your actual machine pattern, which then is a separate define_insn? Segher