public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/zack/more-obsolete-typedefs] [powerpc] fegetexcept: utilize function instead of duplicating code
@ 2019-06-18 15:29 Zack Weinberg
  0 siblings, 0 replies; only message in thread
From: Zack Weinberg @ 2019-06-18 15:29 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0158473d8ff72d97e2163f66dcd8fb627fee4645

commit 0158473d8ff72d97e2163f66dcd8fb627fee4645
Author: Paul A. Clarke <pc@us.ibm.com>
Date:   Wed Jun 5 08:50:37 2019 -0500

    [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.

Diff:
---
 ChangeLog                         |  5 +++++
 sysdeps/powerpc/fpu/fegetexcept.c | 14 +-------------
 2 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d15a68a..82ae580 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2019-06-05  Paul A. Clarke  <pc@us.ibm.com>
+
+	* sysdeps/powerpc/fpu/fegetexcept.c (__fegetexcept): Replace code
+	with call to equivalent function.
+
 2019-06-04  Florian Weimer  <fweimer@redhat.com>
 
 	* iconv/gconv_dl.c (release_handle): Remove file-level definition.
diff --git a/sysdeps/powerpc/fpu/fegetexcept.c b/sysdeps/powerpc/fpu/fegetexcept.c
index daa8812..2173d77 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)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-06-18 15:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-18 15:29 [glibc/zack/more-obsolete-typedefs] [powerpc] fegetexcept: utilize function instead of duplicating code Zack Weinberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).