Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240828204725.GI10433@brightrain.aerifal.cx>
Date: Wed, 28 Aug 2024 16:47:25 -0400
From: Rich Felker <dalias@...c.org>
To: Alexander Monakov <amonakov@...ras.ru>
Cc: musl@...ts.openwall.com,
	Alex Rønne Petersen <alex@...xrp.com>
Subject: Re: [PATCH] configure: prevent compilers from turning a * b +
 c into fma(a, b, c)

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

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.