]> Savannah Git Hosting - gnulib.git/commitdiff
fenv-exceptions-trapping: Fix for powerpc* platforms.
authorBruno Haible <bruno@clisp.org>
Sat, 4 Nov 2023 15:54:43 +0000 (16:54 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 4 Nov 2023 15:54:43 +0000 (16:54 +0100)
* lib/fenv-except-trapping.c (feenableexcept, fedisableexcept)
[powerpc]: Use the correct bit mask for the trap bits.
* tests/test-fenv-except-trapping-2.c (main): Reenable the '9' tests on
powerpc platforms.

ChangeLog
lib/fenv-except-trapping.c
tests/test-fenv-except-trapping-2.c

index 66e5ce0da9db47e6c1497e54390b67631bd7d828..55a85289f50055821380bdeee9322c5ec3f44521 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2023-11-04  Bruno Haible  <bruno@clisp.org>
+
+       fenv-exceptions-trapping: Fix for powerpc* platforms.
+       * lib/fenv-except-trapping.c (feenableexcept, fedisableexcept)
+       [powerpc]: Use the correct bit mask for the trap bits.
+       * tests/test-fenv-except-trapping-2.c (main): Reenable the '9' tests on
+       powerpc platforms.
+
 2023-11-04  Bruno Haible  <bruno@clisp.org>
 
        fenv-exceptions-state-c99: Fix compilation error on FreeBSD.
index a86cbd2d39d2e2e9824d2d035692ecf89387f39c..554f8128de771e0eba9c7fb64437ed2c61959272 100644 (file)
@@ -505,7 +505,7 @@ feenableexcept (int exceptions)
 
   if (!(memenv.u == orig_memenv.u))
     {
-      if ((orig_memenv.u & 0x000000f7) == 0 && (memenv.u & 0x000000f7) != 0)
+      if ((orig_memenv.u & 0x000000f8) == 0 && (memenv.u & 0x000000f8) != 0)
         {
           /* Put the thread into precise trapping mode.  */
 #  if defined __linux__ || defined __NetBSD__
@@ -537,7 +537,7 @@ fedisableexcept (int exceptions)
     {
       _FPU_SETCW_AS_DOUBLE (memenv.f);
 
-      if ((orig_memenv.u & 0x000000f7) != 0 && (memenv.u & 0x000000f7) == 0)
+      if ((orig_memenv.u & 0x000000f8) != 0 && (memenv.u & 0x000000f8) == 0)
         {
           /* Put the thread into no-trapping mode.  */
 #  if defined __linux__ || defined __NetBSD__
index 18f42b89c2c6624281982743fe8e59843231a48c..99a67d09694ec6c992cf8c8aada35e6ff86d6a3f 100644 (file)
@@ -448,10 +448,8 @@ main (int argc, char *argv[])
       #if defined __i386 || defined _M_IX86
       known_failure |= (operation_arg[0] == '7' || operation_arg[0] == '8');
       #endif
-      /* The '9' tests do not work on Linux/alpha, musl libc/powerpc64le,
-         AIX/powerpc.  */
-      #if (__GLIBC__ >= 2 && defined __alpha) \
-          || ((defined MUSL_LIBC || defined _AIX) && defined __powerpc__)
+      /* The '9' tests do not work on Linux/alpha.  */
+      #if (__GLIBC__ >= 2 && defined __alpha)
       known_failure |= (operation_arg[0] == '9');
       #endif
       /* The 'l' tests do not work on Linux/loongarch64 with glibc 2.37.