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: A question about define_insn and force-reg


  (define_insn "loadsf"
  [(set (match_operand:SF 0 "register_operand" "=r")
        (mem:SF (match_operand:SI 1 "immediate_operand" "m")))]

This makes no sense, because the constraint means that the mem's operand is an immediate before reload (and you want it to be a register), and a mem after reload. What you want is something like


(mem:SF (match_operand:SI 1 "general_operand" "r")))]

which means "the address can be a general operand, but after reload we only accept registers here", or

(mem:SF (match_operand:SI 1 "register_operand" "r")))]

Why can't I create a new register? So how should I do to implement it?

You can create new registers only at special places. GCC tries passing a SYMBOL_REF to gen_mov<mode>. To convert it, use a define_expand.


Paolo


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