On Dec 7, 2010, at 10:30 AM, Paulo J. Matos wrote: > Paul Koning <paul_kon...@dell.com> writes: > >>> I assume you by 'instruction' here mean a define_insn and not a single >>> RTL or assembler instruction. >>> >>> So, assume I have two classes M_REGS and Y_REGS and I cannot move >>> between them except if I go through an intermediary in C_REGS. >>> Do I need a secondary reload? >> >> Yes >>> >>> I wouldn't expect so cause I could write a rule that has a scratch from >>> C_REGS. Then I move the value from SOURCE to C_REGS and from C_REGS to >>> DEST. Have I misunderstood what you said? >>> > > What about the above case? > Couldn't you have something like I described above: > (define_insn "transfer" > [ > (set (match_operand 0 "register_operand" "m") > (match_operand 1 "register_operand" "y")) > (clobber (match_scratch 2 "c")) > ] > "" > { > move from 1 to 2; > move from 2 to 0; > }) > > Why would something like this not work and force you to have a secondary > reload hook?
I don't know enough to answer that. But I do know that the secondary reload stuff works great, and is reasonably well documented, and it takes only a few lines to put into effect. Why not give it a try? paul