From patchwork Fri Feb 15 10:00:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 158500 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp532863jaa; Fri, 15 Feb 2019 02:24:15 -0800 (PST) X-Google-Smtp-Source: AHgI3Iac5hQmbV+jjBsh9axsZk0+coVOcw9eJZWXufkVx4FWHsFqsW5Ore7PvbuKSznCPjH3lHC2 X-Received: by 2002:a81:208a:: with SMTP id g132mr7245021ywg.230.1550226255180; Fri, 15 Feb 2019 02:24:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550226255; cv=none; d=google.com; s=arc-20160816; b=rScqy5MPdGSWfRET9hshRb7bWAsHcWCk/RsjViw1zQIENYZ0wdaLBwkDqZoSAbGbzj NWT3L5lzWUTbXuL+8xu0pt+wIjkU0Pz3bNsj0yQLh955S6TVW70jRR4e/hkk+68FGXqp quj0TrEWmMau3RpqFQTaxpk1sw/n1iBneJ/6AMwfU4kbFRUbkLJPAqFfXIJ9938YhZ3x pJRZfVG6lkyTrFUjjluw4XKJ8JhW9CseoyvN7QOvQWGnm9CxR7WHse0OEicZSMD7+geF ZmKUTwmQJ/2wRPETI1Z2TYSqAXvse0NAn92Ir/NF/LOMby9GpHt7I2FOAokjwfJqLtxv 0Bug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from; bh=ndH4aOUQ/a3rjxToBVDb4A/fT0IlLUiNNhhS65wKcC8=; b=D6gA6e04QJFOWOpNaBbG8BMV4wLHup9/HXqiDNl/buB5Tk2iGmr8QHyaDur7Zeb5Rx CsM8xwR35GMOsJPqjFI+cZdqI2aOuWsbbxn0NOPd+RufvcEtb+YZeLEtbkQNMfQD5gp3 RQG36BPI/p0jXcj0wiAU4ymCghVfD+gXZZgBHkTvZP6e4je92ewvPceBnFVTZe4INlaR up/JyTn/NKCtO5FKttzClfR7+1PaR6ZioWARa/gHF+dUTSixzMF7UOVy9Pdf+PC9JB5m Y8f69uO0r/Uvvfx/UrSbqBmHU89YLppGqmllNRC2IcnV628zlUmGhJ/WAzHvQ6frY3HP 1Vsw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id r19si2950681ybg.452.2019.02.15.02.24.15 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 15 Feb 2019 02:24:15 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([127.0.0.1]:36085 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guafG-0004kG-N2 for patch@linaro.org; Fri, 15 Feb 2019 05:24:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55439) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaQW-0003f2-He for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:09:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guaQU-0003Pi-U3 for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:08:59 -0500 Received: from chuckie.co.uk ([82.165.15.123]:38849 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1guaQS-0003Kn-Tf; Fri, 15 Feb 2019 05:08:58 -0500 Received: from host86-133-194-245.range86-133.btcentralplus.com ([86.133.194.245] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1guaJg-00027S-Jy; Fri, 15 Feb 2019 10:01:58 +0000 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, david@gibson.dropbear.id.au, richard.henderson@linaro.org Date: Fri, 15 Feb 2019 10:00:55 +0000 Message-Id: <20190215100058.20015-15-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190215100058.20015-1-mark.cave-ayland@ilande.co.uk> References: <20190215100058.20015-1-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.133.194.245 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH 14/17] target/ppc: Add set_vscr_sat X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson This is required before changing the representation of the register. Signed-off-by: Richard Henderson Acked-by: David Gibson --- target/ppc/int_helper.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) -- 2.11.0 diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c index ec3ef9ff3f..1d8a4b530b 100644 --- a/target/ppc/int_helper.c +++ b/target/ppc/int_helper.c @@ -468,6 +468,11 @@ uint32_t helper_mfvscr(CPUPPCState *env) return env->vscr; } +static inline void set_vscr_sat(CPUPPCState *env) +{ + env->vscr |= 1 << VSCR_SAT; +} + void helper_vaddcuw(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) { int i; @@ -581,7 +586,7 @@ VARITHFPFMA(nmsubfp, float_muladd_negate_result | float_muladd_negate_c); } \ } \ if (sat) { \ - env->vscr |= (1 << VSCR_SAT); \ + set_vscr_sat(env); \ } \ } #define VARITHSAT_SIGNED(suffix, element, optype, cvt) \ @@ -853,7 +858,7 @@ void helper_vcmpbfp_dot(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *a, } \ } \ if (sat) { \ - env->vscr |= (1 << VSCR_SAT); \ + set_vscr_sat(env); \ } \ } VCT(uxs, cvtsduw, u32) @@ -900,7 +905,7 @@ void helper_vmhaddshs(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *a, } if (sat) { - env->vscr |= (1 << VSCR_SAT); + set_vscr_sat(env); } } @@ -917,7 +922,7 @@ void helper_vmhraddshs(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *a, } if (sat) { - env->vscr |= (1 << VSCR_SAT); + set_vscr_sat(env); } } @@ -1029,7 +1034,7 @@ void helper_vmsumshs(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *a, } if (sat) { - env->vscr |= (1 << VSCR_SAT); + set_vscr_sat(env); } } @@ -1082,7 +1087,7 @@ void helper_vmsumuhs(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *a, } if (sat) { - env->vscr |= (1 << VSCR_SAT); + set_vscr_sat(env); } } @@ -1599,7 +1604,7 @@ void helper_vpkpx(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) } \ *r = result; \ if (dosat && sat) { \ - env->vscr |= (1 << VSCR_SAT); \ + set_vscr_sat(env); \ } \ } #define I(x, y) (x) @@ -2043,7 +2048,7 @@ void helper_vsumsws(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) *r = result; if (sat) { - env->vscr |= (1 << VSCR_SAT); + set_vscr_sat(env); } } @@ -2066,7 +2071,7 @@ void helper_vsum2sws(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) *r = result; if (sat) { - env->vscr |= (1 << VSCR_SAT); + set_vscr_sat(env); } } @@ -2085,7 +2090,7 @@ void helper_vsum4sbs(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) } if (sat) { - env->vscr |= (1 << VSCR_SAT); + set_vscr_sat(env); } } @@ -2102,7 +2107,7 @@ void helper_vsum4shs(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) } if (sat) { - env->vscr |= (1 << VSCR_SAT); + set_vscr_sat(env); } } @@ -2121,7 +2126,7 @@ void helper_vsum4ubs(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) } if (sat) { - env->vscr |= (1 << VSCR_SAT); + set_vscr_sat(env); } }