summaryrefslogtreecommitdiff
path: root/sysdeps/s390/fpu/fclrexcpt.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/s390/fpu/fclrexcpt.c')
-rw-r--r--sysdeps/s390/fpu/fclrexcpt.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sysdeps/s390/fpu/fclrexcpt.c b/sysdeps/s390/fpu/fclrexcpt.c
index dd138086ab..b19899a2eb 100644
--- a/sysdeps/s390/fpu/fclrexcpt.c
+++ b/sysdeps/s390/fpu/fclrexcpt.c
@@ -1,5 +1,5 @@
/* Clear given exceptions in current floating-point environment.
- Copyright (C) 2000-2015 Free Software Foundation, Inc.
+ Copyright (C) 2000-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -29,7 +29,12 @@ feclearexcept (int excepts)
_FPU_GETCW (temp);
/* Clear the relevant bits. */
- temp &= ~((excepts << FPC_DXC_SHIFT)|(excepts << FPC_FLAGS_SHIFT));
+ temp &= ~(excepts << FPC_FLAGS_SHIFT);
+ if ((temp & FPC_NOT_FPU_EXCEPTION) == 0)
+ /* Bits 6, 7 of dxc-byte are zero,
+ thus bits 0-5 of dxc-byte correspond to the flag-bits.
+ Clear the relevant bits in flags and dxc-field. */
+ temp &= ~(excepts << FPC_DXC_SHIFT);
/* Put the new data in effect. */
_FPU_SETCW (temp);