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]

Re: Register constraints + and =

On 04/05/12 19:48, Ian Lance Taylor wrote:

The i386 rep_movqi insn is an example:

(define_insn "*rep_movqi"
   [(set (match_operand:P 2 "register_operand" "=c") (const_int 0))
    (set (match_operand:P 0 "register_operand" "=D")
         (plus:P (match_operand:P 3 "register_operand" "0")
		(match_operand:P 5 "register_operand" "2")))
    (set (match_operand:P 1 "register_operand" "=S")
         (plus:P (match_operand:P 4 "register_operand" "1") (match_dup 5)))
    (set (mem:BLK (match_dup 3))
	(mem:BLK (match_dup 4)))
    (use (match_dup 5))]
   "!(fixed_regs[CX_REG] || fixed_regs[SI_REG] || fixed_regs[DI_REG])"
   "%^rep{%;} movsb"
   [(set_attr "type" "str")
    (set_attr "prefix_rep" "1")
    (set_attr "memory" "both")
    (set_attr "mode" "QI")])

Thanks for the discussion on this which was enlightening.
The rep_movqi rule seems scarily like our block copy instruction.
By looking at it, the question that arises is, why the (use (match_dup 5))? I thought this was used to tell gcc that an operand was going to be used in a way not specified by the rtl but operand 5 is specified elsewhere in the rtl so gcc doesn't seem to need that (use ...) rule. Is this redundant or not?


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