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]
Other format: [Raw text]

Re: Limit reload creativity on load 1 into xmm register


> On Fri, May 13, 2005 at 11:54:48PM +0200, Jan Hubicka wrote:
> > While fixing the constraints I also noticed one missing #rf in movsf_1
> > so fixed it one the way.
> 
> I'm largely convinced that these # constraints *are* the bug that you're
> trying to work around.  When I was re-doing the SSE stuff a couple of 
> months ago, I got better results by removing them.

The problem I am working around there is the fact that regclass makes
pressimistic assumption here, so if register has a class
"FLOAT_SSE_REGs", each alternative having 'f' in it will get cost of
moving SSE into x87 and each alternative having 'x' in will get cost of
moving x87 into SSE resulting in arbitrary high costs.  At the end 
we get arbitrary high costs for each register class.  If the cost of
moving SSE to x87 and vice versa are assymetric, regclass will end up
pincking FLOAT_REGs or SSE_REGs that is also not quite correct.

I have patches to make regclass optimistic in this respect (so expecting
that the alternative having subclass of the current class won't trigger
the worst possible case).  This cost model seemed to produce better
results than current code after removing all the '#', but it has the
property that it won't stabilize after 2 iterations like current one
does.   (if we have reg 1 and 2 used in one operation and reg 2 and 3
used in second operation and we work out reg1 to be SSE_REG, in the
first iteration, regs 2 and 3 will be FLOAT_SSE_REGs.  In the second
iteration we will work out that reg 2 is SSE_REG and we need third
iteration to work out that reg 3 is SSE_REG).  I also has patches to
make regclass this kind of worklist based dataflow in the past.
> 
> I don't see how adding "!", meaning "last resort", is appropriate.

'!' means use the fld1 only if constraints match exactly (so we want to
load into x87 register).  It looks bogus to use fld1 to load 1 into
other register class (and for memory integer moves win probably too, not
sure)
(I believe that regclass won't consider the cost of loading constant
from memory as long as it seem to have "direct" alternative, so this
don't seem to be just bug in cost model)

Honza
> 
> 
> r~


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