From patchwork Fri Feb 15 10:00:50 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: 158488 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp517453jaa; Fri, 15 Feb 2019 02:06:18 -0800 (PST) X-Google-Smtp-Source: AHgI3IZ/pAlWC2OKYQ9i7V/qAsFGPtrbxP+sQdt/UoVMhV0x86bcYyqwsThR9otGOowduib4h2Ro X-Received: by 2002:a81:28c3:: with SMTP id o186mr6908504ywo.309.1550225178164; Fri, 15 Feb 2019 02:06:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550225178; cv=none; d=google.com; s=arc-20160816; b=0YAc7wLHOlTtaOpn3ZihE3xk3czhvTw/iUaCrPpjjXC1KZSOdlBbC/QIHdQzXvxbfB Iv5iMGkAW+SKlk985T4NFA1ATcyWDNx77KfPLvAP7uhhJDA6BM+aGLu5AZMJXGkLCKWw tkZFCMuVL9Y3TufkG6BE0WvT3Ft4zVf9A7o8nPQtEvNOGpVFXpiGbqYuLpQ6S3WjVy72 s08KckKinJz1VCgymrljGXUvRlZ+JifwdCo7qZk7Wb+AH+3XsFxZM82WMs35+EJYZia/ hmIetSfre8He/kPdA5dX3TRqLcR5MMti8OdBeI1tg17RBof3dokJdrwhSK+jJYGTdXC3 2yXQ== 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=fmSItmk2FEWtgn/2IA8DpNgyGlTSPXoB/ezSgXg5r+8=; b=LIpa5YUAOCdPVgXtaRBPMv2ymUE3Jfw35RSK633uuknvJxkW48oUGKyAz9zA7PLgrV VIZmxHoR9+fayLsGN9EMio4orFbje0OuUZAZr1JopQ7fIp7pD6+cltDUKTsT/Blfkz3B TbRSivjvq/0fyI6ETWQRSZiYnRFWdGRH8WDsziIvmZmo0Ow/SlUvIz9+P9SQNMfvKFUV 1GChitheA+LSMLL3XGEcOYi2IvKbb7gus+Wd45zv9stfCbL3t3mInuQ9/BvU8k56V08r DmSEfEYOcakDaa45lWKk1dMScsQsfwh0oUfrMjeG1Plb58oMxn3ykREX7GHBw+7ioQnZ eLwg== 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 j73si2947495ybj.39.2019.02.15.02.06.18 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 15 Feb 2019 02:06:18 -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]:35756 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaNt-0000LR-JC for patch@linaro.org; Fri, 15 Feb 2019 05:06:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53607) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaJs-0006n8-8n for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:02:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guaJm-0000PE-AW for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:02:08 -0500 Received: from chuckie.co.uk ([82.165.15.123]:38794 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 1guaJg-0008SL-JS; Fri, 15 Feb 2019 05:01: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 1guaJZ-00027S-5V; Fri, 15 Feb 2019 10:01:50 +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:50 +0000 Message-Id: <20190215100058.20015-10-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 09/17] target/ppc: Pass integer to helper_mtvscr 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 We can re-use this helper elsewhere if we're not passing in an entire vector register. Signed-off-by: Richard Henderson Acked-by: David Gibson --- target/ppc/helper.h | 2 +- target/ppc/int_helper.c | 6 +++--- target/ppc/translate/vmx-impl.inc.c | 17 +++++++++++++---- 3 files changed, 17 insertions(+), 8 deletions(-) -- 2.11.0 diff --git a/target/ppc/helper.h b/target/ppc/helper.h index 069daa9883..b3ffe28103 100644 --- a/target/ppc/helper.h +++ b/target/ppc/helper.h @@ -294,7 +294,7 @@ DEF_HELPER_5(vmsumuhs, void, env, avr, avr, avr, avr) DEF_HELPER_5(vmsumshm, void, env, avr, avr, avr, avr) DEF_HELPER_5(vmsumshs, void, env, avr, avr, avr, avr) DEF_HELPER_4(vmladduhm, void, avr, avr, avr, avr) -DEF_HELPER_2(mtvscr, void, env, avr) +DEF_HELPER_FLAGS_2(mtvscr, TCG_CALL_NO_RWG, void, env, i32) DEF_HELPER_3(lvebx, void, env, avr, tl) DEF_HELPER_3(lvehx, void, env, avr, tl) DEF_HELPER_3(lvewx, void, env, avr, tl) diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c index 5c9623e952..aa6ad2ce7e 100644 --- a/target/ppc/int_helper.c +++ b/target/ppc/int_helper.c @@ -457,10 +457,10 @@ void helper_lvsr(ppc_avr_t *r, target_ulong sh) } } -void helper_mtvscr(CPUPPCState *env, ppc_avr_t *r) +void helper_mtvscr(CPUPPCState *env, uint32_t vscr) { - env->vscr = r->VsrW(3); - set_flush_to_zero(vscr_nj, &env->vec_status); + env->vscr = vscr; + set_flush_to_zero((vscr >> VSCR_NJ) & 1, &env->vec_status); } void helper_vaddcuw(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) diff --git a/target/ppc/translate/vmx-impl.inc.c b/target/ppc/translate/vmx-impl.inc.c index 41ddbd879f..182d3fc563 100644 --- a/target/ppc/translate/vmx-impl.inc.c +++ b/target/ppc/translate/vmx-impl.inc.c @@ -196,14 +196,23 @@ static void gen_mfvscr(DisasContext *ctx) static void gen_mtvscr(DisasContext *ctx) { - TCGv_ptr p; + TCGv_i32 val; + int bofs; + if (unlikely(!ctx->altivec_enabled)) { gen_exception(ctx, POWERPC_EXCP_VPU); return; } - p = gen_avr_ptr(rB(ctx->opcode)); - gen_helper_mtvscr(cpu_env, p); - tcg_temp_free_ptr(p); + + val = tcg_temp_new_i32(); + bofs = avr64_offset(rB(ctx->opcode), true); +#ifdef HOST_WORDS_BIGENDIAN + bofs += 3 * 4; +#endif + + tcg_gen_ld_i32(val, cpu_env, bofs); + gen_helper_mtvscr(cpu_env, val); + tcg_temp_free_i32(val); } #define GEN_VX_VMUL10(name, add_cin, ret_carry) \