"Balaji V. Iyer" <[EMAIL PROTECTED]> writes:

> Thank you very much Ian and Shreyas for your quick response. So I guess,
> my question now would be, what would be an exmple that matches this
> constraint below?
> 
> ((insn 1497 1924 1756 2 (set (mem:BI (plus:SI (reg/f:SI 2 r2)
>                 (const_int -137 [0xffffff77])) [72 S1 A8])
>          (le:BI (reg:SI 12 r12)
>             (const_int 0 [0x0]))) 0 {*cmpsi_normal}
>  (insn_list:REG_DEP_TRUE 86 (
>  nil))
>     (nil))

I don't think that question makes sense, at least not without more
context.

A constraint is one of the letters which appears after the operand
predicate in the .md file.  For example, in 

(define_insn "*cmpsi_ccno_1"
  [(set (reg FLAGS_REG)
        (compare (match_operand:SI 0 "nonimmediate_operand" "r,?mr")
                 (match_operand:SI 1 "const0_operand" "n,n")))]
  "ix86_match_ccmode (insn, CCNOmode)"
  "@
   test{l}\t{%0, %0|%0, %0}
   cmp{l}\t{%1, %0|%0, %1}"
  [(set_attr "type" "test,icmp")
   (set_attr "length_immediate" "0,1")
   (set_attr "mode" "SI")])

there are two alternative; the constraints on operand 0 are "r" for
the first alternative and "?mr" for the second, and the constraints on
operand 1 is "n" for both alternatives.  The operand predicates are
nonimmediate_operand for operand 0 and const0_operand for operand 1.

When I said this:

> > This kind of error generally means that the operand predicate accepts
> > an operand which no constraint matches.  If the predicate (e.g.,
> > register_operand) accepts an operand, then there must be a constraint
> > that matches it.  Otherwise you will get an error in
> > constrain_operands, such as the above.

I mean that, in the instruction above, any operand which matches
nonimmediate_operand must be matched by at least one of the
constraints 'm' or 'r', and any operand which matches const0_operand
must match the constraint 'n'.

Ian

Reply via email to