This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Using SCRATCH Register for a mov op,
- From: David Edelsohn <dje at watson dot ibm dot com>
- To: Richard Henderson <rth at redhat dot com>, Pierre Mallard <pierremallard at yahoo dot fr>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 04 Nov 2002 10:20:30 -0500
- Subject: Re: Using SCRATCH Register for a mov op,
(define_expand "movhi"
[(parallel[(set (match_operand:HI 0 "general_operand" "=r,r,m,r,r")
(match_operand:HI 1 "general_operand" "r,m,r,I,i"))
(clobber (match_scratch:QI 2 ""))])]
""
"{
rtx temp;
/* One of the ops has to be in a register */
if (!register_operand(operand0, HImode)
&& !register_operand(operand1, HImode))
{
operands[1] = copy_to_mode_reg(HImode, operand1);
}
}")
Shouldn't the define_expand use
(clobber (scratch:QI))
not
(clobber (match_scratch:QI 2 ""))
The define_insn needs to match the scratch, but the define_expand
needs to create the scratch register.
David