This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

%0 and match_dup in .md


 I read MD manual for GCC and I got confused by the
functioning of '%' constraint modifier character and
match_dup in RTL template. The MD states:

  '%' in constraint declares the instruction to be
commutative for this operand and the following
operand. This is often used in patterns for addition
instructions that really have two operands: the result
must go in one of the arguments. An example from

(define_insn "addhi3"
   [(set (match_operand:HI 0 "general_operand" "=m,r")
      (plus (match_operand:HI 1 "general_operand"
         (match_operand:HI 2 "general_operand"

As far as I understand, it comes out that operand 0
and operand 1 are refering to the same expression. So,
why can't match_dup be used in place of operand 1? In
fact, I'm unable to figure out the differences between
the two. I may be missing something very important.
Please help!!

Regards and Thanks,

Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]