[Numpy-discussion] Numpy and PEP 343

Travis Oliphant oliphant at ee.byu.edu
Fri Mar 3 15:45:02 CST 2006


David M. Cooke wrote:

>cookedm at physics.mcmaster.ca (David M. Cooke) writes:
>  
>
>>Yeah, I was going to stare at the assembly output from gcc before
>>deciding.
>>
>>Note that some functions that are supported directly by the CPU may
>>still be a function call because they aren't good enough.
>>    
>>
>
>... and a quick test shows me that with gcc 4 under linux, only sqrt
>is inlined (and it does a test for NaN (I think) and calls the C
>library sqrt on that). On PowerPC under OS X, even sqrt is a function
>call.
>  
>
There were some posts earlier showing that numarray had faster sin(x) 
functions on an INTEL platform (with a particular compiler that I'm not 
sure was specified).  I'm pretty sure the difference was the function 
call versus the inline sin computation that the compiler used. 

I bet it depends on the compiler.  But, you bring up a good point that 
the on-chip provided functions might not be "math-lib" worthy according 
to different compilers.  It would be nice if there was still some way to 
use them though letting the user decide if they were "good enough"


-Travis

      




More information about the Numpy-discussion mailing list