This is the mail archive of the newlib@sourceware.org mailing list for the newlib 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: bug in logarithm()


Patrick Mansfield wrote:
On Wed, Oct 17, 2007 at 12:28:47PM +0200, Martin Koeppe wrote:
Hi again,

I'm using newlib on a i386 architecture, and now I wonder if it's possible to configure libm in such a way that the fast asm versions of e.g. log() are used. In my current newlib-libm.a there are the entry points for _f_log() etc., but apparently log() doesn't make use of _f_log().

(How) Is it possible to configure newlib's libm to make use of _f_log within log()?

Thank you very much

They aren't compatible per comments in the code. You could call them directly. AFAIUI there should be prototypes and proper names (without underscore prefix, like #define f_log _f_log) for them in newlib, but I don't see any.

-- Patrick Mansfield
Actually, they are meant to be called when the user specifies -ffast-math on the compilation.

The definitions used to be part of libc/include/machine/fastmath.h with an i386 check. This got inadvertently left out when we initially made the transition of newlib from internal to external repositories.

Anyway, I have added libc/machine/i386/machine/fastmath.h based on the older sources plus a few changes. If you compile your code with the -ffast-math option, <math.h> will bring in <machine/fastmath.h> and you will get access to the few fast math routines available for x86, including log().

-- Jeff J.


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