From: Ulrich Drepper Date: Wed, 16 Aug 2000 02:36:25 +0000 (+0000) Subject: (fedisableexcept): Mask, not unmask, exceptions. X-Git-Tag: cvs/glibc-2_1_93~206 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad04a62fbebe86aae6189a641ef0816b2de2b84e;p=thirdparty%2Fglibc.git (fedisableexcept): Mask, not unmask, exceptions. --- diff --git a/sysdeps/i386/fpu/fedisblxcpt.c b/sysdeps/i386/fpu/fedisblxcpt.c index 0cb570f5622..019366e1c88 100644 --- a/sysdeps/i386/fpu/fedisblxcpt.c +++ b/sysdeps/i386/fpu/fedisblxcpt.c @@ -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 , 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; diff --git a/sysdeps/i386/fpu/feenablxcpt.c b/sysdeps/i386/fpu/feenablxcpt.c index b9877d4e148..f284306c4e2 100644 --- a/sysdeps/i386/fpu/feenablxcpt.c +++ b/sysdeps/i386/fpu/feenablxcpt.c @@ -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 , 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;