Skip to content

Commit

Permalink
(fedisableexcept): Mask, not unmask, exceptions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulrich Drepper committed Aug 16, 2000
1 parent 9df7693 commit ad04a62
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions sysdeps/i386/fpu/fedisblxcpt.c
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions sysdeps/i386/fpu/feenablxcpt.c
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit ad04a62

Please sign in to comment.