Hi, Current llvm-gcc cannot emit llvm intrinsic function like llvm.pow.* and llvm.sin.* For example: double foo(double x, double y) { return pow(x,y); } will compiled into ll: define double @foo(double %x, double %y) { %tmp3 = tail call double @pow( double %x, double %y ) ret double %tmp3 } This is not consistent with llvm language reference. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20071122/eff1d153/attachment.html>
Hi,> Current llvm-gcc cannot emit llvm intrinsic function like llvm.pow.* and > llvm.sin.* > For example: > > double foo(double x, double y) { > return pow(x,y); > } > > will compiled into ll: > > define double @foo(double %x, double %y) { > %tmp3 = tail call double @pow( double %x, double %y ) > ret double %tmp3 > } > > This is not consistent with llvm language reference.first of all, this is logically wrong - the language reference doesn't say anywhere that you *have* to use llvm.pow.* rather than pow from the C library. Also, don't forget that the llvm intrinsics don't set errno, so using them is only valid on systems/for languages for which errno is ignored. That said, llvm.pow.* is for raising to an integer power, and here you raise to a double power. Ciao, Duncan.
2007/11/22, Duncan Sands <baldrick at free.fr>:> > Hi, > > > Current llvm-gcc cannot emit llvm intrinsic function like llvm.pow.* and > > llvm.sin.* > > For example: > > > > double foo(double x, double y) { > > return pow(x,y); > > } > > > > will compiled into ll: > > > > define double @foo(double %x, double %y) { > > %tmp3 = tail call double @pow( double %x, double %y ) > > ret double %tmp3 > > } > > > > This is not consistent with llvm language reference. > > first of all, this is logically wrong - the language reference > doesn't say anywhere that you *have* to use llvm.pow.* rather than > pow from the C library.Sure. But now the question is the llvm-gcc will not emit llvm.pow.* anytime. Also, don't forget that the llvm intrinsics> don't set errno, so using them is only valid on systems/for languages > for which errno is ignored. That said, llvm.pow.* is for raising > to an integer power, and here you raise to a double power.I don't understand. why we can't use llvm.pow.f64 for double power? Sheng. Ciao,> > Duncan. >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20071122/9b477474/attachment.html>