This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: patch to learn addhi/addqi patterns about lea instruction.
- To: Jan Hubicka <hubicka at atrey dot karlin dot mff dot cuni dot cz>, egcs-patches at egcs dot cygnus dot com
- Subject: Re: patch to learn addhi/addqi patterns about lea instruction.
- From: Richard Henderson <rth at cygnus dot com>
- Date: Tue, 13 Apr 1999 14:37:16 -0700
- References: <19990413155549.62110@atrey.karlin.mff.cuni.cz>
On Tue, Apr 13, 1999 at 03:55:49PM +0200, Jan Hubicka wrote:
> Note that I am not sure, if this change help to PPro in the QImode case
> because of partial register stalls...
Not really. What needs to happen for ppro is to _not_ randomly
extend all these operations to a wider mode. We have to either
widen all references to a value or none at all.
> ! [(set (match_operand:HI 0 "nonimmediate_operand" "=rm,?r,r")
> ! (plus:HI (match_operand:HI 1 "nonimmediate_operand" "%0,r,0")
> ! (match_operand:HI 2 "general_operand" "ri,ri,rm")))]
The lea case really should be last -- we don't want to use it
unless forced what with agi and whatnot other dependancies.
> + if (REG_P (operands[0]) && REG_P (operands[1])
> + && (REG_P (operands[2]) || CONSTANT_P (operands[2]))
> + && REGNO (operands[0]) != REGNO (operands[1]))
> + {
> + if (operands[2] == stack_pointer_rtx)
> + abort ();
You shouldn't abort, but just not use lea. You'll have to add an
extra mov to cover, of course.
> ! [(set (match_operand:QI 0 "nonimmediate_operand" "=qm,?q,q")
> ! (plus:QI (match_operand:QI 1 "nonimmediate_operand" "%0,q,0")
> ! (match_operand:QI 2 "general_operand" "qn,qn,qmn")))]
> ! "which_alternative == 1 || ix86_binary_operator_ok (PLUS, QImode, ...
You can't use which_alternative here. It isn't initialized.
r~