From patchwork Mon Oct 16 17:25:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 115961 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp3955329qgn; Mon, 16 Oct 2017 10:51:44 -0700 (PDT) X-Received: by 10.55.16.34 with SMTP id a34mr15367257qkh.353.1508176304161; Mon, 16 Oct 2017 10:51:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508176304; cv=none; d=google.com; s=arc-20160816; b=WBTm2zebbpGovdBmKzsPQAfwYlLaghsAQFgp6VaSErg6vAD6JEn6ZdhGOqBP3Fsmec bClNwzVA/2yAFedZ/5sHWycg9Bl2rrsSJcMbm8fsvRM5hWnQKFW587214NddU/CDZtCw dk7I+0+cxb9+dSwwIlnREaRBklb44/rgKkeRyRNtmjtsB63sBnaWbTlUsl1MLOcxqZoE xrSL4L5CCuTYJEEdjPMTIO6Pd4zPbSrQZx5aEzqWiZLc6voWP80638oWidkvcy8HjTnm N7mYQU3YbIOp/9S6gZ3DhGid5ZlEz3YXi2KH12P93A4uz3CgBpv5dLmeyP0fyYpvd9hL y0Ag== 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:arc-authentication-results; bh=RAagLYFqCSetGLwSSInErglxie5S43P08bbjsB82qWY=; b=Y5ryFgCeIo9UCdbuthzH3vCK/nlGb7PrfKUosj1pzwtPs8YkZu9yimj59kYEMRyDUR pmj1xx2HCArom3xsVf9vUUaTJNjehW+gNCKiM1SV/KEiCqEJql5dHhT9A/JG1S64iyUB kV2Q/XP9aS0AIm1hjjd84aibI+J/DVv1M2GSedQbXnP+9AUPpRT60AwYMDHZnsplLCCo 6S12AniTkb2KHyV2TBbYGtYVzM6qjafpKWRoFSg2SPF3FizuSNQDI6+rY0E6ep0+qC9C RdGEgQ/rnUa8ZCNlsXli4U3eMbe/J15wE8yicgGkBui/K8D/Ikoh+/lGZZRsuVaFTtm6 zHOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=EoeWklp9; 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 g13si6960915qtc.18.2017.10.16.10.51.43 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 16 Oct 2017 10:51:44 -0700 (PDT) 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=EoeWklp9; 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]:34398 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e49YD-0006OL-SV for patch@linaro.org; Mon, 16 Oct 2017 13:51:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e49AI-0002YE-Ks for qemu-devel@nongnu.org; Mon, 16 Oct 2017 13:26:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e49AE-0003h9-Jx for qemu-devel@nongnu.org; Mon, 16 Oct 2017 13:26:58 -0400 Received: from mail-pf0-x229.google.com ([2607:f8b0:400e:c00::229]:49549) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e49AE-0003gm-E1 for qemu-devel@nongnu.org; Mon, 16 Oct 2017 13:26:54 -0400 Received: by mail-pf0-x229.google.com with SMTP id i5so3202092pfe.6 for ; Mon, 16 Oct 2017 10:26:54 -0700 (PDT) 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=RAagLYFqCSetGLwSSInErglxie5S43P08bbjsB82qWY=; b=EoeWklp95HqvNRQ0FZmSn5SXvU7JOQmFsNZtRmLS1pey1zhVmgJOPvSRA0QOo8Wd2t p1duEFtwt6rhIJmS3RSoO6MdDyeizE9s+CX8VcMDR8mwJwJBNw5U9ytkpGlqyv3whTgY OhBnEIjd5S20sBungacXt1EQTZzunXmAc2Gvw= 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=RAagLYFqCSetGLwSSInErglxie5S43P08bbjsB82qWY=; b=JbLqueFayGcVU5Z0QnAkG3HM7Hyfu1CnHmhXnh/0sXq0zsyJAp/vj+PlHIF+KJ6SCD wtcYi4fYGwRS/I1bCFUgZyOoCKVRmefm8d37N52R+o7Pv05Pxxqmf9Ts6tfQlHLUImMV LrBzYmHtaRaptuDW5kuW76/8c0BM5yrxSRlW/PS7NCCHYb2chCmUklPZVlvsixJnTJL2 EzW6I0TRnmse8E6D1QyxP5JdwK4XMrg77gmtA5ndhYPI6Txrmcx48WCzXeEz9AWd8dTM 7aNvNn82XFE8iNckNsW89HOvtZ0pyY6SEyz+536g/ITG25nYxhv3KAMrR54c2xmAD3N0 simQ== X-Gm-Message-State: AMCzsaVRfuaMgDs1/ar+eIklc/y9mXKOd3oox6fNBRYsWXBgB4mGx3MJ xsQlY0WAeSvfMRKICwfMrvpjJfqKLC0= X-Google-Smtp-Source: AOwi7QCOojsB6nnaKgh5qsKhGSnogyF6mC2wB2Y3dphXaX25x4awgqc3Xqx3KMr2boGt5YiygMzPcQ== X-Received: by 10.98.198.138 with SMTP id x10mr7920705pfk.55.1508174813259; Mon, 16 Oct 2017 10:26:53 -0700 (PDT) Received: from cloudburst.twiddle.net (97-126-104-76.tukw.qwest.net. [97.126.104.76]) by smtp.gmail.com with ESMTPSA id i187sm5594249pfc.96.2017.10.16.10.26.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Oct 2017 10:26:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 16 Oct 2017 10:25:47 -0700 Message-Id: <20171016172609.23422-29-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171016172609.23422-1-richard.henderson@linaro.org> References: <20171016172609.23422-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::229 Subject: [Qemu-devel] [PATCH v6 28/50] target/hppa: check CF_PARALLEL instead of parallel_cpus 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: cota@braap.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Thereby decoupling the resulting translated code from the current state of the system. Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- target/hppa/helper.h | 2 ++ target/hppa/op_helper.c | 32 ++++++++++++++++++++++++++++---- target/hppa/translate.c | 12 ++++++++++-- 3 files changed, 40 insertions(+), 6 deletions(-) -- 2.13.6 diff --git a/target/hppa/helper.h b/target/hppa/helper.h index 789f07fc0a..0a6b900555 100644 --- a/target/hppa/helper.h +++ b/target/hppa/helper.h @@ -3,7 +3,9 @@ DEF_HELPER_FLAGS_2(tsv, TCG_CALL_NO_WG, void, env, tl) DEF_HELPER_FLAGS_2(tcond, TCG_CALL_NO_WG, void, env, tl) DEF_HELPER_FLAGS_3(stby_b, TCG_CALL_NO_WG, void, env, tl, tl) +DEF_HELPER_FLAGS_3(stby_b_parallel, TCG_CALL_NO_WG, void, env, tl, tl) DEF_HELPER_FLAGS_3(stby_e, TCG_CALL_NO_WG, void, env, tl, tl) +DEF_HELPER_FLAGS_3(stby_e_parallel, TCG_CALL_NO_WG, void, env, tl, tl) DEF_HELPER_FLAGS_1(probe_r, TCG_CALL_NO_RWG_SE, tl, tl) DEF_HELPER_FLAGS_1(probe_w, TCG_CALL_NO_RWG_SE, tl, tl) diff --git a/target/hppa/op_helper.c b/target/hppa/op_helper.c index c05c0d5572..3104404e8d 100644 --- a/target/hppa/op_helper.c +++ b/target/hppa/op_helper.c @@ -76,7 +76,8 @@ static void atomic_store_3(CPUHPPAState *env, target_ulong addr, uint32_t val, #endif } -void HELPER(stby_b)(CPUHPPAState *env, target_ulong addr, target_ulong val) +static void do_stby_b(CPUHPPAState *env, target_ulong addr, target_ulong val, + bool parallel) { uintptr_t ra = GETPC(); @@ -89,7 +90,7 @@ void HELPER(stby_b)(CPUHPPAState *env, target_ulong addr, target_ulong val) break; case 1: /* The 3 byte store must appear atomic. */ - if (parallel_cpus) { + if (parallel) { atomic_store_3(env, addr, val, 0x00ffffffu, ra); } else { cpu_stb_data_ra(env, addr, val >> 16, ra); @@ -102,14 +103,26 @@ void HELPER(stby_b)(CPUHPPAState *env, target_ulong addr, target_ulong val) } } -void HELPER(stby_e)(CPUHPPAState *env, target_ulong addr, target_ulong val) +void HELPER(stby_b)(CPUHPPAState *env, target_ulong addr, target_ulong val) +{ + do_stby_b(env, addr, val, false); +} + +void HELPER(stby_b_parallel)(CPUHPPAState *env, target_ulong addr, + target_ulong val) +{ + do_stby_b(env, addr, val, true); +} + +static void do_stby_e(CPUHPPAState *env, target_ulong addr, target_ulong val, + bool parallel) { uintptr_t ra = GETPC(); switch (addr & 3) { case 3: /* The 3 byte store must appear atomic. */ - if (parallel_cpus) { + if (parallel) { atomic_store_3(env, addr - 3, val, 0xffffff00u, ra); } else { cpu_stw_data_ra(env, addr - 3, val >> 16, ra); @@ -132,6 +145,17 @@ void HELPER(stby_e)(CPUHPPAState *env, target_ulong addr, target_ulong val) } } +void HELPER(stby_e)(CPUHPPAState *env, target_ulong addr, target_ulong val) +{ + do_stby_e(env, addr, val, false); +} + +void HELPER(stby_e_parallel)(CPUHPPAState *env, target_ulong addr, + target_ulong val) +{ + do_stby_e(env, addr, val, true); +} + target_ulong HELPER(probe_r)(target_ulong addr) { return page_check_range(addr, 1, PAGE_READ); diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 460b4d3154..08b2c73291 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2291,9 +2291,17 @@ static DisasJumpType trans_stby(DisasContext *ctx, uint32_t insn, val = load_gpr(ctx, rt); if (a) { - gen_helper_stby_e(cpu_env, addr, val); + if (tb_cflags(ctx->base.tb) & CF_PARALLEL) { + gen_helper_stby_e_parallel(cpu_env, addr, val); + } else { + gen_helper_stby_e(cpu_env, addr, val); + } } else { - gen_helper_stby_b(cpu_env, addr, val); + if (tb_cflags(ctx->base.tb) & CF_PARALLEL) { + gen_helper_stby_b_parallel(cpu_env, addr, val); + } else { + gen_helper_stby_b(cpu_env, addr, val); + } } if (m) {