This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: Pow very slow on x86_64
- From: Ryan Arnold <rsa at us dot ibm dot com>
- To: philippe marguinaud <pmarguinaud at yahoo dot com>
- Cc: libc-help at sourceware dot org
- Date: Wed, 28 Jan 2009 10:46:38 -0600
- Subject: Re: Pow very slow on x86_64
- References: <543134.75160.qm@web111109.mail.gq1.yahoo.com>
- Reply-to: rsa at us dot ibm dot com
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
>
>
>
>
>