On 11 April 2007 16:48, Rohit Arul Raj wrote:
> Hi All,
>
> I had a single movsf insn that accepts all alternatives for the reload to
> work.
>
> (define_insn "movsf"
> [(set (match_operand:SF 0 "nonimmediate_operand" "=f,m,f,f,d,d")
> (match_operand:SF 1 "general_operand" "m,f,f,d,f,i"))
> ]
> But for the alternative 3, i need a another data register.
> so i used
> (define_insn "movsf"
> [(set (match_operand:SF 0 "nonimmediate_operand" "=f,m,f,f,d,d")
> (match_operand:SF 1 "general_operand" "m,f,f,d,f,i"))
> (clobber (match_scratch:SF 2 "=X,X,X,&d,X,X")) ]
>
> But i am getting: error: insn does not satisfy its constraints:
movsf is special. In particular, it gets called after reload, when no new
pseudos can be allocated. So the (clobber (match_scratch)) fails. Re-read
the internals doco for 'movMM'; it goes into some depth about this.
Basically, movMM mustn't fail and can't allocate a temporary reg.
> Is there any other way to generate a temporary register other than
> using gen_reg_RTX in define expand and emitting the corresponding mov
> patterns?
Yes. This is what secondary reloads are for. Grep 'SECONDARY_RELOAD' in
the internals doc.
cheers,
DaveK
--
Can't think of a witty .sigline today....