[PATCH] libm additions and corrections, 1 of 2

Howland Craig D (Craig) howland@LGSInnovations.com
Thu Mar 19 19:48:00 GMT 2009

     Even when long double routines are actually added, remapping when
long double is equivalent to double is a desirable thing to me because
saves code space.  Why have an identical function (redundant code,
space) or a wrapper (lose a tiny bit of efficiency; as is done when
is 32 bits) when it is possible to go straight to what you want?
     The only shortcoming with this specific method is that it is not a
full solution, only working when GCC is used.  (If only GCC is ever used
with Newlib, then it is 100%, but it does not seem to be a requirement.)

-----Original Message-----
From: newlib-owner@sourceware.org [mailto:newlib-owner@sourceware.org]
On Behalf Of Ken Werner
Sent: Thursday, March 19, 2009 10:32 AM
To: newlib@sourceware.org; Schwarz, Konrad; Howland Craig D (Craig)
Subject: Re: [PATCH] libm additions and corrections, 1 of 2

On Thursday 19 March 2009 14:22:55 Schwarz, Konrad wrote:
> > Hi,
> > I'm willing to rebase my patch if yours gets applied first.
> > Are there any
> > objections in general regarding mapping the long double
> > functions to their
> > counterparts on platforms where a double equals the long double
> > (http://sourceware.org/ml/newlib/2009/msg00244.html)?
> One thing that is required for ANSI conformance is that library
> are available as well.  I don't remember if your patch had this

The patch does not provide an implementation of the C99 long double
but their prototypes. It was intended to improve portability of existent
without implementing new routines in newlib. If the users code calls a
double function the generated assembler code will reference the double 
equivalent. The mechanism is described in GCCs info page 5.36
Names Used in Assembler Code". In fact the code links against the double

counterpart. In case the width of a long double changes in the future
things happened), formerly compiled code would still use the double

More information about the Newlib mailing list