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.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL 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 4063B26F94 for ; Fri, 31 May 2024 17:37:48 +0200 (CEST) Received: (qmail 6025 invoked by uid 550); 31 May 2024 15:37:43 -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 5993 invoked from network); 31 May 2024 15:37:43 -0000 Date: Fri, 31 May 2024 17:37:33 +0200 From: Szabolcs Nagy To: James Y Knight Cc: musl@lists.openwall.com, Nikolaos Chatzikonstantinou Message-ID: <20240531153733.GE3766212@port70.net> Mail-Followup-To: James Y Knight , musl@lists.openwall.com, Nikolaos Chatzikonstantinou References: <724090dc-83e7-4f40-9ff2-1a60196b9966@gmail.com> <20240529013411.GF10433@brightrain.aerifal.cx> <20240529125904.GC31267@brightrain.aerifal.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [musl] Re: Implementing csqrtl() * James Y Knight [2024-05-29 11:13:12 -0400]: > There is no impact on benchmarks by implementing fenv correctly, because, > per the C standard, it is undefined behavior to access the floating-point > status flags or to execute any code with non-default floating-point control > modes in effect unless "fenv_access" is enabled -- either using "#pragma > STDC FENV_ACCESS ON" in the code, or via an implementation-defined > mechanism to set the default to on (in clang, the command-line option > "-ffp-model=strict"). Because it's opt-in, only the code which actually > requires it takes the performance hit. note: the libc *must* opt-in if it tries to conform to c99 annex f. (at least for library calls that are expected to work in non-default rounding mode and math code that is specified to set exception flags.) so fenv correctness has an impact on libc and thus on code that calls into libc.