Limit reload creativity on load 1 into xmm register

Uros Bizjak uros@kss-loka.si
Tue May 17 20:36:00 GMT 2005


Hello Jan!

>> 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.
>> 
>> I don't see how adding "!", meaning "last resort", is appropriate.
>
>Hi,
>apparently I suceeded with my homework and created self contained
>testcase for some reason working on i386 only, but it gives the idea.
>(it is tricky to do so as the wrong reload happens only when we have
>reg-reg copy where source is REG_EQUIV of 1 and it is reloaded out.  For
>example replacing the test2 asm in the testcase makes caller save code
>to save&load the constant on stack that is wrong too.)
>

I think that the testcase in PR 19653: "x87 reg allocated for constants 
for -mfpmath=sse" shows the same problem. I'm sorry that I'm a bit late, 
but I hope that it is of some help anyway. Please note, that sometimes 
loading of constant 0 could also confuse gcc to use fldz -> mem -> SSE 
reg sequence.

A realted problem could be observed when zero is produced in XMM 
register (or FP reg!) and then pushed to memory. A couple instructions 
later, this zero is loaded back from memory into XMM register. There is 
no reason not to calculate zero directly in XMM eg by using xor insn..

Uros.



More information about the Gcc-patches mailing list