From nobody Tue Nov 26 09:47:01 2024 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=1708978702; cv=none; d=zohomail.com; s=zohoarc; b=cERG0VQN5tqzKE1tMC8J/5n1ZqzJaLC7mvF/4WzatC28aeapaWnvZ/Exaj+wMXZkP1CwQ/muFtw8tcHFZqlwfHxy0ZSimsT0wq4xSOzXJJNKUphE9yttXIJoXOtizoKCNUqB5QPZLTVXgDo7ArgOaxHnioDDNkc8vwHAYrKgHyo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708978702; 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=U46l8139A+4KRjWcCLYKQaeKeiOnLqLqKh4dYSCOgv0=; b=eSGFprQUzNW9lrRm1od3j6PSI1IaRqrguNivVq5VGGxIZkVRCKdusrUHuuW/Dfd0dbPLkSB9TaI4RVlQf+eEdg0Sqa5pZkLQMo7ItmBxjagCILtWZ6Q24SLUerQDUXXQNOqzLgV9XyS0ohZqormT7ed1xZ19Fd3piWOug24QWkQ= 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 1708978702962740.9087748173527; Mon, 26 Feb 2024 12:18:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rehPw-0001el-S7; Mon, 26 Feb 2024 15:17:40 -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 1rehPv-0001e0-7U for qemu-devel@nongnu.org; Mon, 26 Feb 2024 15:17:39 -0500 Received: from mail-oi1-x231.google.com ([2607:f8b0:4864:20::231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rehPs-00080f-9Y for qemu-devel@nongnu.org; Mon, 26 Feb 2024 15:17:37 -0500 Received: by mail-oi1-x231.google.com with SMTP id 5614622812f47-3c132695f1bso2211438b6e.2 for ; Mon, 26 Feb 2024 12:17:35 -0800 (PST) Received: from taylor-ubuntu.austin.rr.com (068-203-008-061.res.spectrum.com. [68.203.8.61]) by smtp.gmail.com with ESMTPSA id by11-20020a056808340b00b003c1a4a9ad17sm330594oib.46.2024.02.26.12.17.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 12:17:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708978654; x=1709583454; 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=U46l8139A+4KRjWcCLYKQaeKeiOnLqLqKh4dYSCOgv0=; b=QJkde2e+YrDypsguCqjVwZqwamLyyFadwtPNNssHLgfMtB11ZBaTYzAsR0T8cEISZ7 9K8+nZFFzAMGWlymz9oxAWnzsszo0NEsuzj/uK+blTZCTiMcCpfYminyz6YQ2OT4ZWb2 rSygvpsSgYKsQlzPPN4T0N8oXMXiVMqQjnXGO7OCrp/Ty5S5ZKGiAtbuZq003xwnISKF LhXlGnGKQV1pA69MfxkIbB6ecR7lr82sMQIegM7Q7z9jBenNA0nn+793mRX5nZL4PrjN gODYQJVA9wEjpbOWNTCJpLdroZo0cyYqaVddEKaXJSNCFjQdiESJfXj/oD8a9QGyz1SB wjog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708978654; x=1709583454; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=U46l8139A+4KRjWcCLYKQaeKeiOnLqLqKh4dYSCOgv0=; b=deJS/SkrWJSyu/6yMgMGn+VrCfIXI2XOlg8Spkedem3f8KyhrGCafEWdPMm95imKjD Z+Ok+1YSbgUrANxkA2/L4nifVYQahxzC5MC5nkQLdU0tAGxg3/27LU54H61yrLPoQ+JO yqaFGFxBIexKnNbJ+pCU5LVT2IojxlOaSewOhIXnoJ5RGkL3E9LqWq0eNn6QMkUhN2ko kpw+Bn4OC81yigov/Zcqw0Nl7U91DXrnTlLQhxYU5otBQ73NwKu23JOZZX1z/nX0dQXl FYseaUOyvNLcxuJHkjb2eT8VjVxzr5+e5ro+179XZYetC3uAl0yviu8vL8YEIt8SuIut JD+w== X-Gm-Message-State: AOJu0YyAbNb5U2J6EWORNKeilEbNg8ofXcLyp4bDrJB9tFtgJ5yRUp5I fI2Ue5XT/ufE6CXUc2g17e0qtLq9g3qz/qkb1bKiR6VfrE7h/4bX9dvesof+A8k= X-Google-Smtp-Source: AGHT+IHt+qhzIoEYfFd+/u+8C5uGLpYDaMJGcX8nXgMeK+xSBcUJqm3UIGI8apQzt3BmtClFw1zQMw== X-Received: by 2002:a05:6808:130f:b0:3c1:81ad:f45f with SMTP id y15-20020a056808130f00b003c181adf45fmr210492oiv.28.1708978654268; Mon, 26 Feb 2024 12:17:34 -0800 (PST) From: Taylor Simpson To: qemu-devel@nongnu.org Cc: bcain@quicinc.com, quic_mathbern@quicinc.com, sidneym@quicinc.com, quic_mliebel@quicinc.com, richard.henderson@linaro.org, philmd@linaro.org, ale@rev.ng, anjo@rev.ng, ltaylorsimpson@gmail.com Subject: [PATCH 6/9] Hexagon (target/hexagon) Remove uses of op_regs_generated.h.inc Date: Mon, 26 Feb 2024 13:17:19 -0700 Message-Id: <20240226201722.391879-7-ltaylorsimpson@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240226201722.391879-1-ltaylorsimpson@gmail.com> References: <20240226201722.391879-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::231; envelope-from=ltaylorsimpson@gmail.com; helo=mail-oi1-x231.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, T_SCC_BODY_TEXT_LINE=-0.01 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: 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: 1708978703362100003 Signed-off-by: Taylor Simpson --- target/hexagon/opcodes.h | 4 -- target/hexagon/decode.c | 57 +++---------------------- target/hexagon/mmvec/decode_ext_mmvec.c | 34 +++------------ target/hexagon/opcodes.c | 28 ------------ 4 files changed, 13 insertions(+), 110 deletions(-) diff --git a/target/hexagon/opcodes.h b/target/hexagon/opcodes.h index fa7e321950..0ee11bd445 100644 --- a/target/hexagon/opcodes.h +++ b/target/hexagon/opcodes.h @@ -40,10 +40,6 @@ typedef enum { =20 extern const char * const opcode_names[]; =20 -extern const char * const opcode_reginfo[]; -extern const char * const opcode_rregs[]; -extern const char * const opcode_wregs[]; - typedef struct { const char * const encoding; const EncClass enc_class; diff --git a/target/hexagon/decode.c b/target/hexagon/decode.c index 84a3899556..23deba2426 100644 --- a/target/hexagon/decode.c +++ b/target/hexagon/decode.c @@ -115,24 +115,13 @@ static void decode_fill_newvalue_regno(Packet *packet) { int i, use_regidx, offset, def_idx, dst_idx; - uint16_t def_opcode, use_opcode; - char *dststr; =20 for (i =3D 1; i < packet->num_insns; i++) { if (GET_ATTRIB(packet->insn[i].opcode, A_DOTNEWVALUE) && !GET_ATTRIB(packet->insn[i].opcode, A_EXTENSION)) { - use_opcode =3D packet->insn[i].opcode; - - /* It's a store, so we're adjusting the Nt field */ - if (GET_ATTRIB(use_opcode, A_STORE)) { - use_regidx =3D strchr(opcode_reginfo[use_opcode], 't') - - opcode_reginfo[use_opcode]; - } else { /* It's a Jump, so we're adjusting the Ns field */ - use_regidx =3D strchr(opcode_reginfo[use_opcode], 's') - - opcode_reginfo[use_opcode]; - } - g_assert(packet->insn[i].new_read_idx !=3D -1 && - packet->insn[i].new_read_idx =3D=3D use_regidx); + + g_assert(packet->insn[i].new_read_idx !=3D -1); + use_regidx =3D packet->insn[i].new_read_idx; =20 /* * What's encoded at the N-field is the offset to who's produc= ing @@ -153,39 +142,9 @@ decode_fill_newvalue_regno(Packet *packet) */ g_assert(!((def_idx < 0) || (def_idx > (packet->num_insns - 1)= ))); =20 - /* - * packet->insn[def_idx] is the producer - * Figure out which type of destination it produces - * and the corresponding index in the reginfo - */ - def_opcode =3D packet->insn[def_idx].opcode; - dststr =3D strstr(opcode_wregs[def_opcode], "Rd"); - if (dststr) { - dststr =3D strchr(opcode_reginfo[def_opcode], 'd'); - } else { - dststr =3D strstr(opcode_wregs[def_opcode], "Rx"); - if (dststr) { - dststr =3D strchr(opcode_reginfo[def_opcode], 'x'); - } else { - dststr =3D strstr(opcode_wregs[def_opcode], "Re"); - if (dststr) { - dststr =3D strchr(opcode_reginfo[def_opcode], 'e'); - } else { - dststr =3D strstr(opcode_wregs[def_opcode], "Ry"); - if (dststr) { - dststr =3D strchr(opcode_reginfo[def_opcode], = 'y'); - } else { - g_assert_not_reached(); - } - } - } - } - g_assert(dststr !=3D NULL); - /* Now patch up the consumer with the register number */ - dst_idx =3D dststr - opcode_reginfo[def_opcode]; - g_assert(packet->insn[def_idx].dest_idx !=3D -1 && - packet->insn[def_idx].dest_idx =3D=3D dst_idx); + g_assert(packet->insn[def_idx].dest_idx !=3D -1); + dst_idx =3D packet->insn[def_idx].dest_idx; packet->insn[i].regno[use_regidx] =3D packet->insn[def_idx].regno[dst_idx]; /* @@ -366,11 +325,7 @@ static void decode_shuffle_for_execution(Packet *packe= t) for (flag =3D false, i =3D 0; i < last_insn + 1; i++) { int opcode =3D packet->insn[i].opcode; =20 - g_assert(packet->insn[i].has_pred_dest =3D=3D - (strstr(opcode_wregs[opcode], "Pd4") || - strstr(opcode_wregs[opcode], "Pe4"))); - if ((strstr(opcode_wregs[opcode], "Pd4") || - strstr(opcode_wregs[opcode], "Pe4")) && + if (packet->insn[i].has_pred_dest && GET_ATTRIB(opcode, A_STORE) =3D=3D 0) { /* This should be a compare (not a store conditional) */ if (flag) { diff --git a/target/hexagon/mmvec/decode_ext_mmvec.c b/target/hexagon/mmvec= /decode_ext_mmvec.c index c1320406df..f850d0154d 100644 --- a/target/hexagon/mmvec/decode_ext_mmvec.c +++ b/target/hexagon/mmvec/decode_ext_mmvec.c @@ -28,21 +28,15 @@ check_new_value(Packet *pkt) { /* .new value for a MMVector store */ int i, j; - const char *reginfo; - const char *destletters; - const char *dststr =3D NULL; uint16_t def_opcode; - char letter; =20 for (i =3D 1; i < pkt->num_insns; i++) { uint16_t use_opcode =3D pkt->insn[i].opcode; if (GET_ATTRIB(use_opcode, A_DOTNEWVALUE) && GET_ATTRIB(use_opcode, A_CVI) && GET_ATTRIB(use_opcode, A_STORE)) { - int use_regidx =3D strchr(opcode_reginfo[use_opcode], 's') - - opcode_reginfo[use_opcode]; - g_assert(pkt->insn[i].new_read_idx !=3D -1 && - pkt->insn[i].new_read_idx =3D=3D use_regidx); + int use_regidx =3D pkt->insn[i].new_read_idx; + g_assert(pkt->insn[i].new_read_idx !=3D -1); /* * What's encoded at the N-field is the offset to who's produc= ing * the value. @@ -70,33 +64,19 @@ check_new_value(Packet *pkt) =20 /* def_idx is the index of the producer */ def_opcode =3D pkt->insn[def_idx].opcode; - reginfo =3D opcode_reginfo[def_opcode]; - destletters =3D "dexy"; - for (j =3D 0; (letter =3D destletters[j]) !=3D 0; j++) { - dststr =3D strchr(reginfo, letter); - if (dststr !=3D NULL) { - break; - } - } - if ((dststr =3D=3D NULL) && GET_ATTRIB(def_opcode, A_CVI_GATH= ER)) { + if ((pkt->insn[def_idx].dest_idx =3D=3D -1) && + GET_ATTRIB(def_opcode, A_CVI_GATHER)) { pkt->insn[i].regno[use_regidx] =3D def_oreg; pkt->insn[i].new_value_producer_slot =3D pkt->insn[def_idx= ].slot; } else { - if (dststr =3D=3D NULL) { + if (pkt->insn[def_idx].dest_idx =3D=3D -1) { /* still not there, we have a bad packet */ g_assert_not_reached(); } - g_assert(pkt->insn[def_idx].dest_idx !=3D -1 && - pkt->insn[def_idx].dest_idx =3D=3D dststr - regin= fo); - int def_regnum =3D pkt->insn[def_idx].regno[dststr - regin= fo]; + int def_regnum =3D + pkt->insn[def_idx].regno[pkt->insn[def_idx].dest_idx]; /* Now patch up the consumer with the register number */ pkt->insn[i].regno[use_regidx] =3D def_regnum ^ def_oreg; - /* special case for (Vx,Vy) */ - dststr =3D strchr(reginfo, 'y'); - if (def_oreg && strchr(reginfo, 'x') && dststr) { - def_regnum =3D pkt->insn[def_idx].regno[dststr - regin= fo]; - pkt->insn[i].regno[use_regidx] =3D def_regnum; - } /* * We need to remember who produces this value to later * check if it was dynamically cancelled diff --git a/target/hexagon/opcodes.c b/target/hexagon/opcodes.c index 1f7f3def38..02ae9cf787 100644 --- a/target/hexagon/opcodes.c +++ b/target/hexagon/opcodes.c @@ -36,34 +36,6 @@ const char * const opcode_names[] =3D { #undef OPCODE }; =20 -const char * const opcode_reginfo[] =3D { -#define IMMINFO(TAG, SIGN, SIZE, SHAMT, SIGN2, SIZE2, SHAMT2) /* nothin= g */ -#define REGINFO(TAG, REGINFO, RREGS, WREGS) REGINFO, -#include "op_regs_generated.h.inc" - NULL -#undef REGINFO -#undef IMMINFO -}; - - -const char * const opcode_rregs[] =3D { -#define IMMINFO(TAG, SIGN, SIZE, SHAMT, SIGN2, SIZE2, SHAMT2) /* nothin= g */ -#define REGINFO(TAG, REGINFO, RREGS, WREGS) RREGS, -#include "op_regs_generated.h.inc" - NULL -#undef REGINFO -#undef IMMINFO -}; - - -const char * const opcode_wregs[] =3D { -#define IMMINFO(TAG, SIGN, SIZE, SHAMT, SIGN2, SIZE2, SHAMT2) /* nothin= g */ -#define REGINFO(TAG, REGINFO, RREGS, WREGS) WREGS, -#include "op_regs_generated.h.inc" - NULL -#undef REGINFO -#undef IMMINFO -}; =20 const char * const opcode_short_semantics[] =3D { #define DEF_SHORTCODE(TAG, SHORTCODE) [TAG] =3D #SHORTCODE, --=20 2.34.1