From patchwork Mon Feb 18 14:30:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 158627 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2610586jaa; Mon, 18 Feb 2019 07:18:55 -0800 (PST) X-Google-Smtp-Source: AHgI3IajYnvDtMaIVXujzywT4wrdW1M12CD7wFquu9s1WbPx6aASSxwwR3ost5DHBOKNa2mGCA0f X-Received: by 2002:a81:a707:: with SMTP id e7mr9402720ywh.396.1550503135234; Mon, 18 Feb 2019 07:18:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550503135; cv=none; d=google.com; s=arc-20160816; b=eRWp9uHM1YStAlYxJWDypIVHzkkD8dnuXOQM+zvujq2H8e/ttEVEm83kQVoKwLBUqb D6A2cacbabtepRppZ9AC1alpiOWezbN42mkp56rMOYuwMI45nq1N+bWTSPnqukRMZtoQ H2obR8zh1E/SfO7pekdG/SMOvjBSffjmdeIdz1lhC928lY8NeNmunCrA0lIs+rLd3U9H KzhcdcezhEn+JPuPy/0Qn5Cujhl0o41wTpSW0WPEbWCULM673nEuDW75z/E70KS/wv5e +mWTjFjFwjf7BpSlTTiP+ucYCs0OOv+ZplUiJsz9rWmt1BtcJqWjUuWThwypgJvPjXFJ kAfQ== 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=Mp5QhxupPIwHTCs4gw0MdsAZqc7LZnNxHtb26QXmMYs=; b=U1hAr2i32X3h8qfTRdbMXK6LIf76x2PD/15UFC75qVKSyWZiJ4NxV7pxe2DeXIgRTV KT7QzM+gXeLZL0Y4f23NRjPFTp5gnv/dvjN95CVaXM7kIou49DepB0FauKio+SvUzDQ1 YqUf576yw5u8FUS4CDJr8RenAkRx65kZyytcSluUzSUgnU0M6+Bsui8XqKYd/22/C+f2 fsbMfa0Rr9j7jDN28qrvX4Jc4b40GEjhf9/ry7t6sKqxYSj8G6jfiM2wQfbuobkx9woq 6NUCB0K6g5MMe5hOT3PgijwnunAk3jllahIvTILykzUMHdD2gikXKLrJKryidQ8TkrC9 VL9g== 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=nj8euyjr; 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 e184si3015497ywh.215.2019.02.18.07.18.54 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 18 Feb 2019 07:18:55 -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=nj8euyjr; 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]:60337 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvkh4-0002YC-BI for patch@linaro.org; Mon, 18 Feb 2019 10:18:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39903) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjyY-000786-2a 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-0003YE-4P for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:54 -0500 Received: from ozlabs.org ([2401:3900:2:1::2]:40343) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjyV-0003Cu-LU; Mon, 18 Feb 2019 09:32:52 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 4435s223S0z9sRc; Tue, 19 Feb 2019 01:31:17 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1550500278; bh=wWeJX6kiKqIb3Z0jPOtU5580gOTCe1HMpkmz26Aj5tU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nj8euyjraW6lgefnu6VsFGizwjDUDw98ee9FQCiMHfAqZZ89wuILTL6G+tGeJdsY2 pP/OyO1zFDp/lswAAvu0japBjqFPb5mBFKS+INqwrlXFr9WDycnPWD0NdbE/1k/Qh9 M7YNAfF1/tqgQq/9ZByz9LZYzxV0W3KPd5e2MzHk= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 19 Feb 2019 01:30:41 +1100 Message-Id: <20190218143049.17142-36-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: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 35/43] 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: , 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 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 Message-Id: <20190215100058.20015-10-mark.cave-ayland@ilande.co.uk> Signed-off-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.20.1 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) \