]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(fedisableexcept): Mask, not unmask, exceptions.
authorUlrich Drepper <drepper@redhat.com>
Wed, 16 Aug 2000 02:36:25 +0000 (02:36 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 16 Aug 2000 02:36:25 +0000 (02:36 +0000)
sysdeps/i386/fpu/fedisblxcpt.c
sysdeps/i386/fpu/feenablxcpt.c

index 0cb570f56220807a0fc640139fd2f69872d144fe..019366e1c888482eda2934e24ca26249d6294007 100644 (file)
@@ -1,5 +1,5 @@
 /* Disable floating-point exceptions.
-   Copyright (C) 1999 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Andreas Jaeger <aj@suse.de>, 1999.
 
@@ -24,15 +24,15 @@ int
 fedisableexcept (int excepts)
 {
   unsigned short int new_exc, old_exc;
-  
+
   /* Get the current control word.  */
   __asm__ ("fstcw %0" : "=m" (*&new_exc));
-  
+
   old_exc = new_exc & FE_ALL_EXCEPT;
 
   excepts &= FE_ALL_EXCEPT;
-  
-  new_exc &= ~excepts;
+
+  new_exc |= excepts;
   __asm__ ("fldcw %0" : : "m" (*&new_exc));
 
   return old_exc;
index b9877d4e14807496cedd56770661dbb83c8edf60..f284306c4e237e44f41700c1c17a90769dc2ac7b 100644 (file)
@@ -1,5 +1,5 @@
 /* Enable floating-point exceptions.
-   Copyright (C) 1999 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Andreas Jaeger <aj@suse.de>, 1999.
 
@@ -31,7 +31,7 @@ feenableexcept (int excepts)
   excepts &= FE_ALL_EXCEPT;
   old_exc = new_exc & FE_ALL_EXCEPT;
 
-  new_exc |= excepts;
+  new_exc &= ~excepts;
   __asm__ ("fldcw %0" : : "m" (*&new_exc));
 
   return old_exc;