From nobody Thu Nov 13 22:08:05 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail header.i=@quicinc.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=quicinc.com ARC-Seal: i=1; a=rsa-sha256; t=1582909824; cv=none; d=zohomail.com; s=zohoarc; b=WCPjHTtIOrqw8nIB+sqD3cS49gey/mlP0f7Tgv8nNjfUt0WlyMmlWXc0wr8/ZU/SNRDerOB30by4mqM2f9ewwn0ZAmdER8kCdlcXeG9nhzi3K+4Uq/D/03Cz70hvbHeHw25jalTIdLZ0PXunE3f4vRs3uj7l/OzHzduiYY+U3YI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582909824; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=sz7cTBLXZ39E2Ayr0LEt3+On+c/m/Mochko6fLoMR1g=; b=OUUpo3Z47z5Cp7TzT/Nybm+EzEBF7v+zg/05z6xVyQVDaU3NJSd15OIUtFZM+xP/VQjySlQdOAZXn5qRSTk2hUuWdPeDryWdfTTZ0MuXtPROi4deirlxv4B6dmTXhf5KpOxS191kb94770udUrc/1kq8jWGwCXCh/L7UVzMeqdw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail header.i=@quicinc.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582909824766969.4471243426598; Fri, 28 Feb 2020 09:10:24 -0800 (PST) Received: from localhost ([::1]:51006 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7j9b-0002Ah-Hb for importer@patchew.org; Fri, 28 Feb 2020 12:10:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58146) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7ilL-0004JQ-T2 for qemu-devel@nongnu.org; Fri, 28 Feb 2020 11:45:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j7ilK-0006RZ-M0 for qemu-devel@nongnu.org; Fri, 28 Feb 2020 11:45:19 -0500 Received: from alexa-out-sd-01.qualcomm.com ([199.106.114.38]:13235) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j7ilK-0005U6-A6 for qemu-devel@nongnu.org; Fri, 28 Feb 2020 11:45:18 -0500 Received: from unknown (HELO ironmsg02-sd.qualcomm.com) ([10.53.140.142]) by alexa-out-sd-01.qualcomm.com with ESMTP; 28 Feb 2020 08:44:31 -0800 Received: from vu-tsimpson-aus.qualcomm.com (HELO vu-tsimpson1-aus.qualcomm.com) ([10.222.150.1]) by ironmsg02-sd.qualcomm.com with ESMTP; 28 Feb 2020 08:44:31 -0800 Received: by vu-tsimpson1-aus.qualcomm.com (Postfix, from userid 47164) id D3ABF1102; Fri, 28 Feb 2020 10:44:30 -0600 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1582908318; x=1614444318; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sz7cTBLXZ39E2Ayr0LEt3+On+c/m/Mochko6fLoMR1g=; b=H212CCVj1gQwWmYlf0lImKaeLwSoILuhT2rVx/yBY8V8CE370c1fsIVi x0WCHSNNN8CFj1gBb3TF/J6C4tk1TDkILNxR1sYqB6q/Ckg0/Rr6JIu8+ fhAuRw3crEohz5fwCYKvSfIrordza9pbyeH+69ITPa63YzNQ1KqF6CT9D I=; From: Taylor Simpson To: qemu-devel@nongnu.org Subject: [RFC PATCH v2 35/67] Hexagon TCG generation helpers - step 2 Date: Fri, 28 Feb 2020 10:43:31 -0600 Message-Id: <1582908244-304-36-git-send-email-tsimpson@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1582908244-304-1-git-send-email-tsimpson@quicinc.com> References: <1582908244-304-1-git-send-email-tsimpson@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 199.106.114.38 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: riku.voipio@iki.fi, richard.henderson@linaro.org, laurent@vivier.eu, Taylor Simpson , philmd@redhat.com, aleksandar.m.mail@gmail.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Helpers for load-locked/store-conditional Signed-off-by: Taylor Simpson --- target/hexagon/genptr_helpers.h | 52 +++++++++++++++++++++++++++++++++++++= ++++ 1 file changed, 52 insertions(+) diff --git a/target/hexagon/genptr_helpers.h b/target/hexagon/genptr_helper= s.h index d8d5d95..c0e4c39 100644 --- a/target/hexagon/genptr_helpers.h +++ b/target/hexagon/genptr_helpers.h @@ -334,4 +334,56 @@ static inline TCGv gen_set_bit(int i, TCGv result, TCG= v src) return result; } =20 +static inline void gen_load_locked4u(TCGv dest, TCGv vaddr, int mem_index) +{ + tcg_gen_qemu_ld32u(dest, vaddr, mem_index); + tcg_gen_mov_tl(llsc_addr, vaddr); + tcg_gen_mov_tl(llsc_val, dest); +} + +static inline void gen_load_locked8u(TCGv_i64 dest, TCGv vaddr, int mem_in= dex) +{ + tcg_gen_qemu_ld64(dest, vaddr, mem_index); + tcg_gen_mov_tl(llsc_addr, vaddr); + tcg_gen_mov_i64(llsc_val_i64, dest); +} + +static inline void gen_store_conditional4(CPUHexagonState *env, + DisasContext *ctx, int prednum, + TCGv pred, TCGv vaddr, TCGv src) +{ + TCGv tmp =3D tcg_temp_new(); + TCGLabel *fail =3D gen_new_label(); + + tcg_gen_ld_tl(tmp, cpu_env, offsetof(CPUHexagonState, llsc_addr)); + tcg_gen_brcond_tl(TCG_COND_NE, vaddr, tmp, fail); + tcg_gen_movi_tl(tmp, prednum); + tcg_gen_st_tl(tmp, cpu_env, offsetof(CPUHexagonState, llsc_reg)); + tcg_gen_st_tl(src, cpu_env, offsetof(CPUHexagonState, llsc_newval)); + gen_exception(HEX_EXCP_SC4); + + gen_set_label(fail); + tcg_gen_movi_tl(pred, 0); + tcg_temp_free(tmp); +} + +static inline void gen_store_conditional8(CPUHexagonState *env, + DisasContext *ctx, int prednum, + TCGv pred, TCGv vaddr, TCGv_i64 = src) +{ + TCGv tmp =3D tcg_temp_new(); + TCGLabel *fail =3D gen_new_label(); + + tcg_gen_ld_tl(tmp, cpu_env, offsetof(CPUHexagonState, llsc_addr)); + tcg_gen_brcond_tl(TCG_COND_NE, vaddr, tmp, fail); + tcg_gen_movi_tl(tmp, prednum); + tcg_gen_st_tl(tmp, cpu_env, offsetof(CPUHexagonState, llsc_reg)); + tcg_gen_st_i64(src, cpu_env, offsetof(CPUHexagonState, llsc_newval_i64= )); + gen_exception(HEX_EXCP_SC8); + + gen_set_label(fail); + tcg_gen_movi_tl(pred, 0); + tcg_temp_free(tmp); +} + #endif --=20 2.7.4