[LLVMdev] undefined reference to 'llvm.x86.sse2.sqrt.pd.v2f64'

zhi chen zchenhn at gmail.com
Thu Apr 23 22:26:20 PDT 2015


I used the following way to create an x86_sse2_sqrt_pd intrinsic
instruction:

Value *Approx::CreateVFSqrt(IRBuilder<> &builder, Value *v, const
std::string& Name) {
  Type *tys[] = {v->getType()};
  Module* M = currF->getParent();

  Value* sqrtv = Intrinsic::getDeclaration(M, Intrinsic::x86_sse2_sqrt_pd,
tys);
  Value *CI = builder.CreateCall(sqrtv, v, Name);

  return CI;
}

I can compile it with clang++ and then generate the assembly code with llc.

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!

Best,
Zhi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150423/1be2d4c8/attachment.html>


More information about the llvm-dev mailing list