From nobody Mon Feb 9 20:10:18 2026 Delivered-To: importer@patchew.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=1622589841; cv=none; d=zohomail.com; s=zohoarc; b=hK7kkRBSijZ2RIRUDNICzmk380yRGZDLMCd1+O9MlJ3D0WSfwKu96X71xI7UcabSeIXLJDqzXcsZp5LezyeEDxQgkA9hS+Au4qd7cMl6t9m2yrDF0Q+JJh5Zmu1+jfazz1uZfCAQuuCVhUF5xO4CWDFGP5JdPg5F4tDyWcIEmLA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622589841; 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=91bR1ug+W+/hoEJkk4AWpyw3b7kvj8OtlmKcu3LMV7g=; b=b/CrC5EHE45rioXf8m5tny5GhZS4tb1LrPd4cdAYgu84s3ILyryRKzhTFvsFBUVXM9PxvobfdjP3GlXch0hmnyYwqWp9ZFr+Wna3XssUhGnni6BllFeRmthKpwX7USGJ5dv5E4dH6svWdJnDVnajYUNVqwesLTulWz7z4RfcGhQ= 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 1622589841047620.7151237271472; Tue, 1 Jun 2021 16:24:01 -0700 (PDT) Received: from localhost ([::1]:41256 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loDjs-0001eU-2w for importer@patchew.org; Tue, 01 Jun 2021 19:24:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53806) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loDfv-0003qJ-Ha for qemu-devel@nongnu.org; Tue, 01 Jun 2021 19:19:55 -0400 Received: from alexa-out-sd-01.qualcomm.com ([199.106.114.38]:61942) by eggs.gnu.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1loDfs-0006Bp-EE for qemu-devel@nongnu.org; Tue, 01 Jun 2021 19:19:55 -0400 Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by alexa-out-sd-01.qualcomm.com with ESMTP; 01 Jun 2021 16:19:47 -0700 Received: from vu-tsimpson-aus.qualcomm.com (HELO vu-tsimpson1-aus.qualcomm.com) ([10.222.150.1]) by ironmsg04-sd.qualcomm.com with ESMTP; 01 Jun 2021 16:19:46 -0700 Received: by vu-tsimpson1-aus.qualcomm.com (Postfix, from userid 47164) id 3ED1FDCF; Tue, 1 Jun 2021 18:19:46 -0500 (CDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1622589592; x=1654125592; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=91bR1ug+W+/hoEJkk4AWpyw3b7kvj8OtlmKcu3LMV7g=; b=cZ5O1a4jOKs4/Etse0A48Q+odT26SEH1IjpvgpvP5g42/Z5CeonNcwDk FaG2UI1qjdO7QrivbZGZSssT8hfXi7vFlSY5QWC8GWRrI5+1mW6BWgk2E Yz6jYDgq1tCVeJKsMqUpoAlJmauWFr6uysayhJeD+FcZBtyppcTjy7yHq M=; X-QCInternal: smtphost From: Taylor Simpson To: qemu-devel@nongnu.org Subject: [PATCH v2 3/4] Hexagon (target/hexagon) cleanup gen_store_conditional[48] functions Date: Tue, 1 Jun 2021 18:19:43 -0500 Message-Id: <1622589584-22571-4-git-send-email-tsimpson@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1622589584-22571-1-git-send-email-tsimpson@quicinc.com> References: <1622589584-22571-1-git-send-email-tsimpson@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=199.106.114.38; envelope-from=tsimpson@qualcomm.com; helo=alexa-out-sd-01.qualcomm.com X-Spam_score_int: -40 X-Spam_score: -4.1 X-Spam_bar: ---- X-Spam_report: (-4.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: ale@rev.ng, philmd@redhat.com, tsimpson@quicinc.com, richard.henderson@linaro.org, bcain@quicinc.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Previously the store-conditional code was writing to hex_pred[prednum]. Then, the fGEN_TCG override was reading from there to the destination variable so that the packet commit logic would handle it properly. The correct implementation is to write to the destination variable and don't have the extra read in the override. Remove the unused arguments from gen_store_conditional[48] Signed-off-by: Taylor Simpson Reviewed-by: Richard Henderson --- target/hexagon/gen_tcg.h | 4 ++-- target/hexagon/macros.h | 2 +- target/hexagon/genptr.c | 10 ++++------ 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/target/hexagon/gen_tcg.h b/target/hexagon/gen_tcg.h index a375d6a..ee94c90 100644 --- a/target/hexagon/gen_tcg.h +++ b/target/hexagon/gen_tcg.h @@ -424,9 +424,9 @@ #define fGEN_TCG_L4_loadd_locked(SHORTCODE) \ SHORTCODE #define fGEN_TCG_S2_storew_locked(SHORTCODE) \ - do { SHORTCODE; READ_PREG(PdV, PdN); } while (0) + SHORTCODE #define fGEN_TCG_S4_stored_locked(SHORTCODE) \ - do { SHORTCODE; READ_PREG(PdV, PdN); } while (0) + SHORTCODE =20 #define fGEN_TCG_STORE(SHORTCODE) \ do { \ diff --git a/target/hexagon/macros.h b/target/hexagon/macros.h index 2b208f3..84fa687 100644 --- a/target/hexagon/macros.h +++ b/target/hexagon/macros.h @@ -591,7 +591,7 @@ static inline TCGv gen_read_ireg(TCGv result, TCGv val,= int shift) =20 #ifdef QEMU_GENERATE #define fSTORE_LOCKED(NUM, SIZE, EA, SRC, PRED) \ - gen_store_conditional##SIZE(env, ctx, PdN, PRED, EA, SRC); + gen_store_conditional##SIZE(ctx, PRED, EA, SRC); #endif =20 #ifdef QEMU_GENERATE diff --git a/target/hexagon/genptr.c b/target/hexagon/genptr.c index 797a6c0..bd18cb1 100644 --- a/target/hexagon/genptr.c +++ b/target/hexagon/genptr.c @@ -334,8 +334,7 @@ static inline void gen_load_locked8u(TCGv_i64 dest, TCG= v vaddr, int mem_index) tcg_gen_mov_i64(hex_llsc_val_i64, dest); } =20 -static inline void gen_store_conditional4(CPUHexagonState *env, - DisasContext *ctx, int prednum, +static inline void gen_store_conditional4(DisasContext *ctx, TCGv pred, TCGv vaddr, TCGv src) { TCGLabel *fail =3D gen_new_label(); @@ -349,7 +348,7 @@ static inline void gen_store_conditional4(CPUHexagonSta= te *env, tmp =3D tcg_temp_new(); tcg_gen_atomic_cmpxchg_tl(tmp, hex_llsc_addr, hex_llsc_val, src, ctx->mem_idx, MO_32); - tcg_gen_movcond_tl(TCG_COND_EQ, hex_pred[prednum], tmp, hex_llsc_val, + tcg_gen_movcond_tl(TCG_COND_EQ, pred, tmp, hex_llsc_val, one, zero); tcg_temp_free(one); tcg_temp_free(zero); @@ -363,8 +362,7 @@ static inline void gen_store_conditional4(CPUHexagonSta= te *env, tcg_gen_movi_tl(hex_llsc_addr, ~0); } =20 -static inline void gen_store_conditional8(CPUHexagonState *env, - DisasContext *ctx, int prednum, +static inline void gen_store_conditional8(DisasContext *ctx, TCGv pred, TCGv vaddr, TCGv_i64 = src) { TCGLabel *fail =3D gen_new_label(); @@ -380,7 +378,7 @@ static inline void gen_store_conditional8(CPUHexagonSta= te *env, ctx->mem_idx, MO_64); tcg_gen_movcond_i64(TCG_COND_EQ, tmp, tmp, hex_llsc_val_i64, one, zero); - tcg_gen_extrl_i64_i32(hex_pred[prednum], tmp); + tcg_gen_extrl_i64_i32(pred, tmp); tcg_temp_free_i64(one); tcg_temp_free_i64(zero); tcg_temp_free_i64(tmp); --=20 2.7.4