From patchwork Tue Dec 18 06:39:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 154092 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3351284ljp; Mon, 17 Dec 2018 22:49:51 -0800 (PST) X-Google-Smtp-Source: AFSGD/X7C8ZMvg6lQpysDV0FPE5y9hrfH3YFIoHXHK+bjBCrhEMNw4rmPEWU9Vo/HZUj27nW+XDN X-Received: by 2002:aed:2314:: with SMTP id h20mr16196562qtc.286.1545115791561; Mon, 17 Dec 2018 22:49:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545115791; cv=none; d=google.com; s=arc-20160816; b=mLjAUYAVw67c41/sPyb/KUAQ2kHrz8X9XuVrbzOd2a2OrY++jDTH/F0QNlvq+fVYzH ynxAPWLLPFOGrvwwxdT/yJkl6zA5jy3228uFyruWRy2AvFcfrfZGgfiR2mBEvhIr1PcY mG5DX6bvtX/nFHbaUsu5huabDB0UWQ4quL4zkv0ZFTZ60Sla+ZlW+1B9qQ7MIiQ1Vt0h /iz8438p5JD01oLIPEnxksstPNknNeKSrsJ3MNayVlguSMI+Zb+y9lkWAGnVqcuNOSD/ el/gxx234RXdlHHkQ3oVAnHrPDhRhYvG0r/meeI0WbvzKwb5ib1MGNV7HrHq4y+rBGt7 13uQ== 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:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=070cEypBjZxfxUYkH8IwPesDYg9dOtX7CjVcZ/KHhDs=; b=Q5hOvtvrKtFWhhOXUpaOHll4XczO/Lj/aEdE8xYKKVUSq/SRYfMaUK3jOyzu+PPCG5 DxIGtqVs8whOiJtIhdwnjYiaipF0IiEDgzh+gJStXSFIUvGnqEZlI0lf1jZugUrJmQbG nIKHnSlVW9N8Tk6CroVwaFxB0fGNGKZi8PRlTy4Nhjm0dhDUeqad1wiPPBhboffXu6wR 3xG37usxFaKuINSeoENAwA40DA9VtDM29MWclLH2y7zowvtVkolMtqCzWfAiIuY3FNyQ BdYEPk6b+9PqunwPQYluDWUPBAO89HPiwBpfLpSxBS4hjR1ZIwHIvkbFpZq0Ttkkb4qy PnxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Dw0oIX2x; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id n26si2639941qvc.48.2018.12.17.22.49.51 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 17 Dec 2018 22:49:51 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Dw0oIX2x; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52071 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZ9CR-0001He-1j for patch@linaro.org; Tue, 18 Dec 2018 01:49:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52904) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZ92t-0001fH-RS for qemu-devel@nongnu.org; Tue, 18 Dec 2018 01:40:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZ92q-0002py-Pm for qemu-devel@nongnu.org; Tue, 18 Dec 2018 01:39:59 -0500 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]:36692) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gZ92q-0002iw-Cp for qemu-devel@nongnu.org; Tue, 18 Dec 2018 01:39:56 -0500 Received: by mail-pf1-x434.google.com with SMTP id b85so7655504pfc.3 for ; Mon, 17 Dec 2018 22:39:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=070cEypBjZxfxUYkH8IwPesDYg9dOtX7CjVcZ/KHhDs=; b=Dw0oIX2xkkyBJCt1iOLm90FiVz8gBPiJofFMlIWgB7Drh364Nf9PYQ5N51u90qVOmY UO4jzOlKjCGdSHcm0S98+iR16xVTc0DOfW9ygb7H1KqTtWFFjjbGXJd62RRM7VgJQeXQ hn9Wgqm6CcfpseVGhJOzLsZbO9fpomYf1Q5gY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=070cEypBjZxfxUYkH8IwPesDYg9dOtX7CjVcZ/KHhDs=; b=DKB5AkOm/jUi+9KQ3ENtYyKK+MuFwDg179sP9m+Ex+2uoUKJ+DmefURDW3AAjEglUj mCaAWz85esgu6r/fdfk049R6xlLCDSBYrd/ZO6eIRWw+JEDWqB1xcZyEPpQs8Vc19MZ0 1vDfOD2mcwA4u6lzjrfUqU5eSJ8tXLAyr8wjO8o7z0c+21uWRrPizb+uh+MhTyh6Zigg /xnv24wsDQhLGHk7zgzA+S2yH0DPGQRQvk/sURoT7a2gzvClZiBUYs2/cKVGqOguu2uQ VHINlxaY5y0io6rbEkHDLqv4CVtGbEJRC+5tivVSYmzyiuCLEt6S0lKOI/0qIN3FseNx 7+4A== X-Gm-Message-State: AA+aEWZHtlacFsujeATNab9xNlPPKY9+/X/mHtFKSmSUO4ROVwIEqJyz vCgG5rX4H3U8e5iuyLh+2ysqhb8ku9U= X-Received: by 2002:aa7:83c6:: with SMTP id j6mr15523958pfn.91.1545115189005; Mon, 17 Dec 2018 22:39:49 -0800 (PST) Received: from cloudburst.twiddle.net (97-126-115-157.tukw.qwest.net. [97.126.115.157]) by smtp.gmail.com with ESMTPSA id c7sm27072509pfh.18.2018.12.17.22.39.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Dec 2018 22:39:48 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 17 Dec 2018 22:39:03 -0800 Message-Id: <20181218063911.2112-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181218063911.2112-1-richard.henderson@linaro.org> References: <20181218063911.2112-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::434 Subject: [Qemu-devel] [PATCH 26/34] 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: qemu-ppc@nongnu.org, mark.cave-ayland@ilande.co.uk, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We can re-use this helper elsewhere if we're not passing in an entire vector register. Signed-off-by: Richard Henderson --- target/ppc/helper.h | 2 +- target/ppc/int_helper.c | 10 +++------- target/ppc/translate/vmx-impl.inc.c | 17 +++++++++++++---- 3 files changed, 17 insertions(+), 12 deletions(-) -- 2.17.2 Acked-by: David Gibson 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 3bf0fdb6c5..0443f33cd2 100644 --- a/target/ppc/int_helper.c +++ b/target/ppc/int_helper.c @@ -469,14 +469,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) { -#if defined(HOST_WORDS_BIGENDIAN) - env->vscr = r->u32[3]; -#else - env->vscr = r->u32[0]; -#endif - 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 329131d30b..ab6da3aa55 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) \