Revisiting More Complete long double Support

Joel Sherrill <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <CAF9ehCUXG5c1V0TAmJzQywu8u_mEsHhJhch03H61qsh9YuFBbw@mail.gmail.com>
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.

(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?

Thanks.

--joel
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.