public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Paul Zimmermann <Paul.Zimmermann@inria.fr>
Cc: libc-alpha@sourceware.org
Subject: Re: use of fma
Date: Wed, 28 Apr 2021 10:25:53 +0200	[thread overview]
Message-ID: <87sg3ake7i.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <mwv986oos8.fsf@tomate.loria.fr> (Paul Zimmermann's message of "Wed, 28 Apr 2021 09:23:51 +0200")

* Paul Zimmermann:

> However, on PowerPC __FP_FAST_FMA is defined without -march=native:
>
> pzimmermann@drac-12:~$ gcc -O2 -g -dM -E -xc /dev/null | grep -q __FP_FAST_FMA
> pzimmermann@drac-12:~$ echo $?
> 0

I assume that this is powerpc64le, which has a POWER8 baseline.  The
switch to little endian neatly eliminated requirements for backwards
compatibility.

> Would it make sense to add -march=native to CFLAGS, or to add an option
> like --enable-fma to configure?

This is already covered by the existing mechanisms for compiler flag
changes.  The problem is that not all x86 CPUs currently in production
support FMA.  We aren't even at the stage yet where we could discuss
phasing out support for old CPUs.  So building everything to require FMA
by default would break things for users.

We already have some FMA-using function variants selected by IFUNC
resolvers.  Search for “ifunc-fma” in the source tree for examples.
More could be added if beneficial.

If you have FMA-capable hardware and want to build glibc to take
advantage of it unconditionally (without IFUNCs), use GCC 11 and
-march=x86-64-v3.  It should be compatible with all such CPUs, and the
build will also use additional CPU features not present in the x86-64
baseline specification.

Thanks,
Florian


  reply	other threads:[~2021-04-28  8:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-28  7:23 Paul Zimmermann
2021-04-28  8:25 ` Florian Weimer [this message]
2021-04-28  8:42   ` Paul Zimmermann
2021-04-28  9:06     ` Florian Weimer
2021-04-28 17:29     ` Joseph Myers
2021-04-28 15:00   ` Tulio Magno Quites Machado Filho
2021-04-28 15:18     ` Paul Zimmermann
2021-04-28 15:45       ` Tulio Magno Quites Machado Filho
2021-04-28 17:46         ` Joseph Myers

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=87sg3ake7i.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=Paul.Zimmermann@inria.fr \
    --cc=libc-alpha@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).