From patchwork Tue Dec 18 06:39:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 154112 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3364963ljp; Mon, 17 Dec 2018 23:07:18 -0800 (PST) X-Google-Smtp-Source: AFSGD/XRv88+/TQl3SHs2a1fKMp067QpCK5AXxenH0F10kZFYnIyw1W1y7W/dspOMiWkMkaFmoeF X-Received: by 2002:ac8:7a8d:: with SMTP id x13mr16567897qtr.357.1545116838524; Mon, 17 Dec 2018 23:07:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545116838; cv=none; d=google.com; s=arc-20160816; b=1HcrJBf/fLKF27lBmPNfbhJCATrMQG51l2jPTauaao+lfK/swbJiO1nOIrsf7HhQBo 6jl1cbohkZ7w5J5JHSM6qRMdn5WYrQfABuSKusZg7MtyAhXC4JGuOlerUt2uBcFyLtB5 arzh9UL5zc5cmREx4kapYHychsOPo+0d4VeEKXBefarewSj3UGXsDanSCMROi7gm6D1m 7MHP2v9+PzqEnQxywmpjAZrqwTnz4AS+tGn/ZRlpgAdaxtfXrJSsuY7nZOVgqz4acwYV swld+B4Hb4FoCSuLouv2hy6JFhXbvaMOTDyw30uOy547nYU828rEi9VIiFgZ/DGetSWL xUyg== 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=ZrBpnbx7YF++UHHSdYwnXTWh9J6az0qW7yMUWdUpg/c=; b=YzxXQXzq/ZnO5mLAhN4OoUkNaAb6mDq6gUW4bXyFzvuf2oQ/50z00xOHpblXfkVKNz XEtRb3/mL9HSr/rbWAF15AQRxHnenMJ3Fd8d31hBOgstz9yYJmPscuXAVbz3ILxCj9yf JyFkinVeYwaW01RPTNJg3P6H0V6jRo/LTMQxDheTZVaWUOFJD+qbC2jSGJD4F7P2vnHd PJIrGFMeG5Ey20uGlIsmEXXVdsalz4V0Ign7b39rqd3tqvIL3U5LMgRyuLAM8NNnPbmX QrQG+QN4wKcCfTmm5Q8RcdF8YpRjL9MLM58Wce8DewCRcvIct9eD8+l0uC4z/LP8JrIK FKfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Nn+z94fH; 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 188si1825754qki.258.2018.12.17.23.07.18 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 17 Dec 2018 23:07:18 -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=Nn+z94fH; 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]:52194 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZ9TK-0007dh-03 for patch@linaro.org; Tue, 18 Dec 2018 02:07:18 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53193) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZ933-0001p4-1P for qemu-devel@nongnu.org; Tue, 18 Dec 2018 01:40:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZ92u-0002w5-CE for qemu-devel@nongnu.org; Tue, 18 Dec 2018 01:40:08 -0500 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]:33328) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gZ92u-0002lO-1I for qemu-devel@nongnu.org; Tue, 18 Dec 2018 01:40:00 -0500 Received: by mail-pg1-x541.google.com with SMTP id z11so7360465pgu.0 for ; Mon, 17 Dec 2018 22:39:53 -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=ZrBpnbx7YF++UHHSdYwnXTWh9J6az0qW7yMUWdUpg/c=; b=Nn+z94fH2k/lI4tWiobU8W6slxfS2Pkp1d1Duit1E7FZcmUvm0VVuBHkILZhaLyUOL ncydktHBg403IG95dUkRLhlX1UOek4oTiexhUzSD5GMC5Xg5obSXaNm6lHPPQ3DhYXaj nbWe9vDA+WOHeNzQmGT+FvOS4KE6swB6IfOws= 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=ZrBpnbx7YF++UHHSdYwnXTWh9J6az0qW7yMUWdUpg/c=; b=Y8ETfq0RaD+1MJInIkyTECKJ+O7jreYO7pIHqTrVvBwhGMJ0ktLzupUx9ZRgqkYjPB YtELKWGV3IMqwD0+k3I4w/EhE8zExp8p06l2tTUkBmQeTQp2cvIzVrVU5Sq0+Tq3TPK9 +cZYSKMZsm5cB02d2UeqDw+rp85yrgUXY8S3ZEIlWm1lE5onJF5McUvx65YjDXqz1R+9 zfL+mpcBOKbuIBJTk4V3GFABNcc2wqnSRz3nDH8l7rOk6Ik6hpVbZFFm/Agi1SPMvUI/ qySnZ+POfHRPRuuH3w3SnQEFbcXaEFSiCO+yrHYg8RsYsn01YCVhuFcDV8uArhiE22Ct mcCg== X-Gm-Message-State: AA+aEWYc9aY2o8W3TxvqzHNcYL9r+A8ezoytPaMVYNoqFQhwbKjUh2RS ZxMZBNyzxIVE/9hGBqZqkWtxuqmPUf8= X-Received: by 2002:a63:de04:: with SMTP id f4mr14477247pgg.292.1545115192550; Mon, 17 Dec 2018 22:39:52 -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.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Dec 2018 22:39:51 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 17 Dec 2018 22:39:06 -0800 Message-Id: <20181218063911.2112-30-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::541 Subject: [Qemu-devel] [PATCH 29/34] target/ppc: Add helper_mfvscr 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" This is required before changing the representation of the register. Signed-off-by: Richard Henderson --- target/ppc/helper.h | 1 + target/ppc/arch_dump.c | 3 ++- target/ppc/int_helper.c | 5 +++++ target/ppc/translate/vmx-impl.inc.c | 2 +- target/ppc/translate_init.inc.c | 2 +- 5 files changed, 10 insertions(+), 3 deletions(-) -- 2.17.2 Acked-by: David Gibson diff --git a/target/ppc/helper.h b/target/ppc/helper.h index b3ffe28103..7dbb08b9dd 100644 --- a/target/ppc/helper.h +++ b/target/ppc/helper.h @@ -295,6 +295,7 @@ 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_FLAGS_2(mtvscr, TCG_CALL_NO_RWG, void, env, i32) +DEF_HELPER_FLAGS_1(mfvscr, TCG_CALL_NO_RWG, i32, env) 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/arch_dump.c b/target/ppc/arch_dump.c index c272d0d3d4..f753798789 100644 --- a/target/ppc/arch_dump.c +++ b/target/ppc/arch_dump.c @@ -17,6 +17,7 @@ #include "elf.h" #include "sysemu/dump.h" #include "sysemu/kvm.h" +#include "exec/helper-proto.h" #ifdef TARGET_PPC64 #define ELFCLASS ELFCLASS64 @@ -173,7 +174,7 @@ static void ppc_write_elf_vmxregset(NoteFuncArg *arg, PowerPCCPU *cpu) vmxregset->avr[i].u64[1] = cpu->env.vsr[32 + i].u64[1]; } } - vmxregset->vscr.u32[3] = cpu_to_dump32(s, cpu->env.vscr); + vmxregset->vscr.u32[3] = cpu_to_dump32(s, helper_mfvscr(&cpu->env)); } static void ppc_write_elf_vsxregset(NoteFuncArg *arg, PowerPCCPU *cpu) diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c index 0443f33cd2..75201bbba6 100644 --- a/target/ppc/int_helper.c +++ b/target/ppc/int_helper.c @@ -475,6 +475,11 @@ void helper_mtvscr(CPUPPCState *env, uint32_t vscr) set_flush_to_zero((vscr >> VSCR_NJ) & 1, &env->vec_status); } +uint32_t helper_mfvscr(CPUPPCState *env) +{ + return env->vscr; +} + void helper_vaddcuw(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) { int i; diff --git a/target/ppc/translate/vmx-impl.inc.c b/target/ppc/translate/vmx-impl.inc.c index ab6da3aa55..1c0c461241 100644 --- a/target/ppc/translate/vmx-impl.inc.c +++ b/target/ppc/translate/vmx-impl.inc.c @@ -187,7 +187,7 @@ static void gen_mfvscr(DisasContext *ctx) tcg_gen_movi_i64(avr, 0); set_avr64(rD(ctx->opcode), avr, true); t = tcg_temp_new_i32(); - tcg_gen_ld_i32(t, cpu_env, offsetof(CPUPPCState, vscr)); + gen_helper_mfvscr(t, cpu_env); tcg_gen_extu_i32_i64(avr, t); set_avr64(rD(ctx->opcode), avr, false); tcg_temp_free_i32(t); diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.inc.c index 292b1df700..353285c6bd 100644 --- a/target/ppc/translate_init.inc.c +++ b/target/ppc/translate_init.inc.c @@ -9527,7 +9527,7 @@ static int gdb_get_avr_reg(CPUPPCState *env, uint8_t *mem_buf, int n) return 16; } if (n == 32) { - stl_p(mem_buf, env->vscr); + stl_p(mem_buf, helper_mfvscr(env)); ppc_maybe_bswap_register(env, mem_buf, 4); return 4; }