mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: Alexander Monakov <amonakov@ispras.ru>
Cc: musl@lists.openwall.com, "Alex Rønne Petersen" <alex@alexrp.com>
Subject: Re: [musl] [PATCH] configure: prevent compilers from turning a * b + c into fma(a, b, c)
Date: Wed, 28 Aug 2024 16:47:25 -0400	[thread overview]
Message-ID: <20240828204725.GI10433@brightrain.aerifal.cx> (raw)
In-Reply-To: <2f89009e-4290-90d7-d625-09dbf879340a@ispras.ru>

On Wed, Aug 28, 2024 at 11:32:03PM +0300, Alexander Monakov wrote:
> 
> On Wed, 28 Aug 2024, Rich Felker wrote:
> 
> > With that said, I don't see how the compiler could ever generate calls
> > to fma(), since we're -ffreestanding, but I think it could generate
> > inline fma instructions on targets where they're available, and this
> > is generally undesirable (see above). For gcc, I think -std=c99
> > already has that covered, but I'm not sure what clang does.
> 
> Modern Clang implements the FP_CONTRACT pragma, with default state "on".
> Of course, the -ffp-contract= command-line switch is also available.

Even with -std=c99? In that case we should add the proposed:

tryflag CFLAGS_C99FSE -ffp-contract=off

I'm not clear on why the -mno-fused-madd would be needed. It should be
a no-op with -ffp-contract=off unless __builtin_fma were called
explicitly or something, no?

Rich

  reply	other threads:[~2024-08-28 20:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-28 15:28 Alex Rønne Petersen
2024-08-28 15:53 ` Alexander Monakov
2024-08-28 16:31   ` Alex Rønne Petersen
2024-08-28 20:15   ` Rich Felker
2024-08-28 20:32     ` Alexander Monakov
2024-08-28 20:47       ` Rich Felker [this message]
2024-08-28 21:11         ` Alexander Monakov
2024-08-29 13:37           ` Alex Rønne Petersen
2024-08-28 19:56 ` Alexander Monakov
2024-08-29 13:36   ` Alex Rønne Petersen
2024-08-29 15:09     ` Alexander Monakov

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=20240828204725.GI10433@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=alex@alexrp.com \
    --cc=amonakov@ispras.ru \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).