On 12/20/10 01:47, Mohamed Shafi wrote:


I think this is a case where you're going to need a secondary reload to
force the immediate into a register if the destination is a non-symbolic MEM
or a pseudo without a hard reg and its equivalent address is non-symbolic.

     I am not sure how i should be implementing this.
     Currently in define_expand for move i have code to force the
immediate value into a register if the destination is not a symbolic
address. If i understand correctly this is the only place where i can
decide what to do with the source depending on the destination. right?
Just changing the movxx expander is not sufficient since for this case you do not know until reload time whether or not a particular insn needs an extra register to implement the move. That's the whole point of the secondary reload mechanism -- to allow you to allocate a scratch register during reloading to handle oddball cases like this.


In your secondary reload code you'll need to check for the case where the destination is a MEM and the source is an unallocated pseudo with a constant equivalent and return a suitable register class for that case.

Jeff

Reply via email to