fenv-exceptions-tracking-c99: Work around a NetBSD/x86_64 bug

2023-11-04 Thread Bruno Haible
On NetBSD/x86_64, I see test failures in soon-to-be-added unit tests. The cause is that fetestexcept(), which of course is meant to be side-effect-free, clears the exception trap bits. The bug is evident from looking at the definition of fetestexcept()

fenv-exceptions-tracking-c99: Fix fetestexcept() override for AIX

2023-11-04 Thread Bruno Haible
On AIX, when I force the inclusion of the fetestexcept() override, through an added REPLACE_FETESTEXCEPT=1 in the *.m4 files, and use a gcc-compatible compiler, I see unit test failures: ../../gltests/test-fenv-except-state-3.c:56: assertion 'fetestexcept (FE_INVALID) == FE_INVALID' failed

Re: new module 'fenv-exceptions-state-c99'

2023-11-04 Thread Bruno Haible
This patch fixes a compilation error on FreeBSD, when I use gl_cv_func_fesetexceptflag_in_libm=no \ gl_cv_func_fesetexceptflag_no_libm=no \ ./configure for testing the override code. 2023-11-04 Bruno Haible fenv-exceptions-state-c99: Fix compilation error on FreeBSD.

fenv-exceptions-trapping: Fix for powerpc* platforms

2023-11-04 Thread Bruno Haible
I had made a mistake in the override code for powerpc. This patch fixes it. 2023-11-04 Bruno Haible fenv-exceptions-trapping: Fix for powerpc* platforms. * lib/fenv-except-trapping.c (feenableexcept, fedisableexcept) [powerpc]: Use the correct bit mask for the trap

Re: new module 'fenv-exceptions-tracking-c99'

2023-11-04 Thread Bruno Haible
Two small patches: 1) On NetBSD 8.0/sparc, I see a test failure of test-fenv-except-tracking-2 regarding 'long double's. Certainly due to the software floating-point routines. 2) The Cygwin fraiseexcept bug has been acknowledged and fixed:

Re: new module 'fenv'

2023-11-04 Thread Bruno Haible
Here's a doc addition, regarding a problem with MSVC, for which Gnulib cannot provide a workaround: 2023-11-04 Bruno Haible fenv: Document an ABI break on MSVC. * doc/posix-headers/fenv.texi: Document why fegetround and fesetround are seemingly broken on MSVC. diff

Re: new module 'fenv-rounding'

2023-11-04 Thread Bruno Haible
> * m4/fenv-rounding.m4: New file. Oops, there was a mistake here, and in other places as well: Everywhere where an Autoconf macro uses $host, $host_os, or $host_cpu, it needs to first require AC_CANONICAL_HOST. Otherwise the value of such a variable may come out as empty. 2023-11-04

Re: fenv-rounding: Improve code for MSVC

2023-11-04 Thread Bruno Haible
This patch improves the fenv-rounding code for MSVC: - It works around the fact that the values of FE_UPWARD and FE_DOWNWARD have been swapped. - Since MSVC uses only the SSE unit and delegates no arithmetic operations to the 387 unit (with its excess precision flaws), it's sufficient

Re: new module 'fenv-rounding'

2023-11-04 Thread Bruno Haible
On NetBSD 8.0/sparc64, I see a test failure of the fenv-rounding test for 'long double' operations. On this platform, 'long double' operations are implemented by a software floating-point library. Apparently this library code ignores the rounding direction. This patch avoids the test failure and