From nobody Sun Apr 12 02:49:31 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1771880274; cv=none; d=zohomail.com; s=zohoarc; b=BvwR10oPSTfkwDTwM/1wCvoytKnRZTbuzo2eRQCGlR509dfaz9KkDXVqGu9MXaIfXHD6FDw/1sf4KH+EFqAyG5IupeVMu/seFeFpYFjO3c0au70FqvoLfbJ8Wplq/nT53mSeP5yq1I9sWGUDxcN6LsI9um20+SvW1fV2o+vsp8g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771880274; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=tVDBnQheb5AqqO1lYjCblA3eDzS8YuZY045hPHYSD2M=; b=NMuDQu4Zsv6eZ1w9zzmi9fsJ0QLx0lK+wyVhT2+RBzO5mudqSmOct7khEchgTnEEdz9Mec1TL7H7gsKDIkUDcl/LYNIYfMrMenzOnABWJfe1apQpucniU4YpFTg6/YcxW+rnfQw2dOA8e3OWnNpaNKG1gWMfwagtQE7CrEH8SVM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1771880274429746.7438157851284; Mon, 23 Feb 2026 12:57:54 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vucz1-0006eK-Te; Mon, 23 Feb 2026 15:56:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vucyz-0006dB-8V for qemu-devel@nongnu.org; Mon, 23 Feb 2026 15:56:45 -0500 Received: from mail-ot1-x32b.google.com ([2607:f8b0:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vucyx-000836-DM for qemu-devel@nongnu.org; Mon, 23 Feb 2026 15:56:45 -0500 Received: by mail-ot1-x32b.google.com with SMTP id 46e09a7af769-7d4c4b494fcso2722450a34.3 for ; Mon, 23 Feb 2026 12:56:43 -0800 (PST) Received: from taylor-ubuntu.hsd1.co.comcast.net (c-75-70-169-246.hsd1.co.comcast.net. [75.70.169.246]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7d52d04dbf1sm8011996a34.22.2026.02.23.12.56.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Feb 2026 12:56:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771880202; x=1772485002; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tVDBnQheb5AqqO1lYjCblA3eDzS8YuZY045hPHYSD2M=; b=OZAAdNO3ONMdRx1uxQGftXSIDWUXeqRr/aWKVXG41pXVTDV6bDoNYpCZ4iDy4hObDh Ny/BBLrNg/JvwOKcLnY+MJshMgm2mOfQtXyE9l1qFTMt+1F8eRHd3rC9kKeqYl/WI1Bp z8oUlemJOyg+dc602uYjcEVfEZAP9PlIX53CJxt+A7KcqrEgxWxBjZG2lVaNXXNz8Mdx Y0lmvdaKKLkxKdURXUdMbcs5iaIi6ZWMiGXvBKdlHWIJCsj2cJdPutUVwdwrQcsHIGK6 3MPecy1xHn/74d/SxbIvwlIDIU3DsIGuPINQcnRqihIQqmrEkcsFIaNKpR/TATVDq0A9 OiBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771880202; x=1772485002; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=tVDBnQheb5AqqO1lYjCblA3eDzS8YuZY045hPHYSD2M=; b=F9A7i9JuqnFjvssgayEK8Rr6CEq6qcyr4i1+aaJn9xWpkVcM0DFK0NvJP2VGchRhcr dlBQS/LG8rKHYJx09T/UOdwTHuPOfc88xaPWDSILXnLWOQGRRrejN2tKezyvDHp7KdoN PhnhzConPxxz8oxXPvQU84qDuetlrfQsAmvTa9C1D67G2f7UK61gj5vK4INrAO6m0qAh hh+Ms5nnO9bdNtDbJKbKPZ6nHt5W08tjSUDJ/Nj150QanJg/t9Cl11l/9lWJLi15rDpB Spka9D+3U+tWqJ51xGkrg/Myqj7i9LE+qzLYH+SFm55mjmctTXxUgegvKmjcQPs6BZ1J EOwg== X-Gm-Message-State: AOJu0YzZl67/GHg9u9RLfrX3pP+sjAxpcrhWO4ZwyG4TtkiFFhRvN46Q G4gvqjmhIG/GDVJ5RSwjVZlEVTeTR9R456p0tIkFJOjzvWBjeBzj/VhnvtuLaQ== X-Gm-Gg: AZuq6aIpst5kOA2h5sqsZs+bVuSThz2hlnz/bC+t61EnjMWmbbLwxNPoYCTXhPM6Tkm NlNjvFanGJYqNOhmfOZDOPT9aLN4bGtS7lOTXhYDi1p4HEsV6fxhMB6to2Qt9jgqwqku5KG0JMO YuiUR4hQVrnS2sAIs/m7jKnIp00YYYVpMaHMWcq6IIMEKHFPUujhbykc2tlRtADQ5ZmOVxZyHGd yDyz7l0EZG/DbHeyt23zSBMM0WwYJpeOw5SjMb23TB1Ema9gTemIpo5Q01TctvJWrCejNYN8E3/ UITaZtW2r64JOs48oz2I2x0IS0ttUtWKwEKISLS7apKrnrsz2bAAoA1hG35AkbAqYZb6JJpfjSZ b33TeY7PKRfGBdWwRE/EtlrOprQiTXl03VXxm5nxuTm6clHpwjPnT7mnaXDGyRLUk/bhc8LjQ25 0lVxWRM6AfCDHLcEO2E3JZ/O+QUBUs5t3RS95+Vy+ZPIKWIcBwBnyM5lwLM9AUhg1qI2OxNjLJT luben5uhrc+t0xh31g29z9zPw28JdJfNsbTWg== X-Received: by 2002:a05:6830:81ec:b0:7c7:6063:8e0f with SMTP id 46e09a7af769-7d52beb8817mr6524201a34.15.1771880201703; Mon, 23 Feb 2026 12:56:41 -0800 (PST) From: Taylor Simpson To: qemu-devel@nongnu.org Cc: brian.cain@oss.qualcomm.com, matheus.bernardino@oss.qualcomm.com, sid.manning@oss.qualcomm.com, marco.liebel@oss.qualcomm.com, richard.henderson@linaro.org, philmd@linaro.org, ale@rev.ng, anjo@rev.ng, ltaylorsimpson@gmail.com Subject: [PATCH 8/8] Hexagon (target/hexagon) Remove old way of detecting register multiwrites Date: Mon, 23 Feb 2026 13:56:32 -0700 Message-ID: <20260223205632.223714-9-ltaylorsimpson@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260223205632.223714-1-ltaylorsimpson@gmail.com> References: <20260223205632.223714-1-ltaylorsimpson@gmail.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=2607:f8b0:4864:20::32b; envelope-from=ltaylorsimpson@gmail.com; helo=mail-ot1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1771880276070158500 We now detect register multiwrites in packet analyzis instead of packet decoding Signed-off-by: Taylor Simpson --- target/hexagon/insn.h | 4 --- target/hexagon/decode.c | 54 ------------------------------- target/hexagon/translate.c | 5 --- target/hexagon/gen_trans_funcs.py | 10 ------ 4 files changed, 73 deletions(-) diff --git a/target/hexagon/insn.h b/target/hexagon/insn.h index 835b1c954e..5d59430da9 100644 --- a/target/hexagon/insn.h +++ b/target/hexagon/insn.h @@ -41,8 +41,6 @@ struct Instruction { uint32_t new_value_producer_slot:4; int32_t new_read_idx; int32_t dest_idx; - bool dest_is_pair; - bool dest_is_gpr; bool has_pred_dest; =20 bool part1; /* @@ -74,8 +72,6 @@ struct Packet { bool pkt_has_hvx; Insn *vhist_insn; =20 - bool pkt_has_write_conflict; - Insn insn[INSTRUCTIONS_MAX]; }; =20 diff --git a/target/hexagon/decode.c b/target/hexagon/decode.c index dbc9c630e8..1b0ed51323 100644 --- a/target/hexagon/decode.c +++ b/target/hexagon/decode.c @@ -647,55 +647,6 @@ decode_set_slot_number(Packet *pkt) return has_valid_slot_assignment(pkt); } =20 -/* - * Check for GPR write conflicts in the packet. - * A conflict exists when a register is written by more than one instructi= on - * and at least one of those writes is unconditional. - * - * TODO: handle the more general case of any - * packet w/multiple-register-write operands. - */ -static bool pkt_has_write_conflict(Packet *pkt) -{ - DECLARE_BITMAP(all_dest_gprs, 32) =3D { 0 }; - DECLARE_BITMAP(wreg_mult_gprs, 32) =3D { 0 }; - DECLARE_BITMAP(uncond_wreg_gprs, 32) =3D { 0 }; - DECLARE_BITMAP(conflict, 32); - - for (int i =3D 0; i < pkt->num_insns; i++) { - Insn *insn =3D &pkt->insn[i]; - int dest =3D insn->dest_idx; - - if (dest < 0 || !insn->dest_is_gpr) { - continue; - } - - int rnum =3D insn->regno[dest]; - bool is_uncond =3D !GET_ATTRIB(insn->opcode, A_CONDEXEC); - - if (test_bit(rnum, all_dest_gprs)) { - set_bit(rnum, wreg_mult_gprs); - } - set_bit(rnum, all_dest_gprs); - if (is_uncond) { - set_bit(rnum, uncond_wreg_gprs); - } - - if (insn->dest_is_pair) { - if (test_bit(rnum + 1, all_dest_gprs)) { - set_bit(rnum + 1, wreg_mult_gprs); - } - set_bit(rnum + 1, all_dest_gprs); - if (is_uncond) { - set_bit(rnum + 1, uncond_wreg_gprs); - } - } - } - - bitmap_and(conflict, wreg_mult_gprs, uncond_wreg_gprs, 32); - return !bitmap_empty(conflict, 32); -} - /* * decode_packet * Decodes packet with given words @@ -715,10 +666,6 @@ int decode_packet(DisasContext *ctx, int max_words, co= nst uint32_t *words, =20 /* Initialize */ memset(pkt, 0, sizeof(*pkt)); - for (i =3D 0; i < INSTRUCTIONS_MAX; i++) { - pkt->insn[i].dest_idx =3D -1; - pkt->insn[i].new_read_idx =3D -1; - } /* Try to build packet */ while (!end_of_packet && (words_read < max_words)) { Insn *insn =3D &pkt->insn[num_insns]; @@ -782,7 +729,6 @@ int decode_packet(DisasContext *ctx, int max_words, con= st uint32_t *words, /* Invalid packet */ return 0; } - pkt->pkt_has_write_conflict =3D pkt_has_write_conflict(pkt); } decode_fill_newvalue_regno(pkt); =20 diff --git a/target/hexagon/translate.c b/target/hexagon/translate.c index 32cb2e7fb4..1dc6dc70ed 100644 --- a/target/hexagon/translate.c +++ b/target/hexagon/translate.c @@ -994,11 +994,6 @@ static void decode_and_translate_packet(CPUHexagonStat= e *env, DisasContext *ctx) clear_pkt_ctx(ctx); analyze_packet(ctx); =20 - /* - * Check that the new method is a superset of the old methond - * Remove in a later patch - */ - g_assert(!pkt.pkt_has_write_conflict || pkt_has_write_conflict(ctx= )); if (pkt_has_write_conflict(ctx)) { gen_exception_decode_fail(ctx, words_read, HEX_CAUSE_REG_WRITE_CONFLICT); diff --git a/target/hexagon/gen_trans_funcs.py b/target/hexagon/gen_trans_f= uncs.py index 19c1f9fdea..45da1b7b5d 100755 --- a/target/hexagon/gen_trans_funcs.py +++ b/target/hexagon/gen_trans_funcs.py @@ -91,8 +91,6 @@ def gen_trans_funcs(f): new_read_idx =3D -1 dest_idx =3D -1 dest_idx_reg_id =3D None - dest_is_pair =3D "false" - dest_is_gpr =3D "false" has_pred_dest =3D "false" for regno, (reg_type, reg_id, *_) in enumerate(regs): reg =3D hex_common.get_register(tag, reg_type, reg_id) @@ -106,12 +104,6 @@ def gen_trans_funcs(f): if dest_idx_reg_id is None or reg_id < dest_idx_reg_id: dest_idx =3D regno dest_idx_reg_id =3D reg_id - dest_is_pair =3D ("true" - if isinstance(reg, hex_common.Pair) - else "false") - dest_is_gpr =3D ("true" - if reg_type =3D=3D "R" - else "false") if reg_type =3D=3D "P" and reg.is_written() and not reg.is_rea= d(): has_pred_dest =3D "true" =20 @@ -137,8 +129,6 @@ def gen_trans_funcs(f): f.write(code_fmt(f"""\ insn->new_read_idx =3D {new_read_idx}; insn->dest_idx =3D {dest_idx}; - insn->dest_is_pair =3D {dest_is_pair}; - insn->dest_is_gpr =3D {dest_is_gpr}; insn->has_pred_dest =3D {has_pred_dest}; """)) f.write(textwrap.dedent(f"""\ --=20 2.43.0