This is the mail archive of the gcc@gcc.gnu.org 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]

Re: Question about "match_dup"



On Sunday, Sep 7, 2003, at 20:54 US/Pacific, Ian Lance Taylor wrote:


<fishbaoz@hotmail.com> writes:

What is the exact meaning of "match_dup"?

the following is extracted from "mips.md"

(define_expand "movsicc"
  [(set (match_dup 4) (match_operand 1 "comparison_operator" ""))
   (set (match_operand:SI 0 "register_operand" "")
 (if_then_else:SI (match_dup 5)
    (match_operand:SI 2 "reg_or_0_operand" "")
    (match_operand:SI 3 "reg_or_0_operand" "")))]
  "mips_isa >= 4"
  "
{
  gen_conditional_move (operands);
  DONE;
}")

Now?
what is the meaning of "match_dup" in the machine description above?
what does it "duplicate"? Operand(4)? where is the original Operand(4)?

The preparation statements always call DONE. That means that the RTL template is never used, and is in effect a comment. The insns are generated by gen_conditional_move().

But match_dup is needed to get a fourth operand, this technic is used in
other machine descriptions (like ffssi2 in rs6000.md) and then you create
the operand.


(define_expand "ffssi2"
  [(set (match_dup 2)
        (neg:SI (match_operand:SI 1 "gpc_reg_operand" "r")))
   (parallel [(set (match_dup 3) (and:SI (match_dup 1)
                                         (match_dup 2)))
              (clobber (scratch:CC))])
   (set (match_dup 4) (clz:SI (match_dup 3)))
   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
        (minus:SI (const_int 32) (match_dup 4)))]
  ""
  {
     operands[2] = gen_reg_rtx (SImode);
     operands[3] = gen_reg_rtx (SImode);
     operands[4] = gen_reg_rtx (SImode);
  })


Thanks, Andrew Pinski


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