<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV id="yiv110945996">hi, Dear Evan Cheng:<BR><BR>My cpu is i32 embeded CPU. I define pseudo register pair registers.<BR><BR>In mytargetRegisterInfo.td:<BR>def T0: RegisterWithSubRegs<"t0",[R0,R1]>;<BR>...<BR>def GPR64 : RegisterClass<"mytarget", [i64], 64, [T0, T1.....]<BR><BR>In mytargetISelLowering.cpp:<BR>I define i1, i8 , i16 and i32 are legal. <BR><BR>1. I still have problem. I save my function return double value in R0 and R1. <BR> It is expanded into two i32. But my GPR64 is defined to save i64. llvm finds<BR> I have i64 GPR register. It will automatically decide not to expand i64 to two i32.<BR><BR>2. I guess I need a special pseudo instruction to move between GPR32 and GPR64.<BR>How to move R0, R1 to T1( R2, R3 pair). and don't convert two i32 to i64?<BR>Could I use MyTargetInstrInfo::copyRegToReg() to handle this logic
issue?<BR><BR>3. Maybe I can study INSERT_SUBREG/EXTRACT_SUBREG at X86 porting file.<BR><BR>I will do some research more deeply. I think the best way is that TableGen has register pair TypeProfile feature. :( <BR><BR><BR><BR><BR>But I find i64 data will not be ex<BR>--- <B>09年2月20日,周五, Evan Cheng <I><echeng@apple.com></I></B> 写道:<BR><BLOCKQUOTE STYLE='border-left-color: #1010ff; border-left-width: 2px; border-left-style: solid; margin-left: 5px; padding-left: 5px'>发件人: Evan Cheng <echeng@apple.com><BR>主题: Re: [LLVMdev] help: about how to use tblgen to constraint operand.<BR>收件人: hbrenkun@yahoo.cn, "LLVM Developers Mailing List" <llvmdev@cs.uiuc.edu><BR>日期: 2009,220,周五,1:11上午<BR><BR><DIV id="yiv2016100483">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-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: 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 rel="nofollow" target="_blank" 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 rel="nofollow" target="_blank" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</A><BR><A rel="nofollow" target="_blank" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</A><BR></BLOCKQUOTE></DIV><BR></DIV></DIV></BLOCKQUOTE></DIV></td></tr></table><br>
<hr size=1><a href="http://cn.rd.yahoo.com/mail_cn/tagline/card/*http://card.mail.cn.yahoo.com/"> 好玩贺卡等你发,邮箱贺卡全新上线!</a>