From nobody Wed Nov 27 04:52:22 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=1701741273; cv=none; d=zohomail.com; s=zohoarc; b=JSJL4mMnmm3lCezSpWmsrEUOn52CozHhzW08wgTBynFEfJRjtaWGMvf44eNHiZBz5yhbJkiO8iY3SceVbxG1H+wrkK82ZUexza9o9O+VlCYTjWumE3TjtchbsIPXDPqyJmfHxKDXmFvMvdD2PXBbBpihBF8nF01DtWhvlVOTgMg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1701741273; 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=vU7urSwAfTeA4lekHsW5PsTdoQI6A7TfKeK5Fim2yKU=; b=benPQ/GMBuJRDWXWSNiHakD+cjahjXec+RWVz/2jSVkIOvvvqGHWN54pv+N+uKUrWRqeY3yClKfgBXeDVbm4RSx/wRhtJnDGMMqcqtQRqJfCQWL7sPfsi+llOypKHXkbDnU01BEXGk3cX2YzZgBwF7FsIi/yMx8pnNSY25bWvD0= 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 17017412735071008.4261706967046; Mon, 4 Dec 2023 17:54:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rAKct-0002tS-I1; Mon, 04 Dec 2023 20:53:31 -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 1rAKcj-0002rH-RM for qemu-devel@nongnu.org; Mon, 04 Dec 2023 20:53:22 -0500 Received: from mail-oi1-x22c.google.com ([2607:f8b0:4864:20::22c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rAKcf-00062b-RC for qemu-devel@nongnu.org; Mon, 04 Dec 2023 20:53:21 -0500 Received: by mail-oi1-x22c.google.com with SMTP id 5614622812f47-3b844e3e817so2880912b6e.0 for ; Mon, 04 Dec 2023 17:53:17 -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 c4-20020aca1c04000000b003b8b7063a44sm1064624oic.44.2023.12.04.17.53.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 17:53:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701741196; x=1702345996; 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=vU7urSwAfTeA4lekHsW5PsTdoQI6A7TfKeK5Fim2yKU=; b=AvrypG26VcnqmKRZkLOdZIQUZBE1evj6GmHVZDo1y9pFlYvYvYC2WiUCNs7zLPOQSj FglNdNWCaWfuXGIWltFQMRt5cF+4HDWXTERCl0jWDtV37vG3QuhRoGlC8iAwecvEp+/h DQjtC7tVDs/HVQQG8/yw/F3Bv6oLpBnTwW3CZRlOV01vBWL981qafLjQHnnCAJnYlIQT WzJ/OHoM1DtGlMo+pC8GGwTlbabomUafKb8I9g0GF2HS4X3ugO36om9+OqXVI6cUPbO9 Y8/0nRr+VQA/wMFgReKjtiv+AA9IBAq8qVAPP8PJRw57ZtQlQMlhV3VVDff1+ltE7Uyn yCPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701741196; x=1702345996; 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=vU7urSwAfTeA4lekHsW5PsTdoQI6A7TfKeK5Fim2yKU=; b=Phe4gki2l30wF0CTuSH4qXlKeZABLDPyEvdyGvJi7Tq71OwU8H/J0H4e1utBRSA1NC 9mLtJyp8uGQTZK5TrzwlE22AUGAZ1bxBiAr9iMxck5vnm+J41aiC8LHrosLFcVFQLI40 NsWBAFVPE5+j861RttMY5sQgof8qbdXQbCNiL1Gz7ROmO0EnCp2j4sJPqcCtPq/vL0V/ KcLq1UWVl31poQhrVwFMvQldtjyQ359e/5eBVdQI5bKzKhgQ8NLlql/OGf/Pjkqp3gsz z/gvJyhdpIw2M27qkIR3RhVUyW5KUg1/TREd92IgcH9W4W3xTTgaEptmiMUEHE/KBF9R +++w== X-Gm-Message-State: AOJu0YxdbW8tyYV46KDoVqTw5LOHemLAIU+0uOAH49KqTo+6Uwzg0hDI p24NDkksrHsaGLqJ7pF4kpZ2FctqJWYSiw== X-Google-Smtp-Source: AGHT+IGpGeB+c6CQucE4HZVEDn2SDN3MNRgTRNMeaHH/ylSgR0BhuC5i17QVXBLuuL3qbzYc1yr8JA== X-Received: by 2002:a05:6808:1644:b0:3b8:bb04:dab5 with SMTP id az4-20020a056808164400b003b8bb04dab5mr2667256oib.52.1701741195711; Mon, 04 Dec 2023 17:53:15 -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 7/9] Hexagon (target/hexagon) Make generators object oriented - gen_analyze_funcs Date: Mon, 4 Dec 2023 18:53:01 -0700 Message-Id: <20231205015303.575807-8-ltaylorsimpson@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231205015303.575807-1-ltaylorsimpson@gmail.com> References: <20231205015303.575807-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::22c; envelope-from=ltaylorsimpson@gmail.com; helo=mail-oi1-x22c.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: 1701741275140100003 This patch conflicts with https://lists.gnu.org/archive/html/qemu-devel/2023-11/msg00729.html If that series goes in first, we'll rework this patch and vice versa. Signed-off-by: Taylor Simpson --- target/hexagon/gen_analyze_funcs.py | 163 +--------------------------- target/hexagon/hex_common.py | 151 ++++++++++++++++++++++++++ 2 files changed, 157 insertions(+), 157 deletions(-) diff --git a/target/hexagon/gen_analyze_funcs.py b/target/hexagon/gen_analy= ze_funcs.py index c3b521abef..a9af666cef 100755 --- a/target/hexagon/gen_analyze_funcs.py +++ b/target/hexagon/gen_analyze_funcs.py @@ -23,162 +23,6 @@ import hex_common =20 =20 -## -## Helpers for gen_analyze_func -## -def is_predicated(tag): - return "A_CONDEXEC" in hex_common.attribdict[tag] - - -def analyze_opn_old(f, tag, regtype, regid, regno): - regN =3D f"{regtype}{regid}N" - predicated =3D "true" if is_predicated(tag) else "false" - if regtype =3D=3D "R": - if regid in {"ss", "tt"}: - f.write(f" const int {regN} =3D insn->regno[{regno}];\n") - f.write(f" ctx_log_reg_read_pair(ctx, {regN});\n") - elif regid in {"dd", "ee", "xx", "yy"}: - f.write(f" const int {regN} =3D insn->regno[{regno}];\n") - f.write(f" ctx_log_reg_write_pair(ctx, {regN}, {predicated}= );\n") - elif regid in {"s", "t", "u", "v"}: - f.write(f" const int {regN} =3D insn->regno[{regno}];\n") - f.write(f" ctx_log_reg_read(ctx, {regN});\n") - elif regid in {"d", "e", "x", "y"}: - f.write(f" const int {regN} =3D insn->regno[{regno}];\n") - f.write(f" ctx_log_reg_write(ctx, {regN}, {predicated});\n") - else: - hex_common.bad_register(regtype, regid) - elif regtype =3D=3D "P": - if regid in {"s", "t", "u", "v"}: - f.write(f" const int {regN} =3D insn->regno[{regno}];\n") - f.write(f" ctx_log_pred_read(ctx, {regN});\n") - elif regid in {"d", "e", "x"}: - f.write(f" const int {regN} =3D insn->regno[{regno}];\n") - f.write(f" ctx_log_pred_write(ctx, {regN});\n") - else: - hex_common.bad_register(regtype, regid) - elif regtype =3D=3D "C": - if regid =3D=3D "ss": - f.write( - f" const int {regN} =3D insn->regno[{regno}] " - "+ HEX_REG_SA0;\n" - ) - f.write(f" ctx_log_reg_read_pair(ctx, {regN});\n") - elif regid =3D=3D "dd": - f.write(f" const int {regN} =3D insn->regno[{regno}] " "+ H= EX_REG_SA0;\n") - f.write(f" ctx_log_reg_write_pair(ctx, {regN}, {predicated}= );\n") - elif regid =3D=3D "s": - f.write( - f" const int {regN} =3D insn->regno[{regno}] " - "+ HEX_REG_SA0;\n" - ) - f.write(f" ctx_log_reg_read(ctx, {regN});\n") - elif regid =3D=3D "d": - f.write(f" const int {regN} =3D insn->regno[{regno}] " "+ H= EX_REG_SA0;\n") - f.write(f" ctx_log_reg_write(ctx, {regN}, {predicated});\n") - else: - hex_common.bad_register(regtype, regid) - elif regtype =3D=3D "M": - if regid =3D=3D "u": - f.write(f" const int {regN} =3D insn->regno[{regno}];\n") - f.write(f" ctx_log_reg_read(ctx, {regN});\n") - else: - hex_common.bad_register(regtype, regid) - elif regtype =3D=3D "V": - newv =3D "EXT_DFL" - if hex_common.is_new_result(tag): - newv =3D "EXT_NEW" - elif hex_common.is_tmp_result(tag): - newv =3D "EXT_TMP" - if regid in {"dd", "xx"}: - f.write(f" const int {regN} =3D insn->regno[{regno}];\n") - f.write( - f" ctx_log_vreg_write_pair(ctx, {regN}, {newv}, " f"{pr= edicated});\n" - ) - elif regid in {"uu", "vv"}: - f.write(f" const int {regN} =3D insn->regno[{regno}];\n") - f.write(f" ctx_log_vreg_read_pair(ctx, {regN});\n") - elif regid in {"s", "u", "v", "w"}: - f.write(f" const int {regN} =3D insn->regno[{regno}];\n") - f.write(f" ctx_log_vreg_read(ctx, {regN});\n") - elif regid in {"d", "x", "y"}: - f.write(f" const int {regN} =3D insn->regno[{regno}];\n") - f.write(f" ctx_log_vreg_write(ctx, {regN}, {newv}, " f"{pre= dicated});\n") - else: - hex_common.bad_register(regtype, regid) - elif regtype =3D=3D "Q": - if regid in {"d", "e", "x"}: - f.write(f" const int {regN} =3D insn->regno[{regno}];\n") - f.write(f" ctx_log_qreg_write(ctx, {regN});\n") - elif regid in {"s", "t", "u", "v"}: - f.write(f" const int {regN} =3D insn->regno[{regno}];\n") - f.write(f" ctx_log_qreg_read(ctx, {regN});\n") - else: - hex_common.bad_register(regtype, regid) - elif regtype =3D=3D "G": - if regid in {"dd"}: - f.write(f"// const int {regN} =3D insn->regno[{regno}];\n") - elif regid in {"d"}: - f.write(f"// const int {regN} =3D insn->regno[{regno}];\n") - elif regid in {"ss"}: - f.write(f"// const int {regN} =3D insn->regno[{regno}];\n") - elif regid in {"s"}: - f.write(f"// const int {regN} =3D insn->regno[{regno}];\n") - else: - hex_common.bad_register(regtype, regid) - elif regtype =3D=3D "S": - if regid in {"dd"}: - f.write(f"// const int {regN} =3D insn->regno[{regno}];\n") - elif regid in {"d"}: - f.write(f"// const int {regN} =3D insn->regno[{regno}];\n") - elif regid in {"ss"}: - f.write(f"// const int {regN} =3D insn->regno[{regno}];\n") - elif regid in {"s"}: - f.write(f"// const int {regN} =3D insn->regno[{regno}];\n") - else: - hex_common.bad_register(regtype, regid) - else: - hex_common.bad_register(regtype, regid) - - -def analyze_opn_new(f, tag, regtype, regid, regno): - regN =3D f"{regtype}{regid}N" - if regtype =3D=3D "N": - if regid in {"s", "t"}: - f.write(f" const int {regN} =3D insn->regno[{regno}];\n") - f.write(f" ctx_log_reg_read(ctx, {regN});\n") - else: - hex_common.bad_register(regtype, regid) - elif regtype =3D=3D "P": - if regid in {"t", "u", "v"}: - f.write(f" const int {regN} =3D insn->regno[{regno}];\n") - f.write(f" ctx_log_pred_read(ctx, {regN});\n") - else: - hex_common.bad_register(regtype, regid) - elif regtype =3D=3D "O": - if regid =3D=3D "s": - f.write(f" const int {regN} =3D insn->regno[{regno}];\n") - f.write(f" ctx_log_vreg_read(ctx, {regN});\n") - else: - hex_common.bad_register(regtype, regid) - else: - hex_common.bad_register(regtype, regid) - - -def analyze_opn(f, tag, regtype, regid, i): - if hex_common.is_pair(regid): - analyze_opn_old(f, tag, regtype, regid, i) - elif hex_common.is_single(regid): - if hex_common.is_old_val(regtype, regid, tag): - analyze_opn_old(f, tag, regtype, regid, i) - elif hex_common.is_new_val(regtype, regid, tag): - analyze_opn_new(f, tag, regtype, regid, i) - else: - hex_common.bad_register(regtype, regid) - else: - hex_common.bad_register(regtype, regid) - - ## ## Generate the code to analyze the instruction ## For A2_add: Rd32=3Dadd(Rs32,Rt32), { RdV=3DRsV+RtV;} @@ -203,7 +47,11 @@ def gen_analyze_func(f, tag, regs, imms): i =3D 0 ## Analyze all the registers for regtype, regid in regs: - analyze_opn(f, tag, regtype, regid, i) + reg =3D hex_common.get_register(tag, regtype, regid) + if reg.is_written(): + reg.analyze_write(f, tag, i) + else: + reg.analyze_read(f, i) i +=3D 1 =20 has_generated_helper =3D not hex_common.skip_qemu_helper( @@ -236,6 +84,7 @@ def main(): if is_idef_parser_enabled: hex_common.read_idef_parser_enabled_file(sys.argv[5]) hex_common.calculate_attribs() + hex_common.init_registers() tagregs =3D hex_common.get_tagregs() tagimms =3D hex_common.get_tagimms() =20 diff --git a/target/hexagon/hex_common.py b/target/hexagon/hex_common.py index 384f377621..e64d114cf3 100755 --- a/target/hexagon/hex_common.py +++ b/target/hexagon/hex_common.py @@ -475,6 +475,12 @@ def log_write(self, f, tag): f.write(code_fmt(f"""\ gen_log_reg_write(ctx, {self.reg_num}, {self.reg_tcg()}); """)) + def analyze_write(self, f, tag, regno): + self.decl_reg_num(f, regno) + predicated =3D "true" if is_predicated(tag) else "false" + f.write(code_fmt(f"""\ + ctx_log_reg_write(ctx, {self.reg_num}, {predicated}); + """)) =20 class GprSource(Register, Single, OldSource): def decl_tcg(self, f, tag, regno): @@ -482,12 +488,22 @@ def decl_tcg(self, f, tag, regno): f.write(code_fmt(f"""\ TCGv {self.reg_tcg()} =3D hex_gpr[{self.reg_num}]; """)) + def analyze_read(self, f, regno): + self.decl_reg_num(f, regno) + f.write(code_fmt(f"""\ + ctx_log_reg_read(ctx, {self.reg_num}); + """)) =20 class GprNewSource(Register, Single, NewSource): def decl_tcg(self, f, tag, regno): f.write(code_fmt(f"""\ TCGv {self.reg_tcg()} =3D get_result_gpr(ctx, insn->regno[{reg= no}]); """)) + def analyze_read(self, f, regno): + self.decl_reg_num(f, regno) + f.write(code_fmt(f"""\ + ctx_log_reg_read(ctx, {self.reg_num}); + """)) =20 class GprReadWrite(Register, Single, ReadWrite): def decl_tcg(self, f, tag, regno): @@ -506,6 +522,12 @@ def log_write(self, f, tag): f.write(code_fmt(f"""\ gen_log_reg_write(ctx, {self.reg_num}, {self.reg_tcg()}); """)) + def analyze_write(self, f, tag, regno): + self.decl_reg_num(f, regno) + predicated =3D "true" if is_predicated(tag) else "false" + f.write(code_fmt(f"""\ + ctx_log_reg_write(ctx, {self.reg_num}, {predicated}); + """)) =20 class ControlDest(Register, Single, Dest): def decl_reg_num(self, f, regno): @@ -521,6 +543,12 @@ def log_write(self, f, tag): f.write(code_fmt(f"""\ gen_write_ctrl_reg(ctx, {self.reg_num}, {self.reg_tcg()}); """)) + def analyze_write(self, f, tag, regno): + self.decl_reg_num(f, regno) + predicated =3D "true" if is_predicated(tag) else "false" + f.write(code_fmt(f"""\ + ctx_log_reg_write(ctx, {self.reg_num}, {predicated}); + """)) =20 class ControlSource(Register, Single, OldSource): def decl_reg_num(self, f, regno): @@ -533,6 +561,11 @@ def decl_tcg(self, f, tag, regno): TCGv {self.reg_tcg()} =3D tcg_temp_new(); gen_read_ctrl_reg(ctx, {self.reg_num}, {self.reg_tcg()}); """)) + def analyze_read(self, f, regno): + self.decl_reg_num(f, regno) + f.write(code_fmt(f"""\ + ctx_log_reg_read(ctx, {self.reg_num}); + """)) =20 class ModifierSource(Register, Single, OldSource): def decl_reg_num(self, f, regno): @@ -549,6 +582,11 @@ def decl_tcg(self, f, tag, regno): def idef_arg(self, declared): declared.append(self.reg_tcg()) declared.append("CS") + def analyze_read(self, f, regno): + self.decl_reg_num(f, regno) + f.write(code_fmt(f"""\ + ctx_log_reg_read(ctx, {self.reg_num}); + """)) =20 class PredDest(Register, Single, Dest): def decl_tcg(self, f, tag, regno): @@ -560,6 +598,11 @@ def log_write(self, f, tag): f.write(code_fmt(f"""\ gen_log_pred_write(ctx, {self.reg_num}, {self.reg_tcg()}); """)) + def analyze_write(self, f, tag, regno): + self.decl_reg_num(f, regno) + f.write(code_fmt(f"""\ + ctx_log_pred_write(ctx, {self.reg_num}); + """)) =20 class PredSource(Register, Single, OldSource): def decl_tcg(self, f, tag, regno): @@ -567,12 +610,22 @@ def decl_tcg(self, f, tag, regno): f.write(code_fmt(f"""\ TCGv {self.reg_tcg()} =3D hex_pred[{self.reg_num}]; """)) + def analyze_read(self, f, regno): + self.decl_reg_num(f, regno) + f.write(code_fmt(f"""\ + ctx_log_pred_read(ctx, {self.reg_num}); + """)) =20 class PredNewSource(Register, Single, NewSource): def decl_tcg(self, f, tag, regno): f.write(code_fmt(f"""\ TCGv {self.reg_tcg()} =3D get_result_pred(ctx, insn->regno[{re= gno}]); """)) + def analyze_read(self, f, regno): + self.decl_reg_num(f, regno) + f.write(code_fmt(f"""\ + ctx_log_pred_read(ctx, {self.reg_num}); + """)) =20 class PredReadWrite(Register, Single, ReadWrite): def decl_tcg(self, f, tag, regno): @@ -585,6 +638,11 @@ def log_write(self, f, tag): f.write(code_fmt(f"""\ gen_log_pred_write(ctx, {self.reg_num}, {self.reg_tcg()}); """)) + def analyze_write(self, f, tag, regno): + self.decl_reg_num(f, regno) + f.write(code_fmt(f"""\ + ctx_log_pred_write(ctx, {self.reg_num}); + """)) =20 class PairDest(Register, Pair, Dest): def decl_tcg(self, f, tag, regno): @@ -597,6 +655,12 @@ def log_write(self, f, tag): f.write(code_fmt(f"""\ gen_log_reg_write_pair(ctx, {self.reg_num}, {self.reg_tcg()}); """)) + def analyze_write(self, f, tag, regno): + self.decl_reg_num(f, regno) + predicated =3D "true" if is_predicated(tag) else "false" + f.write(code_fmt(f"""\ + ctx_log_reg_write_pair(ctx, {self.reg_num}, {predicated}); + """)) =20 class PairSource(Register, Pair, OldSource): def decl_tcg(self, f, tag, regno): @@ -607,6 +671,11 @@ def decl_tcg(self, f, tag, regno): hex_gpr[{self.reg_num}], hex_gpr[{self.reg_num} + 1]); """)) + def analyze_read(self, f, regno): + self.decl_reg_num(f, regno) + f.write(code_fmt(f"""\ + ctx_log_reg_read_pair(ctx, {self.reg_num}); + """)) =20 class PairReadWrite(Register, Pair, ReadWrite): def decl_tcg(self, f, tag, regno): @@ -622,6 +691,12 @@ def log_write(self, f, tag): f.write(code_fmt(f"""\ gen_log_reg_write_pair(ctx, {self.reg_num}, {self.reg_tcg()}); """)) + def analyze_write(self, f, tag, regno): + self.decl_reg_num(f, regno) + predicated =3D "true" if is_predicated(tag) else "false" + f.write(code_fmt(f"""\ + ctx_log_reg_write_pair(ctx, {self.reg_num}, {predicated}); + """)) =20 class ControlPairDest(Register, Pair, Dest): def decl_reg_num(self, f, regno): @@ -638,6 +713,12 @@ def log_write(self, f, tag): f.write(code_fmt(f"""\ gen_write_ctrl_reg_pair(ctx, {self.reg_num}, {self.reg_tcg()}); """)) + def analyze_write(self, f, tag, regno): + self.decl_reg_num(f, regno) + predicated =3D "true" if is_predicated(tag) else "false" + f.write(code_fmt(f"""\ + ctx_log_reg_write_pair(ctx, {self.reg_num}, {predicated}); + """)) =20 class ControlPairSource(Register, Pair, OldSource): def decl_reg_num(self, f, regno): @@ -650,6 +731,11 @@ def decl_tcg(self, f, tag, regno): TCGv_i64 {self.reg_tcg()} =3D tcg_temp_new_i64(); gen_read_ctrl_reg_pair(ctx, {self.reg_num}, {self.reg_tcg()}); """)) + def analyze_read(self, f, regno): + self.decl_reg_num(f, regno) + f.write(code_fmt(f"""\ + ctx_log_reg_read_pair(ctx, {self.reg_num}); + """)) =20 class VRegDest(Register, Hvx, Dest): def decl_tcg(self, f, tag, regno): @@ -669,6 +755,13 @@ def helper_hvx_desc(self, f): f.write(code_fmt(f"""\ /* {self.reg_tcg()} is *(MMVector *)({self.helper_arg()}) */ """)) + def analyze_write(self, f, tag, regno): + self.decl_reg_num(f, regno) + newv =3D hvx_newv(tag) + predicated =3D "true" if is_predicated(tag) else "false" + f.write(code_fmt(f"""\ + ctx_log_vreg_write(ctx, {self.reg_num}, {newv}, {predicated}); + """)) =20 class VRegSource(Register, Hvx, OldSource): def decl_tcg(self, f, tag, regno): @@ -685,6 +778,11 @@ def helper_hvx_desc(self, f): f.write(code_fmt(f"""\ /* {self.reg_tcg()} is *(MMVector *)({self.helper_arg()}) */ """)) + def analyze_read(self, f, regno): + self.decl_reg_num(f, regno) + f.write(code_fmt(f"""\ + ctx_log_vreg_read(ctx, {self.reg_num}); + """)) =20 class VRegNewSource(Register, Hvx, NewSource): def decl_tcg(self, f, tag, regno): @@ -698,6 +796,11 @@ def helper_hvx_desc(self, f): f.write(code_fmt(f"""\ /* {self.reg_tcg()} is *(MMVector *)({self.helper_arg()}) */ """)) + def analyze_read(self, f, regno): + self.decl_reg_num(f, regno) + f.write(code_fmt(f"""\ + ctx_log_vreg_read(ctx, {self.reg_num}); + """)) =20 class VRegReadWrite(Register, Hvx, ReadWrite): def decl_tcg(self, f, tag, regno): @@ -720,6 +823,13 @@ def helper_hvx_desc(self, f): f.write(code_fmt(f"""\ /* {self.reg_tcg()} is *(MMVector *)({self.helper_arg()}) */ """)) + def analyze_write(self, f, tag, regno): + self.decl_reg_num(f, regno) + newv =3D hvx_newv(tag) + predicated =3D "true" if is_predicated(tag) else "false" + f.write(code_fmt(f"""\ + ctx_log_vreg_write(ctx, {self.reg_num}, {newv}, {predicated}); + """)) =20 class VRegTmp(Register, Hvx, ReadWrite): def decl_tcg(self, f, tag, regno): @@ -744,6 +854,13 @@ def helper_hvx_desc(self, f): f.write(code_fmt(f"""\ /* {self.reg_tcg()} is *(MMVector *)({self.helper_arg()}) */ """)) + def analyze_write(self, f, tag, regno): + self.decl_reg_num(f, regno) + newv =3D hvx_newv(tag) + predicated =3D "true" if is_predicated(tag) else "false" + f.write(code_fmt(f"""\ + ctx_log_vreg_write(ctx, {self.reg_num}, {newv}, {predicated}); + """)) =20 class VRegPairDest(Register, Hvx, Dest): def decl_tcg(self, f, tag, regno): @@ -763,6 +880,13 @@ def helper_hvx_desc(self, f): f.write(code_fmt(f"""\ /* {self.reg_tcg()} is *(MMVectorPair *)({self.helper_arg()}) = */ """)) + def analyze_write(self, f, tag, regno): + self.decl_reg_num(f, regno) + newv =3D hvx_newv(tag) + predicated =3D "true" if is_predicated(tag) else "false" + f.write(code_fmt(f"""\ + ctx_log_vreg_write_pair(ctx, {self.reg_num}, {newv}, {predicat= ed}); + """)) =20 class VRegPairSource(Register, Hvx, OldSource): def decl_tcg(self, f, tag, regno): @@ -786,6 +910,11 @@ def helper_hvx_desc(self, f): f.write(code_fmt(f"""\ /* {self.reg_tcg()} is *(MMVectorPair *)({self.helper_arg()}) = */ """)) + def analyze_read(self, f, regno): + self.decl_reg_num(f, regno) + f.write(code_fmt(f"""\ + ctx_log_vreg_read_pair(ctx, {self.reg_num}); + """)) =20 class VRegPairReadWrite(Register, Hvx, ReadWrite): def decl_tcg(self, f, tag, regno): @@ -814,6 +943,13 @@ def helper_hvx_desc(self, f): f.write(code_fmt(f"""\ /* {self.reg_tcg()} is *(MMVectorPair *)({self.helper_arg()}) = */ """)) + def analyze_write(self, f, tag, regno): + self.decl_reg_num(f, regno) + newv =3D hvx_newv(tag) + predicated =3D "true" if is_predicated(tag) else "false" + f.write(code_fmt(f"""\ + ctx_log_vreg_write_pair(ctx, {self.reg_num}, {newv}, {predicat= ed}); + """)) =20 class QRegDest(Register, Hvx, Dest): def decl_tcg(self, f, tag, regno): @@ -833,6 +969,11 @@ def helper_hvx_desc(self, f): f.write(code_fmt(f"""\ /* {self.reg_tcg()} is *(MMQReg *)({self.helper_arg()}) */ """)) + def analyze_write(self, f, tag, regno): + self.decl_reg_num(f, regno) + f.write(code_fmt(f"""\ + ctx_log_qreg_write(ctx, {self.reg_num}); + """)) =20 class QRegSource(Register, Hvx, OldSource): def decl_tcg(self, f, tag, regno): @@ -850,6 +991,11 @@ def helper_hvx_desc(self, f): f.write(code_fmt(f"""\ /* {self.reg_tcg()} is *(MMQReg *)({self.helper_arg()}) */ """)) + def analyze_read(self, f, regno): + self.decl_reg_num(f, regno) + f.write(code_fmt(f"""\ + ctx_log_qreg_read(ctx, {self.reg_num}); + """)) =20 class QRegReadWrite(Register, Hvx, ReadWrite): def decl_tcg(self, f, tag, regno): @@ -872,6 +1018,11 @@ def helper_hvx_desc(self, f): f.write(code_fmt(f"""\ /* {self.reg_tcg()} is *(MMQReg *)({self.helper_arg()}) */ """)) + def analyze_write(self, f, tag, regno): + self.decl_reg_num(f, regno) + f.write(code_fmt(f"""\ + ctx_log_qreg_write(ctx, {self.reg_num}); + """)) =20 def init_registers(): regs =3D { --=20 2.34.1