From patchwork Fri May 23 15:49:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wilco Dijkstra X-Patchwork-Id: 1101 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx20.g.dreamhost.com (mx2.sub5.homie.mail.dreamhost.com [208.113.200.128]) by wilcox.dreamhost.com (Postfix) with ESMTP id E377E360073 for ; Fri, 23 May 2014 08:49:14 -0700 (PDT) Received: by homiemail-mx20.g.dreamhost.com (Postfix, from userid 14307373) id A86D541CDF4AF; Fri, 23 May 2014 08:49:14 -0700 (PDT) X-Original-To: glibc@patchwork.siddhesh.in Delivered-To: x14307373@homiemail-mx20.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx20.g.dreamhost.com (Postfix) with ESMTPS id 73D8041CDF4A6 for ; Fri, 23 May 2014 08:49:14 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type; q=dns; s=default; b=V0fh2i8FNrdaziFj1zq4ZSOPu8JLz 2cCRPUoPgCz/qF92UyqI2Psc3mU+lQpfpUrKCwAPIGM65qoy60UAzoY/eUmstVyh xnaAL5XFAHTXAlcl67Ooxf74J1ukpx52DAtU/571GwhvGMIAqIRBA1WAroZKWOSP Esd/6/dzblLc2o= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type; s=default; bh=xjgqIkSUHP56plf68GfZG+oxGfc=; b=nz8 fEw5Zupu2MaVIKPCqQydmQhwdqCHsGm2DnErqPC0ACO4kssaMaaiyvoPzdwbFcOW gwMuUHUXKeKwPRqQRBQjHLc5oEa9sJO5UpfMnYU3UInSlwHtLjxxD+qX+zKfnOxj WdXt62/ssljcrGJMtmPNE7lT9hntXPW7CXVEoDE4= Received: (qmail 16253 invoked by alias); 23 May 2014 15:49:12 -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 16236 invoked by uid 89); 23 May 2014 15:49:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: service87.mimecast.com From: "Wilco" To: Subject: [PATCH 2/2] Aarch64: Cleanup math_private.h Date: Fri, 23 May 2014 16:49:04 +0100 Message-ID: <001501cf769e$864dcdf0$92e969d0$@com> MIME-Version: 1.0 X-MC-Unique: 114052316490809901 X-DH-Original-To: glibc@patchwork.siddhesh.in Hi, This is a series of patches to cleanup the aarch64 fenv implementation. The second uses _FPU_FPCR_RM_MASK for the rounding mask instead of FE_TOWARDZERO. Ok for commit? Wilco ChangeLog: 2014-05-23 Wilco * sysdeps/aarch64/fpu/math_private.h (libc_fesetround_aarch64) (libc_feholdexcept_setround_aarch64) (libc_feholdsetround_aarch64) (libc_feresetround_aarch64) (libc_feholdsetround_aarch64_ctx): Use _FPU_FPCR_RM_MASK for rounding mask rather than FE_TOWARDZERO. * sysdeps/aarch64/fpu/get-rounding-mode.h (get_rounding_mode): Use _FPU_FPCR_RM_MASK for rounding mask rather than FE_TOWARDZERO. --- sysdeps/aarch64/fpu/get-rounding-mode.h | 2 +- sysdeps/aarch64/fpu/math_private.h | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sysdeps/aarch64/fpu/get-rounding-mode.h b/sysdeps/aarch64/fpu/get-rounding-mode.h index 5c1615d..425b50e 100644 --- a/sysdeps/aarch64/fpu/get-rounding-mode.h +++ b/sysdeps/aarch64/fpu/get-rounding-mode.h @@ -32,7 +32,7 @@ get_rounding_mode (void) fpu_control_t fpcr; _FPU_GETCW (fpcr); - return fpcr & FE_TOWARDZERO; + return fpcr & _FPU_FPCR_RM_MASK; } #endif /* get-rounding-mode.h */ diff --git a/sysdeps/aarch64/fpu/math_private.h b/sysdeps/aarch64/fpu/math_private.h index a3f466b..023c9d0 100644 --- a/sysdeps/aarch64/fpu/math_private.h +++ b/sysdeps/aarch64/fpu/math_private.h @@ -58,7 +58,7 @@ libc_fesetround_aarch64 (int round) _FPU_GETCW (fpcr); /* Check whether rounding modes are different. */ - round = (fpcr ^ round) & FE_TOWARDZERO; + round = (fpcr ^ round) & _FPU_FPCR_RM_MASK; /* Set new rounding mode if different. */ if (__glibc_unlikely (round != 0)) @@ -84,7 +84,7 @@ libc_feholdexcept_setround_aarch64 (fenv_t *envp, int round) /* Clear exception flags, set all exceptions to non-stop, and set new rounding mode. */ - new_fpcr = fpcr & ~((FE_ALL_EXCEPT << FE_EXCEPT_SHIFT) | FE_TOWARDZERO); + new_fpcr = fpcr & ~((FE_ALL_EXCEPT << FE_EXCEPT_SHIFT) | _FPU_FPCR_RM_MASK); new_fpcr |= round; new_fpsr = fpsr & ~FE_ALL_EXCEPT; @@ -190,7 +190,7 @@ libc_feholdsetround_aarch64 (fenv_t *envp, int round) envp->__fpsr = fpsr; /* Check whether rounding modes are different. */ - round = (fpcr ^ round) & FE_TOWARDZERO; + round = (fpcr ^ round) & _FPU_FPCR_RM_MASK; /* Set new rounding mode if different. */ if (__glibc_unlikely (round != 0)) @@ -210,7 +210,7 @@ libc_feresetround_aarch64 (fenv_t *envp) _FPU_GETCW (fpcr); /* Check whether rounding modes are different. */ - round = (envp->__fpcr ^ fpcr) & FE_TOWARDZERO; + round = (envp->__fpcr ^ fpcr) & _FPU_FPCR_RM_MASK; /* Restore the rounding mode if it was changed. */ if (__glibc_unlikely (round != 0)) @@ -236,7 +236,7 @@ libc_feholdsetround_aarch64_ctx (struct rm_ctx *ctx, int r) ctx->env.__fpsr = fpsr; /* Check whether rounding modes are different. */ - round = (fpcr ^ r) & FE_TOWARDZERO; + round = (fpcr ^ r) & _FPU_FPCR_RM_MASK; ctx->updated_status = round != 0; /* Set the rounding mode if changed. */