From nobody Wed Jul 17 20:01:17 2024 X-Original-To: freebsd-numerics@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WPRdz11Pvz5QHXT for ; Wed, 17 Jul 2024 20:01:27 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4WPRdy4WWYz4dLl for ; Wed, 17 Jul 2024 20:01:26 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Authentication-Results: mx1.freebsd.org; none Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.17.1/8.17.1) with ESMTP id 46HK1Hsv014813; Wed, 17 Jul 2024 13:01:17 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) DKIM-Filter: OpenDKIM Filter v2.10.3 troutmask.apl.washington.edu 46HK1Hsv014813 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=troutmask.apl.washington.edu; s=troutmask; t=1721246477; bh=3vCfsYAKL25t/s0GVV88Uu+mn9DxwUDVgQdvSqs4ecU=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=hH5P76qmonVsJHGL7OSQyeUpCFpZ/ysEiR9+OJjJVzn5OkNjmV76TtuvPPtbHQzg/ 61n5gcX+VsRf9x2TRWIXSX43QtMLuJaZV+D83hqOeVVbiLnFgp8r5JTZHx/goVHyTq qJ78z9hAFBQ3kKNok64BZ39KZw6z/jmc26ElCnR9wiFs+SVykWGYaCpa5wnk8uKrG5 /s7yeVrQruAN1WFyLwDPbOmp0w/CXijILCpvgtdPQAIaqNOFSY+vtQxXbMjsH0MldA DLf+FaTwGmpQClT3wtV8NeP9Qy3LDOM9nuj6GeaIU9VONHxBI2OS9M7S0pjijAS6YW gyC3IX0losNLA== Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.17.1/8.17.1/Submit) id 46HK1Hnm014812; Wed, 17 Jul 2024 13:01:17 -0700 (PDT) (envelope-from sgk) Date: Wed, 17 Jul 2024 13:01:17 -0700 From: Steve Kargl To: enh Cc: enh via freebsd-numerics Subject: Re: #pragma STDC FENV_ACCESS ON Message-ID: Reply-To: sgk@troutmask.apl.washington.edu References: List-Id: Discussions of high quality implementation of libm functions List-Archive: https://lists.freebsd.org/archives/freebsd-numerics List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-numerics@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:73, ipnet:128.95.0.0/16, country:US] X-Rspamd-Queue-Id: 4WPRdy4WWYz4dLl On Wed, Jul 17, 2024 at 01:30:39PM -0400, enh wrote: > i see lib/msun/src/e_sqrtl.c has `#pragma STDC FENV_ACCESS ON`, but > s_fma.c, s_fmaf.c, s_fmal.c, and s_nearbyint.c all use fesetround() or > fesetenv() too --- shouldn't they also have the pragma? > > (Android currently builds all of libm with that pragma, but (a) that > seems like a big hammer and (b) afaict upstream [you] don't, so this > is potentially causing problems^W^Wallowing the compiler to cause > problems for you?) Some of the compilers, which that are used to compile FreeBSD, do not support "#pragma STDC FENV_ACCESS ON". #include #include #pragma STDC FENV_ACCESS ON int main(void) { double x = 1, y = 3; printf ("x _ y = %la\n", x + y); return 0; } % gcc13 -c -Wall a.c .c:5: warning: ignoring '#pragma STDC FENV_ACCESS' [-Wunknown-pragmas] 5 | #pragma STDC FENV_ACCESS ON | -- Steve