From patchwork Mon Feb 18 14:30:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 158634 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2622607jaa; Mon, 18 Feb 2019 07:29:56 -0800 (PST) X-Google-Smtp-Source: AHgI3IbOGljn93hgUoE/37R/6Dj3+HF7UVlEzL0BHQO2rleXbqRZjwgOIdCl5fSM7HEFfTmJfnHR X-Received: by 2002:a25:c752:: with SMTP id w79mr8732430ybe.397.1550503796835; Mon, 18 Feb 2019 07:29:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550503796; cv=none; d=google.com; s=arc-20160816; b=eGXz8jMIzSjQgNOVfiuLedln3ROHkGJMsONN/B1f4ZJ0E1CGN97wY8ipZoQaRSNGo4 VxaVXFKG0thSvGtjB24ooFGKxAIdkpmaD38nPRKmoJj2XRx3w4ptmcQZKAZYasI2WEmn +q3UZqDyArtKcdbmw+PEhjHoYfjpcSA+7W1vnRfo7KirbTZlaUA0tnnzgqbHIS/RWB5G 5Gb8U4TNV917a9nzzUysRcrqsPugYy5T7WC5EGO2iK0n/j//fNo3LGKCCEUU0TMN9a/9 mZPqRWNnL+qQD6qZrJ8+q2OR8tsjiEXgmJznf9DdNWP6e4gZ282DI/mgmzdQ3m2B7jBG 9+3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=CjP1zziGzTtlmDXg9+rPE+QvnHWR/AOw47sCWNQ/nqg=; b=fY+52DxG2qhHAL3CvXdz0rbcy5vWL3baiAUz/fIxHlpWFQf05eEjGtkxEfYfCk4qL7 WJ1bBL9ZI6SoaMQyxaPKSoSvhqtITl9j9cx2FzG69uSFfOQ+fNt+8ud63tIGMb0Qlquh OhN4UNxdWqtenWWuYR/focCz6LnCINNdTQTOBn9hAvXJ8fjwOzrC/eeTvEoLlg+fs/Et s1569qqRtkANuZNGedjStxJ0ukzxk4uN/IQb7rcpz5ATRerVV0I3PgPjVIJeQz9SDONL TYmwfho8X6KMeuaLdpfEPEfgoTCIcXhHPwWCSuOa0E3S5t9bci67iMgWCl9yvIOxLykV bsWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=m50U0aAD; 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 z187si5240169ywd.238.2019.02.18.07.29.56 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 18 Feb 2019 07:29:56 -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; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=m50U0aAD; 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]:60580 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvkrk-0002z2-EA for patch@linaro.org; Mon, 18 Feb 2019 10:29:56 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39915) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjyY-00078O-AX for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjyW-0003YN-80 for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:54 -0500 Received: from ozlabs.org ([203.11.71.1]:48193) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjyV-0003DB-I0; Mon, 18 Feb 2019 09:32:52 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 4435s24KNzz9sPl; Tue, 19 Feb 2019 01:31:18 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1550500278; bh=4N9M6Jo+jUM9P9qqQvopfFA5r2bjZ607uhJzd7kzerM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m50U0aADGWjLCcxHuqUtn97RPIHzffQyVRPMIn+UGjX11tFIyZoQnAI6yWS5yFppc wm2m5818gfPkvwzsOrX1LDtTetqqxkLMP9r3yKUdJIwKikWkhyNElQj7fwS5Wqa7fF wojMO8aa1glTF6+UXwj9l3DTxl3nrjBHukI/9RF8= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 19 Feb 2019 01:30:46 +1100 Message-Id: <20190218143049.17142-41-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218143049.17142-1-david@gibson.dropbear.id.au> References: <20190218143049.17142-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 40/43] 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: , Cc: Richard Henderson , groug@kaod.org, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson 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 Message-Id: <20190215100058.20015-15-mark.cave-ayland@ilande.co.uk> Signed-off-by: David Gibson --- target/ppc/int_helper.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) -- 2.20.1 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); } }