This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Pow very slow on x86_64


On Tue, 2009-01-27 at 07:33 -0800, philippe marguinaud wrote:
> Hi all,
> 
> I have some trouble with pow on x86_64. Computing x^r with x close to 1. and r = 0.25 takes ages. The problem does not occur when compiling with -m32 and on x86. Here comes a piece of code:

A quick check of the code would be reveal what's going on but I got the
following email from Paul Murphy about this:

"I am pretty sure most of the libm functions for 32 bit are hand coded
in assembly. The x87 instruction set makes it very simple to code pow. I
am pretty sure x86_64 uses the generic implementation in libm.

The 32 bit code is probably much, much more predictable and stable in
the amount of time it takes to execute on a given input."

Ryan S. Arnold
> 
> 
> 
>       
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]