about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorPaul A. Clarke <pc@us.ibm.com>2019-06-05 08:50:37 -0500
committerPaul A. Clarke <pc@us.ibm.com>2019-06-05 19:38:10 -0500
commit0158473d8ff72d97e2163f66dcd8fb627fee4645 (patch)
tree383bcfb6e8066d5fedae49e152be965c305be1fc /sysdeps
parente863dbf6b26bfddf7c1e5faa1cbf41a5a3ee1382 (diff)
downloadglibc-0158473d8ff72d97e2163f66dcd8fb627fee4645.tar.gz
glibc-0158473d8ff72d97e2163f66dcd8fb627fee4645.tar.xz
glibc-0158473d8ff72d97e2163f66dcd8fb627fee4645.zip
[powerpc] fegetexcept: utilize function instead of duplicating code
fegetexcept() included code which exactly duplicates the code in
fenv_reg_to_exceptions().  Replace with a call to that function.

2019-06-05  Paul A. Clarke  <pc@us.ibm.com>

	* sysdeps/powerpc/fpu/fegetexcept.c (__fegetexcept): Replace code
	with call to equivalent function.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/powerpc/fpu/fegetexcept.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/sysdeps/powerpc/fpu/fegetexcept.c b/sysdeps/powerpc/fpu/fegetexcept.c
index daa8812ae0..2173d77d1d 100644
--- a/sysdeps/powerpc/fpu/fegetexcept.c
+++ b/sysdeps/powerpc/fpu/fegetexcept.c
@@ -23,21 +23,9 @@ int
 __fegetexcept (void)
 {
   fenv_union_t fe;
-  int result = 0;
 
   fe.fenv = fegetenv_register ();
 
-  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)