summaryrefslogtreecommitdiff
path: root/sysdeps/powerpc/fclrexcpt.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/powerpc/fclrexcpt.c')
-rw-r--r--sysdeps/powerpc/fclrexcpt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sysdeps/powerpc/fclrexcpt.c b/sysdeps/powerpc/fclrexcpt.c
index 1e66140c2e..cfcf175637 100644
--- a/sysdeps/powerpc/fclrexcpt.c
+++ b/sysdeps/powerpc/fclrexcpt.c
@@ -19,6 +19,7 @@
#include <fenv_libc.h>
+#undef feclearexcept
void
feclearexcept (int excepts)
{
@@ -28,7 +29,8 @@ feclearexcept (int excepts)
u.fenv = fegetenv_register ();
/* Clear the relevant bits. */
- u.l[1] = u.l[1] & ~FE_to_sticky (excepts);
+ u.l[1] = u.l[1] & ~(-((excepts) >> 31-FPSCR_VX & 1) & FE_ALL_INVALID
+ | (excepts) & FPSCR_STICKY_BITS);
/* Put the new state in effect. */
fesetenv_register (u.fenv);