summaryrefslogtreecommitdiff
path: root/sysdeps/powerpc/fpu/fegetexcept.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/powerpc/fpu/fegetexcept.c')
-rw-r--r--sysdeps/powerpc/fpu/fegetexcept.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/sysdeps/powerpc/fpu/fegetexcept.c b/sysdeps/powerpc/fpu/fegetexcept.c
index a053a32bfe..179e3c4e81 100644
--- a/sysdeps/powerpc/fpu/fegetexcept.c
+++ b/sysdeps/powerpc/fpu/fegetexcept.c
@@ -1,5 +1,5 @@
/* Get floating-point exceptions.
- Copyright (C) 2000-2018 Free Software Foundation, Inc.
+ Copyright (C) 2000-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Geoffrey Keating <geoffk@geoffk.org>, 2000.
@@ -15,7 +15,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <fenv_libc.h>
@@ -23,21 +23,9 @@ int
__fegetexcept (void)
{
fenv_union_t fe;
- int result = 0;
- fe.fenv = fegetenv_register ();
+ fe.fenv = fegetenv_control ();
- if (fe.l & (1 << (31 - FPSCR_XE)))
- result |= FE_INEXACT;
- if (fe.l & (1 << (31 - FPSCR_ZE)))
- result |= FE_DIVBYZERO;
- if (fe.l & (1 << (31 - FPSCR_UE)))
- result |= FE_UNDERFLOW;
- if (fe.l & (1 << (31 - FPSCR_OE)))
- result |= FE_OVERFLOW;
- if (fe.l & (1 << (31 - FPSCR_VE)))
- result |= FE_INVALID;
-
- return result;
+ return fenv_reg_to_exceptions (fe.l);
}
weak_alias (__fegetexcept, fegetexcept)