This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: discouraging register use
- From: DJ Delorie <dj at redhat dot com>
- To: joern dot rennecke at st dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 4 Jan 2005 15:33:07 -0500
- Subject: Re: discouraging register use
- References: <41DAF222.4080201@st.com>
> If the read-modify-write operand has double cost for the memory
> access, it should be more like:
Oh, right. Good idea. Thanks!
> To allow realod inheritance to work where the same value happens to lie around in a 'c'
> class register, you also have to extend all the 'm' alternatives with a 'c':
> [(set (match_operand:SI 0 "" "c,c,??mc,??mc")
How does this related to Richard's comment that this denigrates the "c" class also?
> (plus:SI (match_operand:SI 1 "" "0,0,0,0")
> (match_operand:SI 1 "" "c,?mc,c,?mc")))]
> and make sure the union of the two classes is a register class.
What about when there are three classes, say c, d, and m - do I need
cm, dm, and cdm unions, or just cm and dm?
> Another thing to consider is if you want register class preferencing to ignore or further
> penalize the 'm' class.
> E.g. this would triple the penalty for register preferencing:
> [(set (match_operand:SI 0 "" "c,c,??mc#????,??mc#????")
Ok, someone needs to write a book about all this ;-)
> You might also consider making your addsi commutative, i.e. adding a '%' constraint modifier.
Yeah, the real code has that.