------- Additional Comments From paolo dot bonzini at lu dot unisi dot ch 2005-09-21 06:51 ------- Subject: Re: x87 reg allocated for constants for -mfpmath=sse
>Note that in this pattern cost computation of MMX_REGS are all ignored ('*' >in front of y). So, the cost >which is computed is for 'r' which is GENERAL_REGS. This cost is too high and >eventually results in >memory cost to be lower than register cost. I tried the following simple patch >as experiment and got all >the performance back (it is now comparable with 4.0). Note that in this patch, >I removed the '*' in the >2nd alternative so cost of keeping the operand in mmx_regs class is factored >in. This resulted in a >lower cost than that of memory. Is this the way to go? This is just an >experiment which seems to work. > > I think it makes sense. The x86 back-end is playing too many tricks (such as the # classes) with the register allocator and regclass especially, and they are biting back. Still, I'd rather hear from an expert as to why the classes were written like this. Paolo -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19653