<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi:<br>I want add new Instrinsic for my target. So I first do some test.<br><br>I add them in IntrinsicsPowerPC.td<br>//===--------------------===//<br>let TargetPrefix = "ppc" in {<br>def int_ppc_mytest : Intrinsic<[llvm_void_ty], [], [IntrWriteMem]>;<br>}<br>//===--------------------===//<br><br><br>I add them in PPCInstrInfo.td<br>//===--------------------===//<br>def MYTEST : XForm_24_sync<31, 599, (outs), (ins),<br> "mytest", LdStSync,<br> [(int_ppc_mytest)]>;<br>//===--------------------===//<br><br><br><br>I insert them in
mycase.ll<br>//===--------------------===//<br>call void
@llvm.ppc.mytest()<br>...<br>declare void @llvm.ppc.mytest(...) nounwind<br>//===--------------------===//<br><br>then : llvm-as mycase.ll -o mycase.bc<br> llc -march=ppc32 mycase.bc -o mycase.s<br>I get in mycase.s :<br> stwx 4, 5, 3<br> 62 la 3, .str@l(8)<br> 63 mytest <----my test instruction. <br> 64 creqv 0, 0, 0<br> 65 li 30, 0<br><br>BUT when I implement them to my target, llc error:<br>llc:
/backup/AndesCC/llvm/include/llvm/Support/Casting.h:199: typename
llvm::cast_retty<To, From>::ret_type llvm::cast(const Y&)
[with X = llvm::ConstantSDNode, Y = llvm::SDValue]: Assertion
`isa<X>(Val) && "cast<Ty>() argument of
incompatible type!"' failed.<br><br>Why? I
miss something??<br>
<br>
Thanks<br>
<br>
Ren Kun<br><br><a rel="nofollow" target="_blank" href="http://cn.rd.yahoo.com/mail_cn/tagline/card/*http://card.mail.cn.yahoo.com/"><br></a><a rel="nofollow" target="_blank" href="http://cn.rd.yahoo.com/mail_cn/tagline/card/*http://card.mail.cn.yahoo.com/">
</a></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>