[LLVMdev] llvm-gcc cannot emit @llvm.pow.* ?

Duncan Sands baldrick at free.fr
Thu Nov 22 00:38:04 PST 2007


> 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.



More information about the llvm-dev mailing list