From patchwork Thu Sep 19 18:46:46 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: 1164797 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-105265-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=us.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="USlKeiuu"; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 46Z5S04HMFz9sN1 for ; Fri, 20 Sep 2019 04:47:12 +1000 (AEST) 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:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=YZmS0/QqcmQoGfXLdxRMFEP1I+Z3m+o eWroqRqEEd7I78K2Npp5jWgVpoMRc+2+jKb4UYVNbEebFewVjduL3oKwXsxiQlcY nP2+Uis6LReBZB+IiOKvJuYg8zOHnpFYkVM+qImLEeR7ys+9VlyeA3bQD7CzTbBp VNgThGNcPbMI= 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:cc:subject:date:message-id:in-reply-to :references; s=default; bh=/M6t15mC2ENXXzASOHJm3wVcMMI=; b=USlKe iuumTpP35Dd3GcPh1Obe/km8RgTvz3FN/Fvcm26RK11r+JNoUuOB4+BcPyF/HvHK pPWoSG82z7GlQUw4ooSyLG9v7wRqclJQ4Qk6eTiY8Rzq7abzSkvpijamhfa2xVnt KylI19g5/PecWtBuw6JzRGKjHycoIPTPb8+flc= Received: (qmail 70124 invoked by alias); 19 Sep 2019 18:46:58 -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 70077 invoked by uid 89); 19 Sep 2019 18:46:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.7 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=HX-Languages-Length:2220 X-HELO: mx0a-001b2d01.pphosted.com From: "Paul A. Clarke" To: libc-alpha@sourceware.org Cc: tuliom@ascii.art.br, murphyp@linux.ibm.com Subject: [PATCH v2 2/6] [powerpc] No need to enter "Ignore Exceptions Mode" Date: Thu, 19 Sep 2019 13:46:46 -0500 Message-Id: <1568918810-20393-3-git-send-email-pc@us.ibm.com> In-Reply-To: <1568918810-20393-1-git-send-email-pc@us.ibm.com> References: <1568918810-20393-1-git-send-email-pc@us.ibm.com> From: "Paul A. Clarke" Since at least POWER8, there is no performance advantage to entering "Ignore Exceptions Mode", and doing so conditionally requires the conditional logic as well as a system call. Make it a no-op. 2019-09-19 Paul A. Clarke * sysdeps/powerpc/fpu/fenv_libc.h: (__ENTER_NON_STOP): New. (__EXIT_NON_STOP): New. (__TEST_AND_ENTER_NON_STOP): Use __ENTER_NON_STOP. (__TEST_AND_EXIT_NON_STOP): Use __EXIT_NON_STOP. Reviewed-By: Paul E Murphy --- v2: This is a new patch in the series. sysdeps/powerpc/fpu/fenv_libc.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/sysdeps/powerpc/fpu/fenv_libc.h b/sysdeps/powerpc/fpu/fenv_libc.h index bc2684e..549defa 100644 --- a/sysdeps/powerpc/fpu/fenv_libc.h +++ b/sysdeps/powerpc/fpu/fenv_libc.h @@ -27,6 +27,14 @@ extern const fenv_t *__fe_nomask_env_priv (void); extern const fenv_t *__fe_mask_env (void) attribute_hidden; +#ifdef _ARCH_PWR8 +/* There is no performance advantage to non-stop mode. */ +#define __ENTER_NON_STOP() do {} while (0) +#else +#define __ENTER_NON_STOP() do { (void) __fe_mask_env (); } while (0) +#endif +#define __EXIT_NON_STOP() do { (void) __fe_nomask_env_priv (); } while (0) + /* If the old env had any enabled exceptions and the new env has no enabled exceptions, then mask SIGFPE in the MSR FE0/FE1 bits. This may allow the FPU to run faster because it always takes the default action and can not @@ -34,7 +42,7 @@ extern const fenv_t *__fe_mask_env (void) attribute_hidden; #define __TEST_AND_ENTER_NON_STOP(old, new) \ do { \ if (((old) & FPSCR_ENABLES_MASK) != 0 && ((new) & FPSCR_ENABLES_MASK) == 0) \ - (void) __fe_mask_env (); \ + __ENTER_NON_STOP (); \ } while (0) /* If the old env has no enabled exceptions and the new env has any enabled @@ -44,7 +52,7 @@ extern const fenv_t *__fe_mask_env (void) attribute_hidden; #define __TEST_AND_EXIT_NON_STOP(old, new) \ do { \ if (((old) & FPSCR_ENABLES_MASK) == 0 && ((new) & FPSCR_ENABLES_MASK) != 0) \ - (void) __fe_nomask_env_priv (); \ + __EXIT_NON_STOP (); \ } while (0) /* The sticky bits in the FPSCR indicating exceptions have occurred. */