From patchwork Fri Oct 20 23:19:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 116565 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2232531qgn; Fri, 20 Oct 2017 16:40:06 -0700 (PDT) X-Received: by 10.55.166.77 with SMTP id p74mr9612047qke.264.1508542806692; Fri, 20 Oct 2017 16:40:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508542806; cv=none; d=google.com; s=arc-20160816; b=JTnPVP0edu+o7xGvxGzdwwW7YDKeG+7qipQ1FGiAGcbBX5vTPn8LgbH8SptMnFaI7P H8DHB6fldf67RedYwrol8fjPeECvFE9/VUobKFnhsJJiG5lQKU5NsIJkbzJCuGSFAFVL AF8kFHSJe4I/maSfFae/rb0kfU+YcVYg5ffS8zd5G9Du9DO3BG/3YBFwF4qiqwN3GoQM JG9GojiQCVzYzWt+jFqt2QvJklZeJVJVvN/L+5hrYKPKBAebB/5Coi3JJPs7ygD3sz21 WVqQLxUNlwpP/ksv0MYPKM4lDw7H71gjdUugiDc5b8sJWL4FY5uqSf9WkCuHnP+4u2bu 3mOA== 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=Nl020aEduMKNXkJ3By3kXmznLYzIEzyjc3/JTit6LiM2TaEniS9nRrPi51akhgkTlA hte3MDI9xGT1yAdW0ZcKAW/1ySmbba9MDAll7+vvuTjzHzDvM+rTr9L+klvdo7qOxDzd W8sKV2aT7DiRrVIvBETgI0YwROhKDYxzSfkrTWVcxl53mRl0x2Ux6CzYBwhwLt4APKo+ kiEVTTu4MjhGV0bAjClvvvV2J/6vTRWKM+3Hlq1H/eVgwuULFI+sCpXAJm86ycV+R6Yn M/Vt0LWYyWXZw4g5DGB88YrNlnmN13dsyL3SwNgIPgFzk+nT7diRDCl2qqKYOdbnbfxN RzRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=hf+aFBRB; 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 b195si969280qka.201.2017.10.20.16.40.06 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 20 Oct 2017 16:40:06 -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=hf+aFBRB; 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]:56056 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5gtY-00070w-F7 for patch@linaro.org; Fri, 20 Oct 2017 19:40:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44550) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5gbG-0006FL-VE for qemu-devel@nongnu.org; Fri, 20 Oct 2017 19:21:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5gbE-0007n3-4G for qemu-devel@nongnu.org; Fri, 20 Oct 2017 19:21:10 -0400 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]:56984) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e5gbD-0007mx-UA for qemu-devel@nongnu.org; Fri, 20 Oct 2017 19:21:08 -0400 Received: by mail-pf0-x244.google.com with SMTP id b85so13056357pfj.13 for ; Fri, 20 Oct 2017 16:21:07 -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=hf+aFBRBJlcldVns3WJZT1oJqT6K5cc7dVZ4gI7WzdJ4yh6PlSPOzPTppUnxoKj/oc OYK/KE/FZjPS0jkGyxHF4km318WMFkV41YlPbDn9o9gUXSm7QOyfa9eCPeABbaYtiEgz eQpUX+h85g64/Ai73LG7p00zC8xAG6YCXfuGg= 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=Rg3VEGHsOjOxcexVM0NJNEYh4oOzH2GRA+PKr0F9GbpS6ze3yirxPp9zHmnNZ7I9Tf 64VR5Jfp/7/COwyoUzR+VveUc67Zk7VcO+QfoKGRvxOUAB32LIEStct6pt+29Ru1Tvkp x4LxFWUVjYSR64Uy7M73PYP0jBmOuoRInylKrf87HWaUOlFzYalmV8snraE5MqjXrCKx c7dB6o5vG1LAvJL8KJeMv3pAZTAmVvWkINyB97irsorVGmEYo0eElYDXIl3aYpfUdZ8Z nl/CJtHHsa6R3Xh59T7/3QLFVLLtUnmg8WdYJkOwretHo/ZHVO10LoS4C1pN4ssdUdDn gLvw== X-Gm-Message-State: AMCzsaXUVtU1SYfqoTSrO2WYDMPxmAc3vxPdcXzOZLg0YbANCQcEcRYs /3BpR/JSuJdkOrkSYC5BcPz5xtgl3LI= X-Google-Smtp-Source: ABhQp+Qv5SLF7kbJztP9k7XQ0iAcKi7DZrk3p2LYp6tzgQ56MmjJly9FwzDz8yk7uvY+4yX9Wb/VfA== X-Received: by 10.84.162.204 with SMTP id o12mr5212699plg.230.1508541666803; Fri, 20 Oct 2017 16:21:06 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-165-104.tukw.qwest.net. [97.113.165.104]) by smtp.gmail.com with ESMTPSA id a17sm3532594pfk.173.2017.10.20.16.21.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2017 16:21:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 20 Oct 2017 16:19:59 -0700 Message-Id: <20171020232023.15010-29-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171020232023.15010-1-richard.henderson@linaro.org> References: <20171020232023.15010-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::244 Subject: [Qemu-devel] [PATCH v7 28/52] 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: pbonzini@redhat.com, cota@braap.org, f4bug@amsat.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 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) {