From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id 524382DAC8 for ; Wed, 28 Aug 2024 22:47:38 +0200 (CEST) Received: (qmail 1469 invoked by uid 550); 28 Aug 2024 20:47:34 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 1427 invoked from network); 28 Aug 2024 20:47:33 -0000 Date: Wed, 28 Aug 2024 16:47:25 -0400 From: Rich Felker To: Alexander Monakov Cc: musl@lists.openwall.com, Alex =?utf-8?B?UsO4bm5l?= Petersen Message-ID: <20240828204725.GI10433@brightrain.aerifal.cx> References: <20240828152826.826990-1-alex@alexrp.com> <20240828201514.GH10433@brightrain.aerifal.cx> <2f89009e-4290-90d7-d625-09dbf879340a@ispras.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2f89009e-4290-90d7-d625-09dbf879340a@ispras.ru> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] [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