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]

define_expand


I'm having trouble understanding part of the machine description
for PowerPC floating point operations.

There are a number of places where there are pairs of templates,
one with define_expand, the other with define_insn or
define_insn_and_split.  For example, the fp negate templates:

(define_expand "negsf2"
  [(set (match_operand:SF 0 "gpc_reg_operand" "")
	(neg:SF (match_operand:SF 1 "gpc_reg_operand" "")))]
  "TARGET_HARD_FLOAT"
  "")

(define_insn "*negsf2"
  [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
	(neg:SF (match_operand:SF 1 "gpc_reg_operand" "f")))]
  "TARGET_HARD_FLOAT && TARGET_FPRS"
  "fneg %0,%1"
  [(set_attr "type" "fp")])

I've read the docs (sect 13.15) which describe define_expand,
but I have a feeling that I'm missing something that would make
it clear how these two templates interact.  Clearly, the define_insn
template says that when the insn pattern is found, generate the
"fneg" instruction.  What is the define_expand template doing?

Thanks!

--
Michael Eager	 eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077


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