Date: Wed, 17 Jul 2024 16:47:01 -0400 From: enh <enh@google.com> To: sgk@troutmask.apl.washington.edu Cc: enh via freebsd-numerics <freebsd-numerics@freebsd.org> Subject: Re: #pragma STDC FENV_ACCESS ON Message-ID: <CAJgzZooM%2B7ECj2fu0CbE-Lm3HF3NPXzEE1zsFGicRGwitVYnYg@mail.gmail.com> In-Reply-To: <ZpgpEc5zKPeEThzK@troutmask.apl.washington.edu> References: <CAJgzZoopJT3AJM8cbWzPjheKkcO9bAXXjVauw5g08bb=hgWeHQ@mail.gmail.com> <ZpgjDUvZc90-QfWW@troutmask.apl.washington.edu> <CAJgzZorpyKCE8RPiaDYED33dfck=%2BLVqcoDO8oWbUQRpfRe4mw@mail.gmail.com> <ZpgpEc5zKPeEThzK@troutmask.apl.washington.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jul 17, 2024 at 4:27=E2=80=AFPM Steve Kargl <sgk@troutmask.apl.washington.edu> wrote: > > On Wed, Jul 17, 2024 at 04:16:33PM -0400, enh wrote: > > On Wed, Jul 17, 2024 at 4:01=E2=80=AFPM Steve Kargl > > <sgk@troutmask.apl.washington.edu> wrote: > > > > > > 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) tha= t > > > > seems like a big hammer and (b) afaict upstream [you] don't, so thi= s > > > > 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". > > > > that's why you have a line in the Makefile to quiet the warning :-) > > > > (remember you _do_ have this #pragma in e_sqrtl.c already.) > > > > Then your original post is simply a rhetorical question? no. i said: 1. e_sqrtl.c has `#pragma STDC FENV_ACCESS ON` 2. s_fma.c, s_fmaf.c, s_fmal.c, and s_nearbyint.c all use fesetround() or fesetenv() but _don't_ have the pragma that is: #1 implies you think this is needed, but #2 shows that it's inconsistently applied in places where it's needed. > Consider it future-proofing for when all compilers supprt > the pragma. "future proofing" is exactly why i'm suggesting you should probably have the pragma in the other files that use the relevant functions :-) > -- > Steve >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJgzZooM%2B7ECj2fu0CbE-Lm3HF3NPXzEE1zsFGicRGwitVYnYg>