<div dir="ltr">It's fixed. I can just use intrinsic::sqrt instead of x86_sse_sqrt_pd. </div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 23, 2015 at 10:26 PM, zhi chen <span dir="ltr"><<a href="mailto:zchenhn@gmail.com" target="_blank">zchenhn@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I used the following way to create an x86_sse2_sqrt_pd intrinsic instruction:<div><br></div><div><div>Value *Approx::CreateVFSqrt(IRBuilder<> &builder, Value *v, const std::string& Name) {</div><div>  Type *tys[] = {v->getType()};</div><div>  Module* M = currF->getParent();</div><div><br></div><div>  Value* sqrtv = Intrinsic::getDeclaration(M, Intrinsic::x86_sse2_sqrt_pd, tys);</div><div>  Value *CI = builder.CreateCall(sqrtv, v, Name);</div><div><br></div><div>  return CI;</div><div>}</div></div><div><br></div><div>I can compile it with clang++ and then generate the assembly code with llc.</div><div><br></div><div>However, it gives me and error "undefined reference to 'llvm.x86.sse2.sqrt.pd.v2f64'" when I want to generate the executable with gcc. BTW, I opened the assembly code and I can see an instruction "calll llvm.x86.sse2.sqrt.pd.v2f64" in the file. Any hint would be appreciated!</div><div><br></div><div>Best,</div><div>Zhi</div></div>
</blockquote></div><br></div>