<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Currently there is no constraint that tells the register allocator to allocate a consecutive register pair. What I would suggest you do is to declare pseudo register pair registers (and corresponding register class, say PAIR_GPR). In this case, your myFMDRR would take one input of PAIR_GPR class. The asm printer should be taught to print a PAIR_GPR register as two GPR registers (you should also teach the JIT of the same thing).<div><br></div><div>A PAIR_GPR register should be a super register of two GPR registers. e.g. r0r1_pair is a super register of r0 and r1. In order to *construct* a PAIR_GPR register, you have to use two INSERT_SUBREG. To extract out a GPR from a PAIR_GPR, you need to issue EXTRACT_SUBREG. In most cases, these will be nop's. In other cases, they are copies.</div><div><br></div><div>Evan</div><div><br><div><div>On Feb 19, 2009, at 2:00 AM, 任坤 wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font: inherit;">I define a pattern to move two 32bits gpr to 64bits fpr. like arm instructure fmdrr.<br>But I need to use an even/odd register pair to save  its 2 operands.<br>I define in mytarget.td:<br><br>myfmdrr:<br> SDTypeProfile<1, 2, [SDTCisVT<0, f64>, SDTCisVT<1, i32>,<br>     SDTCisSameAs<1, 2>]>;<br>def my_fmdrr : ...........<br>def myFMDRR : ....<br>                      (outs FPR: $result), ins(GPR: $op1, GPR:$op2 )<br>                       [(setFPR: $result, (my_fmdrr GPR: $op1, GPR:$op2) )]<br><br>I create myfmdrr instructure in mytargetISelLowering.cpp. and its operands are in R0 and R1.<br>But after optimization, the operands are save R2 and R1. I know optimization pass does not <br>know myfmdrr operands constraint. But How I tell optimzition pass by tblgen??<br><br>Could I can control operand constraint in mytargetiSelLowering.cpp? How do I control?? <br><br></td></tr></tbody></table><br>       <hr size="1"><a href="http://cn.rd.yahoo.com/mail_cn/tagline/card/*http://card.mail.cn.yahoo.com/">  好玩贺卡等你发,邮箱贺卡全新上线!</a>_______________________________________________<br>LLVM Developers mailing list<br>LLVMdev@cs.uiuc.edu         <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></blockquote></div><br></div></body></html>