This is the mail archive of the gcc-patches@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]

Re: patch to learn addhi/addqi patterns about lea instruction.


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~


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