This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 04/10] rs6000: Remove addic from the normal add pattern
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: David Edelsohn <dje dot gcc at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 8 Dec 2014 09:01:39 -0600
- Subject: Re: [PATCH 04/10] rs6000: Remove addic from the normal add pattern
- Authentication-results: sourceware.org; auth=none
- References: <cover dot 1418024189 dot git dot segher at kernel dot crashing dot org> <b5d9e7d6e5ad4b24fb61cef9f08c8a5a7df04a2e dot 1418024189 dot git dot segher at kernel dot crashing dot org> <CAGWvnykJ1zWFj+Fb9iRN2MWxgC87uwYhSY8QdSVy_=coFr2=mw at mail dot gmail dot com>
On Mon, Dec 08, 2014 at 09:44:44AM -0500, David Edelsohn wrote:
> > -;; Discourage ai/addic because of carry but provide it in an alternative
> > -;; allowing register zero as source.
> > (define_insn "*add<mode>3_internal1"
> > - [(set (match_operand:GPR 0 "gpc_reg_operand" "=r,r,?r,r")
> > - (plus:GPR (match_operand:GPR 1 "gpc_reg_operand" "%r,b,r,b")
> > - (match_operand:GPR 2 "add_operand" "r,I,I,L")))]
> > + [(set (match_operand:GPR 0 "gpc_reg_operand" "=r,r,r")
> > + (plus:GPR (match_operand:GPR 1 "gpc_reg_operand" "%r,b,b")
> > + (match_operand:GPR 2 "add_operand" "r,I,L")))]
> > "!DECIMAL_FLOAT_MODE_P (GET_MODE (operands[0])) && !DECIMAL_FLOAT_MODE_P (GET_MODE (operands[1]))"
> > "@
> > add %0,%1,%2
> > addi %0,%1,%2
> > - addic %0,%1,%2
> > addis %0,%1,%v2"
> > [(set_attr "type" "add")])
>
> Why are you removing the alternative instead of clobbering XER[CA]?
I should have mentioned, sorry.
We don't want to clobber CA on *every* add, and reload can generate more
adds out of thin air. And CA is a fixed register.
There may be a better way to do this, but I don't know it.
Segher