From nobody Tue Apr 30 20:44:42 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=quicinc.com ARC-Seal: i=1; a=rsa-sha256; t=1622589732; cv=none; d=zohomail.com; s=zohoarc; b=RIceUXR1kSWBe3rrtIq7AQ9zyYdHB0cnEe7FwnBeYbI5ktTCDyyrnKH5vXJJ9AQY75H6Sglz8PpmvQt2t1zE3na6+HsVOSeTEJ9VSHNxquMFDtTYpKn7Y3PosDZYRbAbvVvIhuJClOrpGasxNtqcHr4bnJwS8s45WCsvduNfLGU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622589732; 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=Sj0Uk8PYsvIc7vs41394HwVDEr8ScZlhm0Ps3RSJ62Y=; b=W0TTb/BOY6OG8Ac65AdKyBYKGsjfXhWrd+a5zckNyl9JY9+U7YVtTBrBuelFEDwkwxBFYYIyIG57FLOOCInfigqEmG/5Ke4AyxKWo2df0Rd4ipvCGP2+0tDB5U1h0Vwg5jfksajWai6G8r7XB02lbAhhXoIW+kmYKeyOozwYnyE= 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+importer2=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 1622589732662655.542503600726; Tue, 1 Jun 2021 16:22:12 -0700 (PDT) Received: from localhost ([::1]:34966 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loDi7-0005sI-Jv for importer2@patchew.org; Tue, 01 Jun 2021 19:22:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53774) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loDfs-0003kB-DV for qemu-devel@nongnu.org; Tue, 01 Jun 2021 19:19:52 -0400 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]:25587) by eggs.gnu.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1loDfq-00068D-5R for qemu-devel@nongnu.org; Tue, 01 Jun 2021 19:19:52 -0400 Received: from unknown (HELO ironmsg01-sd.qualcomm.com) ([10.53.140.141]) by alexa-out-sd-02.qualcomm.com with ESMTP; 01 Jun 2021 16:19:46 -0700 Received: from vu-tsimpson-aus.qualcomm.com (HELO vu-tsimpson1-aus.qualcomm.com) ([10.222.150.1]) by ironmsg01-sd.qualcomm.com with ESMTP; 01 Jun 2021 16:19:46 -0700 Received: by vu-tsimpson1-aus.qualcomm.com (Postfix, from userid 47164) id 186E1CA6; 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=1622589590; x=1654125590; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Sj0Uk8PYsvIc7vs41394HwVDEr8ScZlhm0Ps3RSJ62Y=; b=XxeS2dTIYtXPk5AufMgpOCH0dU+79Il7cES+KOPuXnmXQJhFVZUgmtvR sOpM4DRwysKO/A3mxkpfqa/a6sjrg1SQYiXKeb6WFzyH7/mNbAQCbD77T zQBfuqnzz+3+kjiOBk0PoJjE3d2y1tYxP0LJL/yVeS2UXc2kqcuJTyZVC A=; X-QCInternal: smtphost From: Taylor Simpson To: qemu-devel@nongnu.org Subject: [PATCH v2 1/4] Hexagon (target/hexagon) fix bug in fLSBNEW* Date: Tue, 1 Jun 2021 18:19:41 -0500 Message-Id: <1622589584-22571-2-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=199.106.114.39; envelope-from=tsimpson@qualcomm.com; helo=alexa-out-sd-02.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, 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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Change fLSBNEW/fLSBNEW0/fLSBNEW1 from copy to "x & 1" Remove gen_logical_not function Clean up fLSBNEWNOT to use andi-1 followed by xori-1 Test cases added to tests/tcg/hexagon/misc.c Signed-off-by: Taylor Simpson Reviewed-by: Richard Henderson --- target/hexagon/macros.h | 27 ++++++++++----------------- target/hexagon/op_helper.c | 5 ----- tests/tcg/hexagon/misc.c | 39 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 48 insertions(+), 23 deletions(-) diff --git a/target/hexagon/macros.h b/target/hexagon/macros.h index b726c3b..2b208f3 100644 --- a/target/hexagon/macros.h +++ b/target/hexagon/macros.h @@ -239,33 +239,26 @@ static inline void gen_pred_cancel(TCGv pred, int slo= t_num) #endif =20 #ifdef QEMU_GENERATE -#define fLSBNEW(PVAL) tcg_gen_mov_tl(LSB, (PVAL)) -#define fLSBNEW0 tcg_gen_mov_tl(LSB, hex_new_pred_value[0]) -#define fLSBNEW1 tcg_gen_mov_tl(LSB, hex_new_pred_value[1]) +#define fLSBNEW(PVAL) tcg_gen_andi_tl(LSB, (PVAL), 1) +#define fLSBNEW0 tcg_gen_andi_tl(LSB, hex_new_pred_value[0], 1) +#define fLSBNEW1 tcg_gen_andi_tl(LSB, hex_new_pred_value[1], 1) #else -#define fLSBNEW(PVAL) (PVAL) -#define fLSBNEW0 new_pred_value(env, 0) -#define fLSBNEW1 new_pred_value(env, 1) +#define fLSBNEW(PVAL) ((PVAL) & 1) +#define fLSBNEW0 (env->new_pred_value[0] & 1) +#define fLSBNEW1 (env->new_pred_value[1] & 1) #endif =20 #ifdef QEMU_GENERATE -static inline void gen_logical_not(TCGv dest, TCGv src) -{ - TCGv one =3D tcg_const_tl(1); - TCGv zero =3D tcg_const_tl(0); - - tcg_gen_movcond_tl(TCG_COND_NE, dest, src, zero, zero, one); - - tcg_temp_free(one); - tcg_temp_free(zero); -} #define fLSBOLDNOT(VAL) \ do { \ tcg_gen_andi_tl(LSB, (VAL), 1); \ tcg_gen_xori_tl(LSB, LSB, 1); \ } while (0) #define fLSBNEWNOT(PNUM) \ - gen_logical_not(LSB, (PNUM)) + do { \ + tcg_gen_andi_tl(LSB, (PNUM), 1); \ + tcg_gen_xori_tl(LSB, LSB, 1); \ + } while (0) #else #define fLSBNEWNOT(PNUM) (!fLSBNEW(PNUM)) #define fLSBOLDNOT(VAL) (!fLSBOLD(VAL)) diff --git a/target/hexagon/op_helper.c b/target/hexagon/op_helper.c index 63dd685..4595559 100644 --- a/target/hexagon/op_helper.c +++ b/target/hexagon/op_helper.c @@ -128,11 +128,6 @@ void HELPER(debug_start_packet)(CPUHexagonState *env) } } =20 -static int32_t new_pred_value(CPUHexagonState *env, int pnum) -{ - return env->new_pred_value[pnum]; -} - /* Checks for bookkeeping errors between disassembly context and runtime */ void HELPER(debug_check_store_width)(CPUHexagonState *env, int slot, int c= heck) { diff --git a/tests/tcg/hexagon/misc.c b/tests/tcg/hexagon/misc.c index 17c3919..9e139f3 100644 --- a/tests/tcg/hexagon/misc.c +++ b/tests/tcg/hexagon/misc.c @@ -181,6 +181,19 @@ static inline void S4_storeirifnew_io(void *p, int pre= d) : "p0", "memory"); } =20 +static int L2_ploadrifnew_pi(void *p, int pred) +{ + int result; + asm volatile("%0 =3D #31\n\t" + "{\n\t" + " p0 =3D cmp.eq(%1, #1)\n\t" + " if (!p0.new) %0 =3D memw(%2++#4)\n\t" + "}\n\t" + : "=3Dr"(result) : "r"(pred), "r"(p) + : "p0"); + return result; +} + /* * Test that compound-compare-jump is executed in 2 parts * First we have to do all the compares in the packet and @@ -298,8 +311,24 @@ static int auto_and(void) return retval; } =20 +void test_lsbnew(void) +{ + int result; + + asm("r0 =3D #2\n\t" + "r1 =3D #5\n\t" + "{\n\t" + " p0 =3D r0\n\t" + " if (p0.new) r1 =3D #3\n\t" + "}\n\t" + "%0 =3D r1\n\t" + : "=3Dr"(result) :: "r0", "r1", "p0"); + check(result, 5); +} + int main() { + int res; long long res64; int pred; =20 @@ -394,6 +423,12 @@ int main() S4_storeirifnew_io(&array[8], 1); check(array[9], 9); =20 + memcpy(array, init, sizeof(array)); + res =3D L2_ploadrifnew_pi(&array[6], 0); + check(res, 6); + res =3D L2_ploadrifnew_pi(&array[7], 1); + check(res, 31); + int x =3D cmpnd_cmp_jump(); check(x, 12); =20 @@ -406,7 +441,7 @@ int main() check((int)pair, 5); check((int)(pair >> 32), 7); =20 - int res =3D test_clrtnew(1, 7); + res =3D test_clrtnew(1, 7); check(res, 0); res =3D test_clrtnew(2, 7); check(res, 7); @@ -422,6 +457,8 @@ int main() res =3D auto_and(); check(res, 0); =20 + test_lsbnew(); + puts(err ? "FAIL" : "PASS"); return err; } --=20 2.7.4 From nobody Tue Apr 30 20:44:42 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=quicinc.com ARC-Seal: i=1; a=rsa-sha256; t=1622589723; cv=none; d=zohomail.com; s=zohoarc; b=ERMjzoB1YFIhjrSgzaovzlTqDyMf/aFf7U0Nb0akvVjfwGCQnmQOc1G3R3nmyqImAYaJ5hO9Yy9CREM2C6ZVs3VL5RcYuvuBFZuK+JEdUOGU4Q/MazkhhHaE53PzrfX67zcYz6ueqG1F54gK+GcI0ZK5TWtGMKqEbFOq9UGd8ZU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622589723; 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=tWHtKBgnflOpZom5LwTNqGs6gHFhKWBork947kc3apk=; b=Rfm/vohmw2eD9g4VK+g434u4gG/DzCZx3NIX+NkAToo4Fn0eRiVtULrPYwZCHQ511Ci1W8b0mQr+qhmyiAdaM6fX8Cq7ayDFURT+fLBAT1gVWOt+5H7RGtdupoA35ZXIYUGGVnNHWoS7yavZU5pIvNXV8d9eQy2gmgHn1pRJrdI= 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+importer2=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 1622589723523222.08439499053588; Tue, 1 Jun 2021 16:22:03 -0700 (PDT) Received: from localhost ([::1]:34770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loDhy-0005kh-Hv for importer2@patchew.org; Tue, 01 Jun 2021 19:22:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53762) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loDfr-0003ii-RZ for qemu-devel@nongnu.org; Tue, 01 Jun 2021 19:19:51 -0400 Received: from alexa-out-sd-01.qualcomm.com ([199.106.114.38]:13693) by eggs.gnu.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1loDfp-00068C-Ku for qemu-devel@nongnu.org; Tue, 01 Jun 2021 19:19:51 -0400 Received: from unknown (HELO ironmsg-SD-alpha.qualcomm.com) ([10.53.140.30]) by alexa-out-sd-01.qualcomm.com with ESMTP; 01 Jun 2021 16:19:46 -0700 Received: from vu-tsimpson-aus.qualcomm.com (HELO vu-tsimpson1-aus.qualcomm.com) ([10.222.150.1]) by ironmsg-SD-alpha.qualcomm.com with ESMTP; 01 Jun 2021 16:19:46 -0700 Received: by vu-tsimpson1-aus.qualcomm.com (Postfix, from userid 47164) id 2BB69D93; 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=1622589589; x=1654125589; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=tWHtKBgnflOpZom5LwTNqGs6gHFhKWBork947kc3apk=; b=GFAkWr3/XPOI3g2BGwd3/3MmABAWq0Qxr13hJDe3TylKJvaNEKXtrJEX jlyWrfDQgA59QYKR1vTnwPIx4s/0PGvw9qESLL/lytFgv5HDSnilIgkzY o6TqSLXyyyJgRNrCHyns/m8xhZV9XO5lDOTToLKqRt3+TbiAjtpDZA7x/ Q=; X-QCInternal: smtphost From: Taylor Simpson To: qemu-devel@nongnu.org Subject: [PATCH v2 2/4] Hexagon (target/hexagon) fix l2fetch instructions Date: Tue, 1 Jun 2021 18:19:42 -0500 Message-Id: <1622589584-22571-3-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+importer2=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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Y4_l2fetch =3D=3D l2fetch(Rs32, Rt32) Y5_l2fetch =3D=3D l2fetch(Rs32, Rtt32) The semantics for these instructions are present, but the encodings are missing. Note that these are treated as nops in qemu, so we add overrides. Test case added to tests/tcg/hexagon/misc.c Signed-off-by: Taylor Simpson Reviewed-by: Richard Henderson --- target/hexagon/gen_tcg.h | 11 +++++++++++ tests/tcg/hexagon/misc.c | 9 +++++++++ target/hexagon/imported/encode_pp.def | 3 +++ 3 files changed, 23 insertions(+) diff --git a/target/hexagon/gen_tcg.h b/target/hexagon/gen_tcg.h index 18fcdbc..a375d6a 100644 --- a/target/hexagon/gen_tcg.h +++ b/target/hexagon/gen_tcg.h @@ -734,4 +734,15 @@ #define fGEN_TCG_F2_dfmpyhh(SHORTCODE) \ gen_helper_dfmpyhh(RxxV, cpu_env, RxxV, RssV, RttV) =20 +/* Nothing to do for these in qemu, need to suppress compiler warnings */ +#define fGEN_TCG_Y4_l2fetch(SHORTCODE) \ + do { \ + RsV =3D RsV; \ + RtV =3D RtV; \ + } while (0) +#define fGEN_TCG_Y5_l2fetch(SHORTCODE) \ + do { \ + RsV =3D RsV; \ + } while (0) + #endif diff --git a/tests/tcg/hexagon/misc.c b/tests/tcg/hexagon/misc.c index 9e139f3..f0b1947 100644 --- a/tests/tcg/hexagon/misc.c +++ b/tests/tcg/hexagon/misc.c @@ -326,6 +326,13 @@ void test_lsbnew(void) check(result, 5); } =20 +void test_l2fetch(void) +{ + /* These don't do anything in qemu, just make sure they don't assert */ + asm volatile ("l2fetch(r0, r1)\n\t" + "l2fetch(r0, r3:2)\n\t"); +} + int main() { int res; @@ -459,6 +466,8 @@ int main() =20 test_lsbnew(); =20 + test_l2fetch(); + puts(err ? "FAIL" : "PASS"); return err; } diff --git a/target/hexagon/imported/encode_pp.def b/target/hexagon/importe= d/encode_pp.def index 35ae3d2..939c6fc 100644 --- a/target/hexagon/imported/encode_pp.def +++ b/target/hexagon/imported/encode_pp.def @@ -493,6 +493,9 @@ DEF_ENC32(Y2_dccleana, ICLASS_ST" 000 00 00sssss PP= ------ --------") DEF_ENC32(Y2_dcinva, ICLASS_ST" 000 00 01sssss PP------ --------") DEF_ENC32(Y2_dccleaninva, ICLASS_ST" 000 00 10sssss PP------ --------") =20 +DEF_ENC32(Y4_l2fetch, ICLASS_ST" 011 00 00sssss PP-ttttt 000-----") +DEF_ENC32(Y5_l2fetch, ICLASS_ST" 011 01 00sssss PP-ttttt --------") + /*******************************/ /* */ /* */ --=20 2.7.4 From nobody Tue Apr 30 20:44:42 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=quicinc.com ARC-Seal: i=1; a=rsa-sha256; t=1622589849; cv=none; d=zohomail.com; s=zohoarc; b=PcPb3+aK9Oeb+2+txP/P8ovsbtBpk39q0SZmofGtGTz5alCi/Sv1uJChgXhjh7Jx/g458DxK4iPpMsEjkxrhJudZNbouUxQpwMKnlxzY7L6C20NzIMDWSkChbUroAlPA3iM70+ISFqCmHly29hdhBwMQhwV0YWYdBga1VPZFico= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622589849; 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=kfzxASh6YdieMN5/flXDkkIXIFNCLKW9PWVjboeLWVO46gMpvqCTae8wmuk0TY5iZjpLZnVLiIH/bf3kuq9NMWx5qzAqyUQJ034wSVHylgPP1CP0G3EBXNOLjIguyWtE/qje3/k9TvNajIDPVqFuwj/prTuXtPwMcRWzOq24U5w= 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+importer2=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 1622589849058418.32814431774807; Tue, 1 Jun 2021 16:24:09 -0700 (PDT) Received: from localhost ([::1]:41256 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loDk0-0001eU-3F for importer2@patchew.org; Tue, 01 Jun 2021 19:24:08 -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+importer2=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+importer2=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 From nobody Tue Apr 30 20:44:42 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=quicinc.com ARC-Seal: i=1; a=rsa-sha256; t=1622589880; cv=none; d=zohomail.com; s=zohoarc; b=PAw59PUSdmkCn31SMOyvwIT7k2Tt2xzKlcQ0YdOyGTRHSK9D8SEHCg2/bHa5jBhsm0AhsofmMsYEY0WH84AS93pz7HbkAyMvI/0mRUl6MnDYaW55VvNODS6cRcDY84EO1j8RQzOPiB43Zngg0z8nV7jud98n4ws1uK1QUDCetmI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622589880; 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=Rv5DBS1Musmf13fPECtlUJXKVvSBh0Y++ngJBgfyDeA=; b=LLZGVND57Mug9xxUP0JKM0m2zwRZTAfEdDOiyRDsRbzbqRa2nZPpTw6MOmaJJTVhzsZBSKAMcj0JYtGojMah8Rtm5clr63AXbYc9AmDQR5XNTsO9/RxN4FbDAQwob0dnwBBKsvMiIdqQD7sRSvRg53HhlbTVJA8rN3ETqzE4mdU= 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+importer2=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 162258988058022.336370126294128; Tue, 1 Jun 2021 16:24:40 -0700 (PDT) Received: from localhost ([::1]:44004 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loDkV-0003TA-K2 for importer2@patchew.org; Tue, 01 Jun 2021 19:24:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53804) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loDfu-0003oE-Pt for qemu-devel@nongnu.org; Tue, 01 Jun 2021 19:19:54 -0400 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]:25587) by eggs.gnu.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1loDfs-00068D-R8 for qemu-devel@nongnu.org; Tue, 01 Jun 2021 19:19:54 -0400 Received: from unknown (HELO ironmsg01-sd.qualcomm.com) ([10.53.140.141]) by alexa-out-sd-02.qualcomm.com with ESMTP; 01 Jun 2021 16:19:46 -0700 Received: from vu-tsimpson-aus.qualcomm.com (HELO vu-tsimpson1-aus.qualcomm.com) ([10.222.150.1]) by ironmsg01-sd.qualcomm.com with ESMTP; 01 Jun 2021 16:19:46 -0700 Received: by vu-tsimpson1-aus.qualcomm.com (Postfix, from userid 47164) id 4EC89F03; 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=Rv5DBS1Musmf13fPECtlUJXKVvSBh0Y++ngJBgfyDeA=; b=oqK0ZP+aYgyw4SE0FEm0bZTxpVOyZNZm6CVE4upmC4LAMyR/h12PeAI4 nchA8DKHvGK55gRI456xFK5xV7Ub2AMjRLxg4dgWpsywJXqIzx+ZDJCD2 6DedmK3fIw4sFRAUZ52HChUcaI1MJTudjD61ClRPItqEMmh2tKO2WVjnx k=; X-QCInternal: smtphost From: Taylor Simpson To: qemu-devel@nongnu.org Subject: [PATCH v2 4/4] Hexagon (target/hexagon) remove unused TCG variables Date: Tue, 1 Jun 2021 18:19:44 -0500 Message-Id: <1622589584-22571-5-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=199.106.114.39; envelope-from=tsimpson@qualcomm.com; helo=alexa-out-sd-02.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, 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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Signed-off-by: Taylor Simpson --- target/hexagon/genptr.c | 6 ------ target/hexagon/translate.c | 11 ++--------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/target/hexagon/genptr.c b/target/hexagon/genptr.c index bd18cb1..5dbabe0 100644 --- a/target/hexagon/genptr.c +++ b/target/hexagon/genptr.c @@ -121,10 +121,7 @@ static void gen_log_reg_write_pair(int rnum, TCGv_i64 = val) =20 static inline void gen_log_pred_write(DisasContext *ctx, int pnum, TCGv va= l) { - TCGv zero =3D tcg_const_tl(0); TCGv base_val =3D tcg_temp_new(); - TCGv and_val =3D tcg_temp_new(); - TCGv pred_written =3D tcg_temp_new(); =20 tcg_gen_andi_tl(base_val, val, 0xff); =20 @@ -143,10 +140,7 @@ static inline void gen_log_pred_write(DisasContext *ct= x, int pnum, TCGv val) } tcg_gen_ori_tl(hex_pred_written, hex_pred_written, 1 << pnum); =20 - tcg_temp_free(zero); tcg_temp_free(base_val); - tcg_temp_free(and_val); - tcg_temp_free(pred_written); } =20 static inline void gen_read_p3_0(TCGv control_reg) diff --git a/target/hexagon/translate.c b/target/hexagon/translate.c index 9a37644..b23d36a 100644 --- a/target/hexagon/translate.c +++ b/target/hexagon/translate.c @@ -273,7 +273,6 @@ static void gen_reg_writes(DisasContext *ctx) =20 static void gen_pred_writes(DisasContext *ctx, Packet *pkt) { - TCGv zero, control_reg, pval; int i; =20 /* Early exit if the log is empty */ @@ -281,10 +280,6 @@ static void gen_pred_writes(DisasContext *ctx, Packet = *pkt) return; } =20 - zero =3D tcg_const_tl(0); - control_reg =3D tcg_temp_new(); - pval =3D tcg_temp_new(); - /* * Only endloop instructions will conditionally * write a predicate. If there are no endloop @@ -292,6 +287,7 @@ static void gen_pred_writes(DisasContext *ctx, Packet *= pkt) * write of the predicates. */ if (pkt->pkt_has_endloop) { + TCGv zero =3D tcg_const_tl(0); TCGv pred_written =3D tcg_temp_new(); for (i =3D 0; i < ctx->preg_log_idx; i++) { int pred_num =3D ctx->preg_log[i]; @@ -302,6 +298,7 @@ static void gen_pred_writes(DisasContext *ctx, Packet *= pkt) hex_new_pred_value[pred_num], hex_pred[pred_num]); } + tcg_temp_free(zero); tcg_temp_free(pred_written); } else { for (i =3D 0; i < ctx->preg_log_idx; i++) { @@ -314,10 +311,6 @@ static void gen_pred_writes(DisasContext *ctx, Packet = *pkt) } } } - - tcg_temp_free(zero); - tcg_temp_free(control_reg); - tcg_temp_free(pval); } =20 static void gen_check_store_width(DisasContext *ctx, int slot_num) --=20 2.7.4