public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Eric Bresie <ebresie@gmail.com>
To: "newlib@sourceware.org" <newlib@sourceware.org>
Subject: Re: Re: [PATCH 0/3] ARM with only 32-bit floats do not have fast 64-bit FMA
Date: Mon, 7 Sep 2020 09:09:25 -0500	[thread overview]
Message-ID: <91e9c460-6029-445f-bab5-c180372ff7aa@iPad> (raw)
In-Reply-To: 0031e3fa-e236-1a4a-09b8-7d1ec82e943e@embedded-brains.de

Not directly related (and as I’m not really an expert on these things, nor able to change in any way) but was looking at the code mentioned and saw line like:

if (x == 0.0 || y == 0.0)

return (x * y + z);

If either x or y is zero would it be better to just return z and avoid an extra multiplication operation here?
Eric Bresie
Ebresie@gmail.com

> On September 2, 2020 at 12:59:43 PM CDT, Sebastian Huber <sebastian.huber@embedded-brains.de> wrote:
> On 02/09/2020 19:12, Joseph Myers wrote:
>
> > On Wed, 2 Sep 2020, Sebastian Huber wrote:
> >
> > > https://sourceware.org/git/?p=glibc.git;a=blob;f=math/s_fma.c;h=4d73af4f65d511594b2395d032a135721c578484;hb=HEAD
> > No glibc configurations use that; they all use either a hardware
> > instruction, an implementation based on sticky rounding as described by
> > Boldo and Melquiond, or, in the absence of hardware exceptions and
> > rounding modes, a soft-fp implementation.
>
> Sorry for pointing to this dead code in glibc.
>
> Maybe we can use the FreeBSD implementation:
>
> https://github.com/freebsd/freebsd/blob/master/lib/msun/src/s_fma.c
>
> It is probably also used by Bionic:
>
> https://android.googlesource.com/platform/bionic/+/refs/heads/master/libm/upstream-freebsd/lib/msun/src/s_fma.c
>

             reply	other threads:[~2020-09-07 14:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-07 14:09 Eric Bresie [this message]
2020-09-07 17:16 ` Keith Packard
2020-09-07 20:16   ` Brian Inglis
2020-09-07 22:23     ` Keith Packard

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=91e9c460-6029-445f-bab5-c180372ff7aa@iPad \
    --to=ebresie@gmail.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).