From patchwork Wed Jun 5 14:11:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul A. Clarke" X-Patchwork-Id: 33028 Received: (qmail 65413 invoked by alias); 5 Jun 2019 14:11:20 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 65405 invoked by uid 89); 5 Jun 2019 14:11:20 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 spammy=utilize X-HELO: mx0a-001b2d01.pphosted.com From: "Paul A. Clarke" To: libc-alpha@sourceware.org Cc: tuliom@ascii.art.br Subject: [PATCH] [powerpc] fegetexcept: utilize function instead of duplicating code Date: Wed, 5 Jun 2019 09:11:08 -0500 x-cbid: 19060514-0012-0000-0000-00001740AA6E X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00011218; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000286; SDB=6.01213610; UDB=6.00637875; IPR=6.00994683; MB=3.00027194; MTD=3.00000008; XFM=3.00000015; UTC=2019-06-05 14:11:12 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19060514-0013-0000-0000-0000578E40F2 Message-Id: <1559743868-6873-1-git-send-email-pc@us.ibm.com> From: "Paul A. Clarke" 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 * sysdeps/powerpc/fpu/fegetexcept.c (__fegetexcept): Replace code with call to equivalent function. Reviewed-by: Adhemerval Zanella --- sysdeps/powerpc/fpu/fegetexcept.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) 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)