public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Corinna Vinschen <vinschen@redhat.com>
To: newlib@sourceware.org
Subject: Re: Revisiting More Complete long double Support
Date: Thu, 18 Aug 2022 09:57:08 +0200	[thread overview]
Message-ID: <Yv3w1LDx2EiDquza@calimero.vinschen.de> (raw)
In-Reply-To: <CAF9ehCUXG5c1V0TAmJzQywu8u_mEsHhJhch03H61qsh9YuFBbw@mail.gmail.com>

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


  reply	other threads:[~2022-08-18  7:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-17 22:06 Joel Sherrill
2022-08-18  7:57 ` Corinna Vinschen [this message]
2022-08-18 14:49   ` Joel Sherrill
2022-08-18 19:16     ` Corinna Vinschen
2022-08-18 19:31       ` Joel Sherrill
2022-08-18 22:16         ` Joel Sherrill
2022-08-19  9:19           ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yv3w1LDx2EiDquza@calimero.vinschen.de \
    --to=vinschen@redhat.com \
    --cc=newlib@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).