Re: Revisiting More Complete long double Support

Corinna Vinschen <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
On Aug 17 17:06, Joel Sherrill wrote:
> Hi
> 
> I'm looking at newlib long double support again when sizeof(long double) !=
> sizeof(double).
> 
> (1) Merged FreeBSD C code for long double math
> 
> FreeBSD has C code for long double math routines as default implementation:
> 
> https://github.com/freebsd/freebsd-src/tree/main/lib/msun/src
> 
> I **THINK** those will work if LDBL != DBL so that code might need the
> ifdef for LDBL_EQ_DBL to pick the current newlib common implementation of
> the method which just calls the normal version of the method.  I code even
> add the files as XXX_freebsd.c and only add
> 
> ifdef _LDBL_EQ_DBL
> long double
> acosl (long double x)
> {
>   return acos(x);
> }
> #else
> #include "acosl_freebsd.c"
> #endif
> 
> which would definitely avoid edits to the FreeBSD source.

Question is, do we really still need this?

These #ifdef have been added just as a cheap workaround for small
targets, because nobody provided the actual long double implementations,
yet.  If we merge the actual long double implementations from FreeBSD,
there's no need for this anymore and we can probably drop the
_LDBL_EQ_DBL flag entirely.

If we just merge the long double code from FreeBSD's lib/msun/src
into our libm/common dir...

> (2) More i386 assembly versions
> 
> Then there appears to be some long double methods for the i386/87 here
> which newlib doesn't currently have:
> 
> https://github.com/freebsd/freebsd-src/tree/main/lib/msun/i387
> 
> Thoughts on adding this long double code from FreeBSD?

...and merge the occasional CPU-specific assembler code from
FreeBSD's lib/msun/<cpu> into our libm/machine/<cpu> dir, that
should work nicely.


Corinna
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.