From patchwork Wed Oct 25 09:35:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 117076 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp650716qgn; Wed, 25 Oct 2017 02:58:40 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QK12+RxaRedwCJLpgnkmndbqKch5A83ZsZWxd29h/iPF/+Eda+ZC5y9UXlsXd/UtyizYeD X-Received: by 10.37.16.70 with SMTP id 67mr855128ybq.67.1508925520026; Wed, 25 Oct 2017 02:58:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508925520; cv=none; d=google.com; s=arc-20160816; b=SQLAuBnhjPq6TgvDxm3vDIF4oYQh9XDlR4wB3g12UaDfWHAy8ijdRbm+el24tDcht6 FdqzRoGoKxd/hOIg41DHNrKXKsSvlgyo9q1vC0ifMtvwQJbk/1KHzRGMgkDC67WfyMa2 PgHbFnxbXrZ6IARv9SE30KC+NQ+/u/SCqWkMiut7jTS7GIrjWwuaav8G/gCSByjpFwhX dOzrUTPVcdlTbLHLoSt2VAE7d61EOnDWANJE0V0rcVALzBEoFKchXZ1ft8JmuVcy7a7W 2J9+GNBwYXMuKE+v0gTXIYbW1253T8E2CaR+GoYpJY85+qtcKj5hVOMS3Bvmr3MwAI6F OcMw== 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=ygiOkO8U8cBhmO2/kWIZ920HtCmy0+ZotyAoxW5JMyc=; b=0TcyXOwio7DIOdNAnPAGaCmLVT+sheQhWyE91WybhB4f5HkRscrBu2EJHk0urySwYM PDzmvO2fONgrfMRW4PaePM3XRTdFgMcdC3W9DPRwRrSNSUBNHqXpZEz3wKzE51eDnKJ4 K2VWE+Uu5F/P7K0vZnDLlMlfRYig/imEBVj88ZEzEq3UsEtWfrh9Mrp84HfteC0/c9oP 2PjOldt57BNHAuvfsQcb7QjbrUktA6Wr2LRzq8++b6D6B2PEgEWstGMKnOv+Zdb1YhEH umCsEqP0BDiX5S3GsJ85vlSfeGro4R6+h95vKAz2sHMLmpk10lapmoU9btyOeo/DaocZ O8hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Ra/Ooz8u; 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 o11si392721ywb.177.2017.10.25.02.58.39 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 25 Oct 2017 02:58:40 -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=Ra/Ooz8u; 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]:47400 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e7ISN-0002mm-EP for patch@linaro.org; Wed, 25 Oct 2017 05:58:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45783) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e7I6k-0008Ud-1X for qemu-devel@nongnu.org; Wed, 25 Oct 2017 05:36:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e7I6f-0008NS-Sj for qemu-devel@nongnu.org; Wed, 25 Oct 2017 05:36:18 -0400 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:51018) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e7I6f-0008N6-MA for qemu-devel@nongnu.org; Wed, 25 Oct 2017 05:36:13 -0400 Received: by mail-wr0-x243.google.com with SMTP id p96so9428609wrb.7 for ; Wed, 25 Oct 2017 02:36:13 -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=ygiOkO8U8cBhmO2/kWIZ920HtCmy0+ZotyAoxW5JMyc=; b=Ra/Ooz8uYNshnKeCfk+8GFQIrZU5H93lABy5PvNPoGwt1gLy0JxE9LLVN8LMH7LFKH 26nFBd+zvj91kVbHFfsFE11GVqrqpsnk+/x2exSNgVvI7vdlFlEmwqqxXUITImag47QL BPNvHGgdo1k2XcLgNTgQqYasV4cuGzt8KUIhg= 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=ygiOkO8U8cBhmO2/kWIZ920HtCmy0+ZotyAoxW5JMyc=; b=ccKl39h7gT0lt5jTBSpBroozEXk+Cjj5uhDJwIfZp5lVDFyExYY/UGvq9xNBHMv7zx QdCXd6lR/2nHiLMot39nDZQ2jr4JfClxoliQSuot9qh4sXo7bXbfkJhYJIIlSNW5jLWh fIZ9F1RomQ5CuEhnnd0+J7PpgJE/1ARwpb3KhdCJZ9DepGJ8FkfHi0KM5lN5ZtO9kc8W MDRMMVW5HTqWdTpJvqhBSWnBrm5j4L4mOgcJmL6yUshshcIiocfn6ywCHA2tpr68/OLW n2wPRq15GCtra7eBtXhvq1sANM8xKVpqyzq0Y/lkOIHrKK8s6JTPhvVnAa7dtTjg67eM ZBsA== X-Gm-Message-State: AMCzsaUDozMmr+lCJxjVF1LlkBqDL3t/m/X+5ehQVgNbs8Gc0mChPs59 58kcAanZgBAdNwRNSXG6MEGbaZg73Pg= X-Received: by 10.223.129.198 with SMTP id 64mr1463197wra.59.1508924172429; Wed, 25 Oct 2017 02:36:12 -0700 (PDT) Received: from cloudburst.twiddle.net ([62.168.35.107]) by smtp.gmail.com with ESMTPSA id v23sm2751025wmh.8.2017.10.25.02.36.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Oct 2017 02:36:11 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 25 Oct 2017 11:35:11 +0200 Message-Id: <20171025093535.10175-28-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171025093535.10175-1-richard.henderson@linaro.org> References: <20171025093535.10175-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::243 Subject: [Qemu-devel] [PULL 27/51] 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: peter.maydell@linaro.org, "Emilio G. Cota" 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 Signed-off-by: Richard Henderson --- 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) {