From nobody Mon May 20 16:52:34 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=1709781900; cv=none; d=zohomail.com; s=zohoarc; b=he0lZ9AmC/kfMRLH108k4pLHZlBUbzpQMh7H6M9RRUSD7o43rzj7lKxRm9Mxb5a+syXC1NqISlPAQ9AccteSKLkdocVJ3BL/r8nRsjmlShl1x4trGoRzYNArUB2fU6VflgYIIh0b4HaCBEEVIrSBIlGa3hlSLDBLMXYmtDMNPVY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709781900; 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=v3teDd8HDxktJH46jy4fSC2tTIGKstCq77/p/rg3zPo=; b=I5QinGpjGaEMRSxrvBCSVSxnAVeha5DXwkQh0rb1ME9NKx1Kq1M2YxjXvFk0r5exg3KG24efmMxBWFdpDHBvJNN7U+c6g0zKvlAxKtxmr3ZSIb9jDffz7hCPozSTVcfp01JCkwzDnTqmH9A/VAkg9MDWVR2PUFcK/O+C83tV+XY= 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 1709781900462723.8825165827761; Wed, 6 Mar 2024 19:25:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ri4M5-0001Rl-As; Wed, 06 Mar 2024 22:23:37 -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 1ri4M3-0001R1-Ck for qemu-devel@nongnu.org; Wed, 06 Mar 2024 22:23:35 -0500 Received: from mail-il1-x12b.google.com ([2607:f8b0:4864:20::12b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ri4M1-0005fP-I9 for qemu-devel@nongnu.org; Wed, 06 Mar 2024 22:23:35 -0500 Received: by mail-il1-x12b.google.com with SMTP id e9e14a558f8ab-365aff1fa8dso895825ab.2 for ; Wed, 06 Mar 2024 19:23:33 -0800 (PST) Received: from taylor-ubuntu.hsd1.co.comcast.net (c-73-169-12-54.hsd1.co.comcast.net. [73.169.12.54]) by smtp.gmail.com with ESMTPSA id h20-20020a02c734000000b00474e9a77424sm2233990jao.147.2024.03.06.19.23.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 19:23:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709781811; x=1710386611; 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=v3teDd8HDxktJH46jy4fSC2tTIGKstCq77/p/rg3zPo=; b=UE9/Be2Cw0BGRFW4Eozngb/VeaFDGKiOjoT4Tgw4vMx+QDGESHgLS1rVL8xbdR5BQ3 wLRnW3d8lYh2IG75h6Z+lvjOHAvEzETXesd8ngSHReIUz4C7B/KQrIYkTlKwcZi5BlQd iKHisCHnae1B96f5mZ/lJuQD7QgXMECPcVILsCsEYPx9oVkjsM96g+QlA/yiYg0S8djb rQhjYek5cjrKTNCBPmmTnIjNsXKcKc9THLxmfrgxXhm0rW0qhVYiSmNaysKd3Ze/+Q6x WkS3cFxHv8BxiMpZpE6XoZjyf907r899HAkZGtrHZ1eQ5niike4WgjwOIm+THWotUx84 J/vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709781811; x=1710386611; 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=v3teDd8HDxktJH46jy4fSC2tTIGKstCq77/p/rg3zPo=; b=wkquRnr8g0TcQnwa1YJVEPN75FGUlcZ2pG6NpP2sHMC/txA+yYuvIv4bD9SNcsyQKi nJgVnqZdmnrwC7GCuZyG0OmWhMFBfzPTzcq5M2QqmdwvXXPXDRr+VATLSErMSW52WBQE CmThvkcDw+uYlE1VI5CwQmpwNtsQ0gJsq5/qMgNyIS4suFrlR2g3kDavRv1t+s12a/ji G/HMe55E3HtvgO3CHvvRABqITbE/cbE7w2QCkPyETcGjJAL9HKbH6ed88GA9Bn+VGSNh JQ2Zxj5+YmDO3AHczpvoqQOKA3l6fGJp9hZT0D6LgnhBfVO1e/ZdBO+G7mpOjThGpCBH FtZg== X-Gm-Message-State: AOJu0YzTU+gzI+ogbokEGJMxWQqJgmuWxpJXW5w/x0l74yu2RcRbb+fF JNANGKFBUokT177hVSQNpC3DeOnSjABhqCYIfomaosnSZVd4naSquZXk6J+SVYc= X-Google-Smtp-Source: AGHT+IHoEbcP+7wbWfLsHOZrllvtBPoQOAcEdIyYiIoOuuSu+B6VuzYN51GfKWoC4ASfv8HWnSAvaA== X-Received: by 2002:a05:6e02:148d:b0:365:1dd9:ee6b with SMTP id n13-20020a056e02148d00b003651dd9ee6bmr25409244ilk.25.1709781811024; Wed, 06 Mar 2024 19:23:31 -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 v2 1/9] Hexagon (target/hexagon) Add is_old/is_new to Register class Date: Wed, 6 Mar 2024 20:23:19 -0700 Message-Id: <20240307032327.4799-2-ltaylorsimpson@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240307032327.4799-1-ltaylorsimpson@gmail.com> References: <20240307032327.4799-1-ltaylorsimpson@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::12b; envelope-from=ltaylorsimpson@gmail.com; helo=mail-il1-x12b.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: 1709781902165100007 Signed-off-by: Taylor Simpson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Brian Cain --- target/hexagon/hex_common.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/target/hexagon/hex_common.py b/target/hexagon/hex_common.py index 195620c7ec..4bacef223f 100755 --- a/target/hexagon/hex_common.py +++ b/target/hexagon/hex_common.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 =20 ## -## Copyright(c) 2019-2023 Qualcomm Innovation Center, Inc. All Rights Res= erved. +## Copyright(c) 2019-2024 Qualcomm Innovation Center, Inc. All Rights Res= erved. ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -397,10 +397,18 @@ def is_readwrite(self): class OldSource(Source): def reg_tcg(self): return f"{self.regtype}{self.regid}V" + def is_old(self): + return True + def is_new(self): + return False =20 class NewSource(Source): def reg_tcg(self): return f"{self.regtype}{self.regid}N" + def is_old(self): + return False + def is_new(self): + return True =20 class ReadWrite: def reg_tcg(self): @@ -413,6 +421,10 @@ def is_read(self): return True def is_readwrite(self): return True + def is_old(self): + return True + def is_new(self): + return False =20 class GprDest(Register, Single, Dest): def decl_tcg(self, f, tag, regno): --=20 2.34.1 From nobody Mon May 20 16:52:34 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=1709781884; cv=none; d=zohomail.com; s=zohoarc; b=GsXYvxKm0r+VmDqvdp0xPNGCnawFHBy0jgpSULrFL7zYt04zNepHNsPq3ek+wBDAWnQ+cD/FGgKuQy1YaqsleVlEKh6UyKZwFOz45YrusX1jcgu8slUig1aqqfjDCq+bq4okldoCDm7k0FcIwTuxuIwGz6tCUUY7TarVKcCht8A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709781884; 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=rnskkX/gjRWt+FxpnLgMIRqQFGfGcaZlOIoSY38nl70=; b=h/s+IR5bFKTnaAlPu201RKdgGqSQaiit8/MdmmyN9C0O+xXTcDsInZKWGr9UgzsWiU17Xg335qhnsmgurFNptdMQxz7nTmFkRMJEWjrQdv+VIoXZPJpxlveWrJGFDXXZ4ud1Iq/WrBqCsXDUyQf5OjGGQT4lrNITdRmU70dxlOM= 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 1709781884296584.4573141230593; Wed, 6 Mar 2024 19:24:44 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ri4M6-0001S1-FN; Wed, 06 Mar 2024 22:23:38 -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 1ri4M4-0001RP-Ri for qemu-devel@nongnu.org; Wed, 06 Mar 2024 22:23:36 -0500 Received: from mail-io1-xd31.google.com ([2607:f8b0:4864:20::d31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ri4M3-0005h9-2O for qemu-devel@nongnu.org; Wed, 06 Mar 2024 22:23:36 -0500 Received: by mail-io1-xd31.google.com with SMTP id ca18e2360f4ac-7c8060a8489so22511339f.0 for ; Wed, 06 Mar 2024 19:23:34 -0800 (PST) Received: from taylor-ubuntu.hsd1.co.comcast.net (c-73-169-12-54.hsd1.co.comcast.net. [73.169.12.54]) by smtp.gmail.com with ESMTPSA id h20-20020a02c734000000b00474e9a77424sm2233990jao.147.2024.03.06.19.23.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 19:23:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709781812; x=1710386612; 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=rnskkX/gjRWt+FxpnLgMIRqQFGfGcaZlOIoSY38nl70=; b=WwM0Fu+oapuHo2qms3e75RKLxShHpbyLCdQOzyY0kCIAr2uEh5fsQVUZQHIS/VCkEW 9Hu4Kt8YTCkdJRBnsefPCVJvKFGwqp9XrnS+Gt4prAaeOyQ3awTUnWiAz8SCUoAcaX4J exvvmWyKlrbX3Nxlmesl3aTvEQJVyIM6tqrx3K6qWI/tmUCflCnC1aPtrq20R9gH4m9k 1b+ZSHj96bQcnoGz2jZ282zWmz9sn1Yi/x6SQa11bCUwnGorqVdTL1CR/jUF++/DD6Km CwW7yRc/1WMaZCGaclh24N4impRpoZN7AF+ehiZFgUj6OZBEyLgxvakCfK9y9e0VX4Ji edUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709781812; x=1710386612; 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=rnskkX/gjRWt+FxpnLgMIRqQFGfGcaZlOIoSY38nl70=; b=DoVBAXWbOHInQS1+2YumFkeg+l2jBchlK4IYKh2WT+tlEA2u/KYiTIJSh84mTbr8bU VhhmtFMJxtT+jCSKvj6hMGcK0Jol69nE4v98PjwA7ruE8R1APy2YPgbyvPE+FE2xAlnb 7CEf7UfOqs1Ngsn46GXBSzzOpL0nr72deqN/S7n0WOYtOOJpfikpDWPEMUunv6QH6WXf aZtXcEQc1UkqedHk6nZNayH0mhmezvj7kFB8hwd8ORbgPUB58+j2RxfIISy8FR5M0dxb /vTZikNG0wcFTWFsKhrJafEOhXA0oxYdw2DkEAFYNYHuui+uKnkOxkftHR5AO6g+T9W5 YO/A== X-Gm-Message-State: AOJu0Yzk/kM6Dzn1tb3nXmJJwG40JKP/oIp9ynyY4Eo7bO37AIALvsHg K9NCr87Chxl0MLv0dFKUibjX8dfRisFBJC+DZQiK9S+2//26uaRFhF6qsPpg6MU= X-Google-Smtp-Source: AGHT+IF9I8+ld7Zj0CVkD+SdHCXFrx+PQ58nNxKYLdkEKoXCKzbwa9+rou/M+/JP5GOIpPfZ+U53Ww== X-Received: by 2002:a05:6602:29b1:b0:7c8:5c0a:5e88 with SMTP id u17-20020a05660229b100b007c85c0a5e88mr10016887ios.9.1709781812459; Wed, 06 Mar 2024 19:23:32 -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 v2 2/9] Hexagon (target/hexagon) Mark new_read_idx in trans functions Date: Wed, 6 Mar 2024 20:23:20 -0700 Message-Id: <20240307032327.4799-3-ltaylorsimpson@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240307032327.4799-1-ltaylorsimpson@gmail.com> References: <20240307032327.4799-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::d31; envelope-from=ltaylorsimpson@gmail.com; helo=mail-io1-xd31.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: 1709781886131100007 Check that the value matches opcode_reginfo Signed-off-by: Taylor Simpson Reviewed-by: Brian Cain --- target/hexagon/insn.h | 3 ++- target/hexagon/decode.c | 2 ++ target/hexagon/mmvec/decode_ext_mmvec.c | 2 ++ target/hexagon/gen_trans_funcs.py | 15 ++++++++++----- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/target/hexagon/insn.h b/target/hexagon/insn.h index 3e7a22c91e..36502bf056 100644 --- a/target/hexagon/insn.h +++ b/target/hexagon/insn.h @@ -1,5 +1,5 @@ /* - * Copyright(c) 2019-2022 Qualcomm Innovation Center, Inc. All Rights Res= erved. + * Copyright(c) 2019-2024 Qualcomm Innovation Center, Inc. All Rights Res= erved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -39,6 +39,7 @@ struct Instruction { uint32_t slot:3; uint32_t which_extended:1; /* If has an extender, which immediate */ uint32_t new_value_producer_slot:4; + int32_t new_read_idx; =20 bool part1; /* * cmp-jumps are split into two insns. diff --git a/target/hexagon/decode.c b/target/hexagon/decode.c index a40210ca1e..4595e30384 100644 --- a/target/hexagon/decode.c +++ b/target/hexagon/decode.c @@ -131,6 +131,8 @@ decode_fill_newvalue_regno(Packet *packet) 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); =20 /* * What's encoded at the N-field is the offset to who's produc= ing diff --git a/target/hexagon/mmvec/decode_ext_mmvec.c b/target/hexagon/mmvec= /decode_ext_mmvec.c index 202d84c7c0..e9007f5d71 100644 --- a/target/hexagon/mmvec/decode_ext_mmvec.c +++ b/target/hexagon/mmvec/decode_ext_mmvec.c @@ -41,6 +41,8 @@ check_new_value(Packet *pkt) 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); /* * What's encoded at the N-field is the offset to who's produc= ing * the value. diff --git a/target/hexagon/gen_trans_funcs.py b/target/hexagon/gen_trans_f= uncs.py index 53e844a44b..8acecdb993 100755 --- a/target/hexagon/gen_trans_funcs.py +++ b/target/hexagon/gen_trans_funcs.py @@ -68,6 +68,7 @@ def mark_which_imm_extended(f, tag): ## insn->regno[0] =3D args->Rd; ## insn->regno[1] =3D args->Rs; ## insn->regno[2] =3D args->Rt; +## insn->new_read_idx =3D -1; ## return true; ## } ## @@ -84,14 +85,14 @@ def gen_trans_funcs(f): insn->opcode =3D {tag}; """)) =20 - regno =3D 0 - for reg in regs: - reg_type =3D reg[0] - reg_id =3D reg[1] + new_read_idx =3D -1 + for regno, (reg_type, reg_id, *_) in enumerate(regs): + reg =3D hex_common.get_register(tag, reg_type, reg_id) f.write(code_fmt(f"""\ insn->regno[{regno}] =3D args->{reg_type}{reg_id}; """)) - regno +=3D 1 + if reg.is_read() and reg.is_new(): + new_read_idx =3D regno =20 if len(imms) !=3D 0: mark_which_imm_extended(f, tag) @@ -112,6 +113,9 @@ def gen_trans_funcs(f): insn->immed[{immno}] =3D args->{imm_type}{imm_letter}; """)) =20 + f.write(code_fmt(f"""\ + insn->new_read_idx =3D {new_read_idx}; + """)) f.write(textwrap.dedent(f"""\ return true; {close_curly} @@ -120,5 +124,6 @@ def gen_trans_funcs(f): =20 if __name__ =3D=3D "__main__": hex_common.read_semantics_file(sys.argv[1]) + hex_common.init_registers() with open(sys.argv[2], "w") as f: gen_trans_funcs(f) --=20 2.34.1 From nobody Mon May 20 16:52:34 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=1709781916; cv=none; d=zohomail.com; s=zohoarc; b=DjcoGh77jXj1y8ztFBuHYFO931xCdJEK+Ilv7EmRv1+/yOo4msF/7Y2iKuLyiiLJOP+C/p8bD4sOWcuAHt7/ixy3BmBCcYa8IBox9YBy6/UftAyYP30290JaiAFiSJ6UotDQgEcJtEcCSRHcQKigSryt29Lxff0Ovqke727xrrs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709781916; 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=uuAflH+os+yu0r/DJ/rQ7cJGHjxjAdD2yR1xW/PppVE=; b=m8OYWvx+tG6diIWSW3EjC0wDxvusidXltOc0MMQ0//JKZWPWq0Y8XqpVcMdh7k1V//BI8HwLbQnZZx025vBRPlLjz+MKcphGWXy9iBX3KAJ4uekXxxG8iypW6815i790wvruzE/5kPZMt0D21CD0/ECYgRtZEAPKTGgBOWuCCaI= 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 1709781916285824.2565378870459; Wed, 6 Mar 2024 19:25:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ri4M6-0001SR-US; Wed, 06 Mar 2024 22:23:38 -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 1ri4M5-0001Rm-DT for qemu-devel@nongnu.org; Wed, 06 Mar 2024 22:23:37 -0500 Received: from mail-io1-xd31.google.com ([2607:f8b0:4864:20::d31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ri4M3-0005hL-QX for qemu-devel@nongnu.org; Wed, 06 Mar 2024 22:23:37 -0500 Received: by mail-io1-xd31.google.com with SMTP id ca18e2360f4ac-7c8406e4745so19124339f.3 for ; Wed, 06 Mar 2024 19:23:35 -0800 (PST) Received: from taylor-ubuntu.hsd1.co.comcast.net (c-73-169-12-54.hsd1.co.comcast.net. [73.169.12.54]) by smtp.gmail.com with ESMTPSA id h20-20020a02c734000000b00474e9a77424sm2233990jao.147.2024.03.06.19.23.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 19:23:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709781814; x=1710386614; 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=uuAflH+os+yu0r/DJ/rQ7cJGHjxjAdD2yR1xW/PppVE=; b=GeIEYNPEtZ3TPW8ZH7eLTEIuzDSEmVT2YiECjzLR7AIqE85dEKy+z86GbfWFhXP+cG Z4oLNr5Zzx3SvIQCcjfXGP0AMBcRdq1+qWEVrAeL5seiC63WV+6l57wy8NWYRpLgOWBa nwXZ9DEB6HlG/mCqYIKoRcNn2ArBL81ssVJewLRXKgRoCR5J0MKl6KqG9xIumxZNg8Ct i4AgbS5Cztd+wyGm0x72KshX2S4EIAzj05RKw9aBFCt94VfKQvX36vNRihFykwPFJbc5 hCvoaNm8U+Raz0lJzZ4noq3JQ5pnYOVEgdxOuiZV/TFAjp5xO9uESgGXXwskZqlZ4uf+ hD2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709781814; x=1710386614; 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=uuAflH+os+yu0r/DJ/rQ7cJGHjxjAdD2yR1xW/PppVE=; b=kNYpcuqhhUvAx2hDs39Hu80O4NzTBLjSt9StIMU6SKX5Ugtmw6ayoH/l6+rnOUYvHe UNoCKTrjsTCPwudLHxNw2mehTIJcLqExTr1/gU7u+i/71bgxF0KSU5+O7O6p1Bz3NhgG V6wfAleA39AGTVvrr43quhNH2sPvzrq6wABqgmInGk7CL2K56ls53eyGpPAGOOvofaXJ 1qAH9BGxnr7iDuiXmHaWHnEB8viN3qZ4oL+HUwNoy/XOkDPPIUvIR6dPZd7gQJbsYqbF /bIQEiTDevLIiYDVVyhml1BwM9UVqmMMY91Sbb/NgjBUUjl6OVCDRFMYw2FjG31Ii0MO EpTg== X-Gm-Message-State: AOJu0Yy42o8phCabHSpN0ClmodCwJ64ZImhlz2w55/3TFowMjdcXxY4g /wiH4CxSxPLLGorMUj5WBKqZ3q1Ah+mc0BI7OOOnonC6/3ZF8zAdPNmaETPt8yM= X-Google-Smtp-Source: AGHT+IGbspPuomrW2XwnZZm1g8AoGBUSSlCeJ7/Vrxmu/ZV+VkudxmUEgDCmLntFz7SJ57Dr6UwTGw== X-Received: by 2002:a5d:9519:0:b0:7c8:5972:6e0e with SMTP id d25-20020a5d9519000000b007c859726e0emr10175058iom.15.1709781813866; Wed, 06 Mar 2024 19:23:33 -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 v2 3/9] Hexagon (target/hexagon) Mark dest_idx in trans functions Date: Wed, 6 Mar 2024 20:23:21 -0700 Message-Id: <20240307032327.4799-4-ltaylorsimpson@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240307032327.4799-1-ltaylorsimpson@gmail.com> References: <20240307032327.4799-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::d31; envelope-from=ltaylorsimpson@gmail.com; helo=mail-io1-xd31.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: 1709781918199100003 Check that the value matches opcode_reginfo/opcode_wregs Signed-off-by: Taylor Simpson Reviewed-by: Brian Cain --- target/hexagon/insn.h | 1 + target/hexagon/decode.c | 2 ++ target/hexagon/mmvec/decode_ext_mmvec.c | 2 ++ target/hexagon/gen_trans_funcs.py | 6 ++++++ 4 files changed, 11 insertions(+) diff --git a/target/hexagon/insn.h b/target/hexagon/insn.h index 36502bf056..a770379958 100644 --- a/target/hexagon/insn.h +++ b/target/hexagon/insn.h @@ -40,6 +40,7 @@ struct Instruction { uint32_t which_extended:1; /* If has an extender, which immediate */ uint32_t new_value_producer_slot:4; int32_t new_read_idx; + int32_t dest_idx; =20 bool part1; /* * cmp-jumps are split into two insns. diff --git a/target/hexagon/decode.c b/target/hexagon/decode.c index 4595e30384..a4d8500fea 100644 --- a/target/hexagon/decode.c +++ b/target/hexagon/decode.c @@ -184,6 +184,8 @@ decode_fill_newvalue_regno(Packet *packet) =20 /* 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); packet->insn[i].regno[use_regidx] =3D packet->insn[def_idx].regno[dst_idx]; /* diff --git a/target/hexagon/mmvec/decode_ext_mmvec.c b/target/hexagon/mmvec= /decode_ext_mmvec.c index e9007f5d71..c1320406df 100644 --- a/target/hexagon/mmvec/decode_ext_mmvec.c +++ b/target/hexagon/mmvec/decode_ext_mmvec.c @@ -86,6 +86,8 @@ check_new_value(Packet *pkt) /* 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]; /* Now patch up the consumer with the register number */ pkt->insn[i].regno[use_regidx] =3D def_regnum ^ def_oreg; diff --git a/target/hexagon/gen_trans_funcs.py b/target/hexagon/gen_trans_f= uncs.py index 8acecdb993..1201172dda 100755 --- a/target/hexagon/gen_trans_funcs.py +++ b/target/hexagon/gen_trans_funcs.py @@ -69,6 +69,7 @@ def mark_which_imm_extended(f, tag): ## insn->regno[1] =3D args->Rs; ## insn->regno[2] =3D args->Rt; ## insn->new_read_idx =3D -1; +## insn->dest_idx =3D 0; ## return true; ## } ## @@ -86,6 +87,7 @@ def gen_trans_funcs(f): """)) =20 new_read_idx =3D -1 + dest_idx =3D -1 for regno, (reg_type, reg_id, *_) in enumerate(regs): reg =3D hex_common.get_register(tag, reg_type, reg_id) f.write(code_fmt(f"""\ @@ -93,6 +95,9 @@ def gen_trans_funcs(f): """)) if reg.is_read() and reg.is_new(): new_read_idx =3D regno + # dest_idx should be the first destination, so check for -1 + if reg.is_written() and dest_idx =3D=3D -1: + dest_idx =3D regno =20 if len(imms) !=3D 0: mark_which_imm_extended(f, tag) @@ -115,6 +120,7 @@ def gen_trans_funcs(f): =20 f.write(code_fmt(f"""\ insn->new_read_idx =3D {new_read_idx}; + insn->dest_idx =3D {dest_idx}; """)) f.write(textwrap.dedent(f"""\ return true; --=20 2.34.1 From nobody Mon May 20 16:52:34 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=1709781926; cv=none; d=zohomail.com; s=zohoarc; b=US5uGx/uXvZcRCYD8fQMoCAvhPRd/Pm4wgCb4FUZ+tIuweV6Y/6geiwIuzL+AGKfyKQEHt5zqfBkWL5I49+7otOjr+cpuiG2tUcDm5E+3Mb2xgMxB7JqyrJFMbC2yNnRaNNl10uzWfG9wW6+q60qe2ZhInZsEUR7NkUv1uXJ7nE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709781926; 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=2qK5soASicTv0ySk9Xejx0X64X5wdWSDVESyTR2YQY0=; b=WAEqRWTwqGmDNdSPleBdu6FoAY/ljOPRnl1L6pcdPKTNyeN//Z42medXUKzlq03xDUgU2seZJ7fSXATRbIA97nRs01gBM9Ye0LA+WwkP+P0pAeADI9hIUCT8XZx8Dvd8amSwKm2Zht+PkLc3eoSYiA525ZavoAnkFdRrk1yaPLs= 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 1709781926494132.30401875935445; Wed, 6 Mar 2024 19:25:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ri4M7-0001Sf-Hr; Wed, 06 Mar 2024 22:23:39 -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 1ri4M6-0001S4-Cr for qemu-devel@nongnu.org; Wed, 06 Mar 2024 22:23:38 -0500 Received: from mail-io1-xd36.google.com ([2607:f8b0:4864:20::d36]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ri4M4-0005hX-PP for qemu-devel@nongnu.org; Wed, 06 Mar 2024 22:23:38 -0500 Received: by mail-io1-xd36.google.com with SMTP id ca18e2360f4ac-7c8713acecfso18328139f.0 for ; Wed, 06 Mar 2024 19:23:36 -0800 (PST) Received: from taylor-ubuntu.hsd1.co.comcast.net (c-73-169-12-54.hsd1.co.comcast.net. [73.169.12.54]) by smtp.gmail.com with ESMTPSA id h20-20020a02c734000000b00474e9a77424sm2233990jao.147.2024.03.06.19.23.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 19:23:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709781815; x=1710386615; 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=2qK5soASicTv0ySk9Xejx0X64X5wdWSDVESyTR2YQY0=; b=ilAX8v1riW22Vh0JiK/9h2vhEBpcox+jGtz8so+DOnmRKslzLrMwjbTXmnaV4OwWzx PWD7vNxh0F28fU94v/xpqp/B4Xo27ky4wywPm3TLJzUFd3wVXzOB5dKFFYVQLGBAoYUn rA/foiEKxXtsoNpVBQZEIterxfZJh/H7TFIK2CgZRsbLUwntTt6U52fz+IhYnK8BFQ4B CXd9vECO2Q/QVr85emb552oMWIXtPYuXUam1QGecdrEQFeykyPysCYwJlvNbxhSm6qyP tsMVTRPjjNyYcGgMVIGLtNmkOibtDPCV951lcTpckkeDAMdLYBGWisriU3b5SNTxm27l lD9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709781815; x=1710386615; 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=2qK5soASicTv0ySk9Xejx0X64X5wdWSDVESyTR2YQY0=; b=YAsojyg0XHFgtRC3B0NXexeXlQdUbTdPuDTgahuakX4NsTe7wEbtcVxSrVY+koxyQa c3G/WjuRrKPUnydRvioBxmlM8Yeg154rfGXXboNJyJnc+rRDza/80fo7W7PZ8+ItOTxG nWookMNq2sw3IogJFt4pfTDzU91xZp7xkid62oDzZmgh4esoemOgKwQVbF+yQFs+Khk8 CREfr6LQHxPeVEsjCEUDoq3H48OG9Syvgly1G3qRNGVoe30SyDEev5kJio3ykEJR0B65 5XV8d0n3zVWIIkwlJ0hgrN0pFectaWVglKN7v/dembcKl7xMmsJ2nd21sR9H95kmierH ceyA== X-Gm-Message-State: AOJu0YxQJxYpDXYi/viSSFWPGgy0IwtA5tC8p6qoWaliCAFpHgEhP/qw nCwpx6JgpGGw+g/VVhRvjsMF9Jtft9U8LVvhiibd/jAZ2Zrib+J6dJoO58jEOZk= X-Google-Smtp-Source: AGHT+IHCYXhwlEnh9azO4p7RvPu/STaxqGsUQMHm9jMrqwaTiA13lbOsGIMuCt14SJAsRjiF+vMxlw== X-Received: by 2002:a05:6e02:1d83:b0:365:b9c8:4436 with SMTP id h3-20020a056e021d8300b00365b9c84436mr20744030ila.10.1709781815208; Wed, 06 Mar 2024 19:23:35 -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 v2 4/9] Hexagon (target/hexagon) Mark has_pred_dest in trans functions Date: Wed, 6 Mar 2024 20:23:22 -0700 Message-Id: <20240307032327.4799-5-ltaylorsimpson@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240307032327.4799-1-ltaylorsimpson@gmail.com> References: <20240307032327.4799-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::d36; envelope-from=ltaylorsimpson@gmail.com; helo=mail-io1-xd36.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: 1709781928229100003 Check that the value matches opcode_wregs Signed-off-by: Taylor Simpson Reviewed-by: Brian Cain --- target/hexagon/insn.h | 1 + target/hexagon/decode.c | 3 +++ target/hexagon/gen_trans_funcs.py | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/target/hexagon/insn.h b/target/hexagon/insn.h index a770379958..24dcf7fe9f 100644 --- a/target/hexagon/insn.h +++ b/target/hexagon/insn.h @@ -41,6 +41,7 @@ struct Instruction { uint32_t new_value_producer_slot:4; int32_t new_read_idx; int32_t dest_idx; + bool has_pred_dest; =20 bool part1; /* * cmp-jumps are split into two insns. diff --git a/target/hexagon/decode.c b/target/hexagon/decode.c index a4d8500fea..84a3899556 100644 --- a/target/hexagon/decode.c +++ b/target/hexagon/decode.c @@ -366,6 +366,9 @@ static void decode_shuffle_for_execution(Packet *packet) 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")) && GET_ATTRIB(opcode, A_STORE) =3D=3D 0) { diff --git a/target/hexagon/gen_trans_funcs.py b/target/hexagon/gen_trans_f= uncs.py index 1201172dda..9f86b4edbd 100755 --- a/target/hexagon/gen_trans_funcs.py +++ b/target/hexagon/gen_trans_funcs.py @@ -70,6 +70,7 @@ def mark_which_imm_extended(f, tag): ## insn->regno[2] =3D args->Rt; ## insn->new_read_idx =3D -1; ## insn->dest_idx =3D 0; +## insn->has_pred_dest =3D false; ## return true; ## } ## @@ -88,6 +89,7 @@ def gen_trans_funcs(f): =20 new_read_idx =3D -1 dest_idx =3D -1 + 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) f.write(code_fmt(f"""\ @@ -98,6 +100,8 @@ def gen_trans_funcs(f): # dest_idx should be the first destination, so check for -1 if reg.is_written() and dest_idx =3D=3D -1: dest_idx =3D regno + if reg_type =3D=3D "P" and reg.is_written() and not reg.is_rea= d(): + has_pred_dest =3D "true" =20 if len(imms) !=3D 0: mark_which_imm_extended(f, tag) @@ -121,6 +125,7 @@ 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->has_pred_dest =3D {has_pred_dest}; """)) f.write(textwrap.dedent(f"""\ return true; --=20 2.34.1 From nobody Mon May 20 16:52:34 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=1709781898; cv=none; d=zohomail.com; s=zohoarc; b=UHg/y/a7Altc4/ACgbLC9gIDjeMsQwwYVssK53i/vphcnwgq/mAFsLK2sqXXF61iOI4ZitQNTEfoagxHitwKYQ7vkDQiBjRE0O51xD5Uk8N3v9oahf7ZElpzUMWsFZP3v5IXKdPzzjivPQlnYf8rhy3REswrCmrGkGpIU7T2OA0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709781898; 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=G8J7F2iE5kae+EJMR1Fj9GxIukzXTHmw7zGOIwbFMQA=; b=UAFld0mQ7QhzGgMiK58KMyc8n/boVMbPNMcMClrAB2yaPgI3g4pdDlif0ai4c7cyv1tJ1e8KFnN05c+GiHXqnH4t62gdCAUrdmWP/41EHoaQ6Psd/ElrIqb0p6LlTBeQMNTA5gZnBAJOzk7qKhBO7qdihIpkzXOdISMVfyNiIM0= 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 170978189866859.86816950955949; Wed, 6 Mar 2024 19:24:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ri4M9-0001TI-22; Wed, 06 Mar 2024 22:23:41 -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 1ri4M7-0001Sg-IE for qemu-devel@nongnu.org; Wed, 06 Mar 2024 22:23:39 -0500 Received: from mail-io1-xd32.google.com ([2607:f8b0:4864:20::d32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ri4M6-0005hm-0H for qemu-devel@nongnu.org; Wed, 06 Mar 2024 22:23:39 -0500 Received: by mail-io1-xd32.google.com with SMTP id ca18e2360f4ac-7c854657e13so14091839f.1 for ; Wed, 06 Mar 2024 19:23:37 -0800 (PST) Received: from taylor-ubuntu.hsd1.co.comcast.net (c-73-169-12-54.hsd1.co.comcast.net. [73.169.12.54]) by smtp.gmail.com with ESMTPSA id h20-20020a02c734000000b00474e9a77424sm2233990jao.147.2024.03.06.19.23.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 19:23:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709781816; x=1710386616; 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=G8J7F2iE5kae+EJMR1Fj9GxIukzXTHmw7zGOIwbFMQA=; b=EcW9R5QXgou9pHN1RapdTvVvwCe4gJVkTz1/bSArUzXD7n0zvlTea9RQw27L1ecCK7 PjKt4Vt8W7+XIAfBpzCX6ICi6jPr4hxqwIgClwE23FEvhPDZhHahBXiPZVK7QetwWUVT UqFZ3JBh8wdiP3n+XC30KhkBsBR5xo9qcqo7sVg+t3VVIRkXJ1X+niSEPea+SE9dfOzk mfw/QX6GHzTXiuhGgUrGe9SS6p/idQmdqo/4xIUZpBX+re6OMWzB4+TV7X1lj1U7GETC uMj0dVOF83duHzh+faAbxP8RzBnRz/Ug1qfSq85/3gmQYml+KTx/SPAl2XkchzBD6QGm nBrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709781816; x=1710386616; 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=G8J7F2iE5kae+EJMR1Fj9GxIukzXTHmw7zGOIwbFMQA=; b=TGNLVo9ZQc+xdpYCwoAcjsCJEG0wO5ZZ2XQsbtSru9HbWU8VdwR8SkKK8rGyD2eDcj SsLSTa3mPnIjbD8kuoPOXgwTbjbPW/GWrG10LKbKLTiScDeL0AsbJfbevW5wIZDFeLl5 lml2b4V1f87GcYOheJ3RI4s2rsFcnThaTOr/guwOLQpzimBI/0wUJQqT3T5+Ikcxr+FJ Vbo6+8yo9GLWWmzd15rMEbSbVE3YZK17emHDVm9KNcCutgGXzOcpx0Mn6syfmOtYi6EC TdGqhlUmTzlC4tyGOyXifwErE+cnWcQ8qPaMWSXfpA9bg/0rn48MSsP7/zLN5wI3TPD+ qxdQ== X-Gm-Message-State: AOJu0YySwt9gE96VlPw+BDeLQflMymPls2miYR/laJkLyS7Kyu08bPNU 02of91dgyhARjFf40Hjmj8zHPBgFyPUyFcV/EQhrDUxb5pSCbJwF7qf7K9+vGTU= X-Google-Smtp-Source: AGHT+IFVLFsJc1YIjFalWPIg9rQtwl05NIVY2omMQMLo1ujfua9AlRO2S66kn9N5ZKMIJ5zspooy6A== X-Received: by 2002:a05:6602:1604:b0:7c8:65af:20ce with SMTP id x4-20020a056602160400b007c865af20cemr10157674iow.15.1709781816211; Wed, 06 Mar 2024 19:23:36 -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 v2 5/9] Hexagon (tests/tcg/hexagon) Test HVX .new read from high half of pair Date: Wed, 6 Mar 2024 20:23:23 -0700 Message-Id: <20240307032327.4799-6-ltaylorsimpson@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240307032327.4799-1-ltaylorsimpson@gmail.com> References: <20240307032327.4799-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::d32; envelope-from=ltaylorsimpson@gmail.com; helo=mail-io1-xd32.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: 1709781900209100003 Make sure the decoding of HVX .new is correctly handling this case Signed-off-by: Taylor Simpson Reviewed-by: Brian Cain --- tests/tcg/hexagon/hvx_misc.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/tcg/hexagon/hvx_misc.c b/tests/tcg/hexagon/hvx_misc.c index b45170acd1..1fe14b5158 100644 --- a/tests/tcg/hexagon/hvx_misc.c +++ b/tests/tcg/hexagon/hvx_misc.c @@ -1,5 +1,5 @@ /* - * Copyright(c) 2021-2023 Qualcomm Innovation Center, Inc. All Rights Res= erved. + * Copyright(c) 2021-2024 Qualcomm Innovation Center, Inc. All Rights Res= erved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -231,6 +231,7 @@ static void test_masked_store(bool invert) static void test_new_value_store(void) { void *p0 =3D buffer0; + void *p1 =3D buffer1; void *pout =3D output; =20 asm("{\n\t" @@ -242,6 +243,19 @@ static void test_new_value_store(void) expect[0] =3D buffer0[0]; =20 check_output_w(__LINE__, 1); + + /* Test the .new read from the high half of a pair */ + asm("v7 =3D vmem(%0 + #0)\n\t" + "v12 =3D vmem(%1 + #0)\n\t" + "{\n\t" + " v5:4 =3D vcombine(v12, v7)\n\t" + " vmem(%2 + #0) =3D v5.new\n\t" + "}\n\t" + : : "r"(p0), "r"(p1), "r"(pout) : "v4", "v5", "v7", "v12", "memory= "); + + expect[0] =3D buffer1[0]; + + check_output_w(__LINE__, 1); } =20 static void test_max_temps() --=20 2.34.1 From nobody Mon May 20 16:52:34 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=1709781857; cv=none; d=zohomail.com; s=zohoarc; b=LPHeN4Bt21yoJOQXulrUeiN8OvDOfSO8tnn++7Yz2AqbBZMllT68vJA2Egwyyy0ioS5Vj/LJWaEGXTPi5VZhxSNvvwllUS6YQ0II650jw/q/ZH26TVb3qf2aAucljttbqwoNoR73NrUs4tp6dj3SlzRbfMA3awOiaNI276eY+jk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709781857; 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=gnTk+gAavFK7ZdT/oMeonfuPRPy3Zb3jTvPCNBoMmiUYor3OO1qqJUqBK74a+FpXkjjkvMvu+AXjaypFECZwyBGiAZJzL1IJBXt6pi5qLjMAHgztHcuEt60mMCvJw5UmOk0f+jidMtd9/8U6AWtWuwQYT0A+iUhxUS5ZqaLp4JY= 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 1709781857834871.7764567747937; Wed, 6 Mar 2024 19:24:17 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ri4MB-0001Tf-4C; Wed, 06 Mar 2024 22:23:43 -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 1ri4M9-0001TJ-Co for qemu-devel@nongnu.org; Wed, 06 Mar 2024 22:23:41 -0500 Received: from mail-oa1-x2d.google.com ([2001:4860:4864:20::2d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ri4M7-0005ji-JN for qemu-devel@nongnu.org; Wed, 06 Mar 2024 22:23:41 -0500 Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-21f3a4ba205so166021fac.1 for ; Wed, 06 Mar 2024 19:23:39 -0800 (PST) Received: from taylor-ubuntu.hsd1.co.comcast.net (c-73-169-12-54.hsd1.co.comcast.net. [73.169.12.54]) by smtp.gmail.com with ESMTPSA id h20-20020a02c734000000b00474e9a77424sm2233990jao.147.2024.03.06.19.23.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 19:23:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709781817; x=1710386617; 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=eNAqIRU/zVGgMQC1Az+Beqf0jCqIEY3FDRkh0H9VAhHYyck3uGEScnZ9lIqom1a8P5 c6Jz0dMgE8TY5NErI9zs9LqDO2/Q+7uiBHG0SXPmlc8k1zMy1dUqpklTOB3ABn0WmCdU KsiMy0jM3M++LTqnQHkCd1M4RrO9bRjVxeakUFLW59CJSJBab4D7QpeWnrgotQRJ5xa5 cBUfbghkBctDvc3/qmPoIpjANGby9WZpmS+Ue39DUyexJsSKncVHzFOMpdOfhJ5UP2+G AbKCKQgLst8vkEzA73h/5Lfk0kWOJM8/WmBazjRhc+zaRVphQiZKYVXhvfxXVFm6W6bu +I1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709781817; x=1710386617; 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=gF31pQRKEEi4iHJs8mOuyu4zHLEQkqYlfNt0euk4Bu253KEzYbWUf5ovFEiDZNRD0e dnWgkSkMb2SLy3PWmohZkQpFOSbM7zI16Ob18pbj/2EjoAhFnUxxHA0ssVKnimfUSqFJ yzeUMYBHLSDIswxjTyj8ZF7W5rZCqpLX2jkClp91VYKQceCKFq7HwqCdDaywNW2zOu7G 9hAW7PIMpxEczXs8vXhR5invh2xz/92gbJmk/2orDoSq/0vdQH+2JJznynSoG/xSDSR3 5ZX2vwMuThPNoAOhhS1WpvkicCnvOTm7IjH+avB0ujBphvYGosUITq6RZ3PZ+AeEN/ZJ haog== X-Gm-Message-State: AOJu0YyFPAmveTrhjvLxVxl75pP3q74ZsOAphDSggraI/H6dg+jCsv81 TBQEKyy8EcLEaBOshIAGEOxq9t2xyJYnEav+EKCU9ZDZeg/LFay6zGuCw5YwQt8= X-Google-Smtp-Source: AGHT+IHRKajcx9dcZRRaAWHLoYhTZ7Cd6KlsDgKJgxZwEny+8Ebo76gwgisGMG7EV9jVoTZqn7gveA== X-Received: by 2002:a05:6870:889:b0:221:38c0:3f0a with SMTP id fx9-20020a056870088900b0022138c03f0amr6649970oab.35.1709781817225; Wed, 06 Mar 2024 19:23:37 -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 v2 6/9] Hexagon (target/hexagon) Remove uses of op_regs_generated.h.inc Date: Wed, 6 Mar 2024 20:23:24 -0700 Message-Id: <20240307032327.4799-7-ltaylorsimpson@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240307032327.4799-1-ltaylorsimpson@gmail.com> References: <20240307032327.4799-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=2001:4860:4864:20::2d; envelope-from=ltaylorsimpson@gmail.com; helo=mail-oa1-x2d.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: 1709781860018100007 Signed-off-by: Taylor Simpson Reviewed-by: Brian Cain --- 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 From nobody Mon May 20 16:52:34 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=1709781881; cv=none; d=zohomail.com; s=zohoarc; b=oD1oiTj7r/pDCTqKtFBJbIM8hI68VwEgyCpqXQBsDesDCqJL+q5jR/KPFLbtYpaj7Yz0NMYwu6/beOLAhpCFa27T0xG/29Mv8zXkOg70ZTIROAKyXJAysStfYvH35OIITBsBPuDQrKpzH2stYmcF3YMWtb4OaB390XO4x/vIzIQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709781881; 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=5r8V+dWA3RVhS5vfjxAmsItqAa6Frdq+W5yFoj18eJ8=; b=bbGdD8enj25xDWTtr1xeWVZVGJESsrpd0Ol7DDotq4YGRqsYjyaJzzt81Y5fUy/bG9TosY4TJ7RSwAxnk+d7P8iZhHhxhfYjvsfO5pNeK2zHGwvqh3vPIab+YASnOB9rieYbO/8d7TFJ+vplqUDGfGx5gIdmJzaeDSc/dnuZNQQ= 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 1709781881986860.1051964416746; Wed, 6 Mar 2024 19:24:41 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ri4MC-0001Tj-Jr; Wed, 06 Mar 2024 22:23:44 -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 1ri4MA-0001TS-NK for qemu-devel@nongnu.org; Wed, 06 Mar 2024 22:23:42 -0500 Received: from mail-io1-xd2b.google.com ([2607:f8b0:4864:20::d2b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ri4M8-0005kt-Ry for qemu-devel@nongnu.org; Wed, 06 Mar 2024 22:23:42 -0500 Received: by mail-io1-xd2b.google.com with SMTP id ca18e2360f4ac-7c872a07d57so20560739f.0 for ; Wed, 06 Mar 2024 19:23:40 -0800 (PST) Received: from taylor-ubuntu.hsd1.co.comcast.net (c-73-169-12-54.hsd1.co.comcast.net. [73.169.12.54]) by smtp.gmail.com with ESMTPSA id h20-20020a02c734000000b00474e9a77424sm2233990jao.147.2024.03.06.19.23.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 19:23:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709781819; x=1710386619; 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=5r8V+dWA3RVhS5vfjxAmsItqAa6Frdq+W5yFoj18eJ8=; b=nNvl6gJddO/L3FSPeF0f0qonKJuh8ej23h2DWNRZgTSBNScxkdiqIhtMqghnp4T6fq E6J1LbWUZhs0wndSomqJekqwCGUxzeyyJ89VmNEHGFT+S9gwg+7PiUATxO+6HByUy9fB Lcnvf6cBVGo2ua6IMkdrD7RNCq8MNnEeBxFzBEW/x3OP3YqxFgY23NstPw2TByW1kcCT rqMCTuEd4nXzKhW0+FwJQCxlvlJmMo9wfLE/ZNxdGSICKZwwcdn0kIBAIEu1JwgXViG9 SEVgPryGlDTh9bFF3Mk7EuWtY/mz0qMriZhEeSAW5G0/Ms3hJJ7m9P6d+AyXaQf2THhO g+bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709781819; x=1710386619; 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=5r8V+dWA3RVhS5vfjxAmsItqAa6Frdq+W5yFoj18eJ8=; b=dMeFkKPLoXN2CSJxDFq5GwxBnS2pzywQhrOy+ThQh1JKuxvRiOIApqwyp+eSLUdQi+ zPWJzR4I+lCwM4GjB3JOV/Aq/L7kktpm/XFJ+FCDlHWei6ji2xqWidZU+jmZD5zMIqYo hyPautFxBHTt1Q6RGf0i4lEpXn1rWd4qWHNjfsrrJNBA4nLsFPM6H5Nhtr7zqhfG0mKI 6sZWZXz9UkpV6Cnf4QlbK9Zmq2kAPtPWXlD/bMc9M2ycRM35mIuuGby1nCdwmhqyYAXc pPH1H/1Al4rzI6lJEln2czL6dOm+bG5MgsOED97CyFF5sYa4IOO1x+80/Z2dvfG3JPEf Cz/g== X-Gm-Message-State: AOJu0Yw3+kIhvwFZKSXfWR3/Sv+Kx0oq6BFBvBrnpTNRJ+AG7P0cN3RD UUQk8UkhIPcxAuqThFxISd7ZnwniCE+7X99Stz/iM9Q1bAmwfziy7r/FoqJ4JAI= X-Google-Smtp-Source: AGHT+IGKqaar5XrSt6zDPlLGkQx78csZj8zjHpFDaQH1HXeQhfGT/cFkqzjUxN+ry+WjWb5BzbbQyQ== X-Received: by 2002:a6b:c94f:0:b0:7c8:45d4:6313 with SMTP id z76-20020a6bc94f000000b007c845d46313mr11474318iof.10.1709781818787; Wed, 06 Mar 2024 19:23:38 -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 v2 7/9] Hexagon (target/hexagon) Remove gen_op_regs.py Date: Wed, 6 Mar 2024 20:23:25 -0700 Message-Id: <20240307032327.4799-8-ltaylorsimpson@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240307032327.4799-1-ltaylorsimpson@gmail.com> References: <20240307032327.4799-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::d2b; envelope-from=ltaylorsimpson@gmail.com; helo=mail-io1-xd2b.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, WEIRD_QUOTING=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: 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: 1709781884240100003 Signed-off-by: Taylor Simpson Reviewed-by: Brian Cain --- target/hexagon/README | 1 - target/hexagon/gen_op_regs.py | 125 ---------------------------------- target/hexagon/meson.build | 14 +--- 3 files changed, 2 insertions(+), 138 deletions(-) delete mode 100755 target/hexagon/gen_op_regs.py diff --git a/target/hexagon/README b/target/hexagon/README index 746ebec378..065c05154d 100644 --- a/target/hexagon/README +++ b/target/hexagon/README @@ -43,7 +43,6 @@ target/hexagon/gen_semantics.c. This step produces That file is consumed by the following python scripts to produce the indic= ated header files in /target/hexagon gen_opcodes_def.py -> opcodes_def_generated.h.inc - gen_op_regs.py -> op_regs_generated.h.inc gen_printinsn.py -> printinsn_generated.h.inc gen_op_attribs.py -> op_attribs_generated.h.inc gen_helper_protos.py -> helper_protos_generated.h.inc diff --git a/target/hexagon/gen_op_regs.py b/target/hexagon/gen_op_regs.py deleted file mode 100755 index 7b7b33895a..0000000000 --- a/target/hexagon/gen_op_regs.py +++ /dev/null @@ -1,125 +0,0 @@ -#!/usr/bin/env python3 - -## -## Copyright(c) 2019-2023 Qualcomm Innovation Center, Inc. All Rights Res= erved. -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this program; if not, see . -## - -import sys -import re -import string -import hex_common - - -## -## Generate the register and immediate operands for each instruction -## -def calculate_regid_reg(tag): - def letter_inc(x): - return chr(ord(x) + 1) - - ordered_implregs =3D ["SP", "FP", "LR"] - srcdst_lett =3D "X" - src_lett =3D "S" - dst_lett =3D "D" - retstr =3D "" - mapdict =3D {} - for reg in ordered_implregs: - reg_rd =3D 0 - reg_wr =3D 0 - if ("A_IMPLICIT_WRITES_" + reg) in hex_common.attribdict[tag]: - reg_wr =3D 1 - if reg_rd and reg_wr: - retstr +=3D srcdst_lett - mapdict[srcdst_lett] =3D reg - srcdst_lett =3D letter_inc(srcdst_lett) - elif reg_rd: - retstr +=3D src_lett - mapdict[src_lett] =3D reg - src_lett =3D letter_inc(src_lett) - elif reg_wr: - retstr +=3D dst_lett - mapdict[dst_lett] =3D reg - dst_lett =3D letter_inc(dst_lett) - return retstr, mapdict - - -def calculate_regid_letters(tag): - retstr, mapdict =3D calculate_regid_reg(tag) - return retstr - - -def strip_reg_prefix(x): - y =3D x.replace("UREG.", "") - y =3D y.replace("MREG.", "") - return y.replace("GREG.", "") - - -def main(): - hex_common.read_semantics_file(sys.argv[1]) - hex_common.read_attribs_file(sys.argv[2]) - hex_common.init_registers() - tagregs =3D hex_common.get_tagregs(full=3DTrue) - tagimms =3D hex_common.get_tagimms() - - with open(sys.argv[3], "w") as f: - for tag in hex_common.tags: - regs =3D tagregs[tag] - rregs =3D [] - wregs =3D [] - regids =3D "" - for regtype, regid, _, numregs in regs: - reg =3D hex_common.get_register(tag, regtype, regid) - if reg.is_read(): - if regid[0] not in regids: - regids +=3D regid[0] - rregs.append(regtype + regid + numregs) - if reg.is_written(): - wregs.append(regtype + regid + numregs) - if regid[0] not in regids: - regids +=3D regid[0] - for attrib in hex_common.attribdict[tag]: - if hex_common.attribinfo[attrib]["rreg"]: - rregs.append(strip_reg_prefix(attribinfo[attrib]["rreg= "])) - if hex_common.attribinfo[attrib]["wreg"]: - wregs.append(strip_reg_prefix(attribinfo[attrib]["wreg= "])) - regids +=3D calculate_regid_letters(tag) - f.write( - f'REGINFO({tag},"{regids}",\t/*RD:*/\t"{",".join(rregs)}",' - f'\t/*WR:*/\t"{",".join(wregs)}")\n' - ) - - for tag in hex_common.tags: - imms =3D tagimms[tag] - f.write(f"IMMINFO({tag}") - if not imms: - f.write(""",'u',0,0,'U',0,0""") - for sign, size, shamt in imms: - if sign =3D=3D "r": - sign =3D "s" - if not shamt: - shamt =3D "0" - f.write(f""",'{sign}',{size},{shamt}""") - if len(imms) =3D=3D 1: - if sign.isupper(): - myu =3D "u" - else: - myu =3D "U" - f.write(f""",'{myu}',0,0""") - f.write(")\n") - - -if __name__ =3D=3D "__main__": - main() diff --git a/target/hexagon/meson.build b/target/hexagon/meson.build index fb480afc03..b3a0944d3b 100644 --- a/target/hexagon/meson.build +++ b/target/hexagon/meson.build @@ -1,5 +1,5 @@ ## -## Copyright(c) 2020-2023 Qualcomm Innovation Center, Inc. All Rights Res= erved. +## Copyright(c) 2020-2024 Qualcomm Innovation Center, Inc. All Rights Res= erved. ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -45,7 +45,6 @@ hexagon_ss.add(semantics_generated) # shortcode_generated.h.inc # tcg_func_table_generated.c.inc # printinsn_generated.h.inc -# op_regs_generated.h.inc # op_attribs_generated.h.inc # opcodes_def_generated.h.inc # @@ -76,15 +75,6 @@ printinsn_generated =3D custom_target( ) hexagon_ss.add(printinsn_generated) =20 -op_regs_generated =3D custom_target( - 'op_regs_generated.h.inc', - output: 'op_regs_generated.h.inc', - depends: [semantics_generated], - depend_files: [hex_common_py, attribs_def], - command: [python, files('gen_op_regs.py'), semantics_generated, attrib= s_def, '@OUTPUT@'], -) -hexagon_ss.add(op_regs_generated) - op_attribs_generated =3D custom_target( 'op_attribs_generated.h.inc', output: 'op_attribs_generated.h.inc', @@ -110,7 +100,7 @@ hexagon_ss.add(opcodes_def_generated) # gen_dectree_import =3D executable( 'gen_dectree_import', - 'gen_dectree_import.c', opcodes_def_generated, op_regs_generated, + 'gen_dectree_import.c', opcodes_def_generated, native: true, build_by_default: false) =20 iset_py =3D custom_target( --=20 2.34.1 From nobody Mon May 20 16:52:34 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=1709781931; cv=none; d=zohomail.com; s=zohoarc; b=GU9HxKCy6wT3TpM2HXPFwljM+QmsOGj9aCnLFDKozFOT8ld3e14X8s6VRZsGSxMquIKPEqt8Xamq53xnkVd//jn8Qw9OQO6oROa7KynEEG9Ud90Sq4cnkI60dYGfVuopVJ1rMOE8p88Nq78mFMWKabJx824xV53cwN17o9Iqpoc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709781931; 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=2kAEgIdBp6Ue1btIM+Uj1VoaSgxC8giYiH5Kmbwpsfk=; b=gW4vtNdIQkzSg7fX6y48NuKapA4E8sjAQF+XEJaCf7pmARSZ7QikVM0Q4Ucr02OZuGrAT/3nI19yhBYBN4cC0WbABM456TziwfENvqVh35p5Er11hkC4JviaxMeFiR5PjON/6ofjt1CTvTYqcwssSoYZwZAA6pbI7VYgkea0nrM= 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 1709781931290848.9272241974136; Wed, 6 Mar 2024 19:25:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ri4ME-0001UO-CU; Wed, 06 Mar 2024 22:23:46 -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 1ri4MC-0001Tm-Uf for qemu-devel@nongnu.org; Wed, 06 Mar 2024 22:23:45 -0500 Received: from mail-io1-xd2b.google.com ([2607:f8b0:4864:20::d2b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ri4MA-0005lD-7X for qemu-devel@nongnu.org; Wed, 06 Mar 2024 22:23:44 -0500 Received: by mail-io1-xd2b.google.com with SMTP id ca18e2360f4ac-7c8773a9599so15585139f.0 for ; Wed, 06 Mar 2024 19:23:41 -0800 (PST) Received: from taylor-ubuntu.hsd1.co.comcast.net (c-73-169-12-54.hsd1.co.comcast.net. [73.169.12.54]) by smtp.gmail.com with ESMTPSA id h20-20020a02c734000000b00474e9a77424sm2233990jao.147.2024.03.06.19.23.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 19:23:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709781820; x=1710386620; 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=2kAEgIdBp6Ue1btIM+Uj1VoaSgxC8giYiH5Kmbwpsfk=; b=cyPfGzXavmN2LsqNm0HomWcTyPazEM18FEX3+uzVXVLiAMpHgRJYxwTGZwhBvdCvqz JB7fl+I2JgyVDcTVVgKh17vdMH9LwZKcK3FVJ+q6C+qqY0rne72A+NsvooPEj/9+UFAq OUeqcw+R2cCgzizITNoWQfbBexK5xgTNEMmk6qs2XZh4TEHOTGFL/b2A9InpVy3wsal2 /ZIKVmO9j6Y728tz+TnYjqSc+/ArvhFedUTdHtqlcqzgCc11ZMzQPvv/B5gQg4p/Dkjj MBgzjo59xRl6hOrrvUEHPj0inzBzm4GGQc1Ww9tVM9TuO0rKBkyuHVHUnzQzauqe94Rh tJUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709781820; x=1710386620; 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=2kAEgIdBp6Ue1btIM+Uj1VoaSgxC8giYiH5Kmbwpsfk=; b=N+BpgopYudfWy4NGqaIep2FvHb5d4F+OivEIL7cCkDX/0u4cE2VnaX8bK0gTW96vGn PibgRRrlLBmEJMukdRNI7pTO+n4Yi12k9hzC8mc4YqbqD/hgbzo/TVm/eLVGn3tqTP5c lJqhMEa0uQuFGCMSPGZ/ldSZdqO5YC5q4w7YyAMZPqfx4wyQ5xHpR2GNZ/A3xhjGUFzP jJqlCZaBi7hxdAflAG3sz+u2CZqtl18PHZq7JMxispEhcNACXxONbADHN7OSFFfYsYGL qaw1xLHDp/Oe970xiGvOsLxqBnaZaulV0mzBMD+sNPR6R4uxGeniQ9omwok3336g3tXf KHqw== X-Gm-Message-State: AOJu0YwEbobrs+BrA7FufhBHD6Yp4Bf7aF5ENlnpvh++/oB6v5BZvB49 VrLOoxDRXi9oYHVv0iTmWbMM+dHp37R2Dt/rP5F2upMqBdzSUkuSbjP1wd0tmgQ= X-Google-Smtp-Source: AGHT+IHIT2T4ZZKYpTAA7Wdp5OaYrH7yq6hRAa/ziZwQR33SvCttjkGp5NpYH2MCxrsEj+9vKsk9Zg== X-Received: by 2002:a5e:a50e:0:b0:7c8:3c53:1e42 with SMTP id 14-20020a5ea50e000000b007c83c531e42mr14403007iog.14.1709781820258; Wed, 06 Mar 2024 19:23:40 -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 v2 8/9] Hexagon (target/hexagon) Remove gen_shortcode.py Date: Wed, 6 Mar 2024 20:23:26 -0700 Message-Id: <20240307032327.4799-9-ltaylorsimpson@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240307032327.4799-1-ltaylorsimpson@gmail.com> References: <20240307032327.4799-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::d2b; envelope-from=ltaylorsimpson@gmail.com; helo=mail-io1-xd2b.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: 1709781932277100001 This data structure is not used Signed-off-by: Taylor Simpson Reviewed-by: Brian Cain Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- target/hexagon/opcodes.c | 7 ---- target/hexagon/README | 1 - target/hexagon/gen_shortcode.py | 63 --------------------------------- target/hexagon/meson.build | 10 ------ 4 files changed, 81 deletions(-) delete mode 100755 target/hexagon/gen_shortcode.py diff --git a/target/hexagon/opcodes.c b/target/hexagon/opcodes.c index 02ae9cf787..c8bde2f9e9 100644 --- a/target/hexagon/opcodes.c +++ b/target/hexagon/opcodes.c @@ -37,13 +37,6 @@ const char * const opcode_names[] =3D { }; =20 =20 -const char * const opcode_short_semantics[] =3D { -#define DEF_SHORTCODE(TAG, SHORTCODE) [TAG] =3D #SHORTCODE, -#include "shortcode_generated.h.inc" -#undef DEF_SHORTCODE - NULL -}; - DECLARE_BITMAP(opcode_attribs[XX_LAST_OPCODE], A_ZZ_LASTATTRIB); =20 static void init_attribs(int tag, ...) diff --git a/target/hexagon/README b/target/hexagon/README index 065c05154d..65b4fcc0fa 100644 --- a/target/hexagon/README +++ b/target/hexagon/README @@ -46,7 +46,6 @@ header files in /target/hexagon gen_printinsn.py -> printinsn_generated.h.inc gen_op_attribs.py -> op_attribs_generated.h.inc gen_helper_protos.py -> helper_protos_generated.h.inc - gen_shortcode.py -> shortcode_generated.h.inc gen_tcg_funcs.py -> tcg_funcs_generated.c.inc gen_tcg_func_table.py -> tcg_func_table_generated.c.inc gen_helper_funcs.py -> helper_funcs_generated.c.inc diff --git a/target/hexagon/gen_shortcode.py b/target/hexagon/gen_shortcode= .py deleted file mode 100755 index deb94446c4..0000000000 --- a/target/hexagon/gen_shortcode.py +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env python3 - -## -## Copyright(c) 2019-2023 Qualcomm Innovation Center, Inc. All Rights Res= erved. -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this program; if not, see . -## - -import sys -import re -import string -import hex_common - - -def gen_shortcode(f, tag): - f.write(f"DEF_SHORTCODE({tag}, {hex_common.semdict[tag]})\n") - - -def main(): - hex_common.read_semantics_file(sys.argv[1]) - hex_common.read_attribs_file(sys.argv[2]) - hex_common.calculate_attribs() - tagregs =3D hex_common.get_tagregs() - tagimms =3D hex_common.get_tagimms() - - with open(sys.argv[3], "w") as f: - f.write("#ifndef DEF_SHORTCODE\n") - f.write("#define DEF_SHORTCODE(TAG,SHORTCODE) /* Nothing */\n") - f.write("#endif\n") - - for tag in hex_common.tags: - ## Skip the priv instructions - if "A_PRIV" in hex_common.attribdict[tag]: - continue - ## Skip the guest instructions - if "A_GUEST" in hex_common.attribdict[tag]: - continue - ## Skip the diag instructions - if tag =3D=3D "Y6_diag": - continue - if tag =3D=3D "Y6_diag0": - continue - if tag =3D=3D "Y6_diag1": - continue - - gen_shortcode(f, tag) - - f.write("#undef DEF_SHORTCODE\n") - - -if __name__ =3D=3D "__main__": - main() diff --git a/target/hexagon/meson.build b/target/hexagon/meson.build index b3a0944d3b..988e7489ba 100644 --- a/target/hexagon/meson.build +++ b/target/hexagon/meson.build @@ -42,21 +42,11 @@ hexagon_ss.add(semantics_generated) # # Step 2 # We use Python scripts to generate the following files -# shortcode_generated.h.inc # tcg_func_table_generated.c.inc # printinsn_generated.h.inc # op_attribs_generated.h.inc # opcodes_def_generated.h.inc # -shortcode_generated =3D custom_target( - 'shortcode_generated.h.inc', - output: 'shortcode_generated.h.inc', - depends: [semantics_generated], - depend_files: [hex_common_py, attribs_def], - command: [python, files('gen_shortcode.py'), semantics_generated, attr= ibs_def, '@OUTPUT@'], -) -hexagon_ss.add(shortcode_generated) - tcg_func_table_generated =3D custom_target( 'tcg_func_table_generated.c.inc', output: 'tcg_func_table_generated.c.inc', --=20 2.34.1 From nobody Mon May 20 16:52:34 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=1709781858; cv=none; d=zohomail.com; s=zohoarc; b=kZSwofY3QTpt18Z3OycdtbDz7+5julAgA1gE0GH8zyKZ5QBq7zHu5ctyOCMkI6SE94zj+djwBHFuD1DTcFLMayeEdI6CEtVgqkCPLKM9ueXukefroPKYg3CEAX0I/mbYPRrnbnP2XeXsoV2u18RK3UjO+lNRv0QxnksjjttC8NA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709781858; 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=2mZF31pVOsPdanhM75ZSyb+FCM6gHs0R2hRgmZ/lF6E=; b=O+myRsEnv1bJYbxtipUdvdQnnRooYUpRahV0+VrR96kbTSFh0vHch9/6iEJTojTzYRmPhSbEhMRN3vTAy7rmml6Fc4nQCviqy1bfmtseiwERN51jr2+on2F3GqqEJ02FrrDo0zlTwCYQAtlzdUth7/cWuFBaxlYzs6uGy/IIGi4= 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 1709781858843726.4798709532029; Wed, 6 Mar 2024 19:24:18 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ri4MG-0001Us-47; Wed, 06 Mar 2024 22:23:48 -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 1ri4ME-0001Ue-Ts for qemu-devel@nongnu.org; Wed, 06 Mar 2024 22:23:46 -0500 Received: from mail-io1-xd31.google.com ([2607:f8b0:4864:20::d31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ri4MB-0005lR-Gl for qemu-devel@nongnu.org; Wed, 06 Mar 2024 22:23:46 -0500 Received: by mail-io1-xd31.google.com with SMTP id ca18e2360f4ac-7c83fb0fa01so15914239f.1 for ; Wed, 06 Mar 2024 19:23:43 -0800 (PST) Received: from taylor-ubuntu.hsd1.co.comcast.net (c-73-169-12-54.hsd1.co.comcast.net. [73.169.12.54]) by smtp.gmail.com with ESMTPSA id h20-20020a02c734000000b00474e9a77424sm2233990jao.147.2024.03.06.19.23.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 19:23:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709781822; x=1710386622; 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=2mZF31pVOsPdanhM75ZSyb+FCM6gHs0R2hRgmZ/lF6E=; b=RBG5bhX/XA1TVkZc0noXV29i1RNH1tiVgYEwpxdZ/c9QXmUG5+w2Wf5A5Oyc+bEI2m z7VPcGMLoCPjFFCwKVHLjXKLtLqGsPz/hCeBBK+BghgxGi/vMxXy3k9SWv/LwfkzGZ/V aEzQR37+N+jryawcRpha2uVFo/GGSI91gK3s7EUT+kxHru1qR5v5l0IwTWftiXacZ+0w DMm/BOowogU2uwM1y2CFTgmPB1BbRUbGd4FQbzE6tC2F37MS/xzPw3US3MHGSyJmHSAL q/IL/H3EUEqIFI22sOrjH6FWnIByZppFBc7AjyXeZDjgO//hy5GVq4FZ/WFhlgjm0dTS GKfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709781822; x=1710386622; 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=2mZF31pVOsPdanhM75ZSyb+FCM6gHs0R2hRgmZ/lF6E=; b=j8MOOmn8x8gAMAow/W4e/UAZqZVaF4/z564MSLewEoQPFfk7BUzpqm+YDHXtUh/x1U NRfvrHjm5cS7L/BpeGKU+29wmHPCtM5YYthk1L1394gEbI/qRgLR32uaA6+GcZuxOnNj zNr/zTHVlVPiFRBJEKRsyP7wyEMReesfpUCY+TxaMKvYGbkvoswBTgCwWHHUNBs/DfUj t2/ZXqjcsAMPPrR/FnlqGpPig/oHtl6AzWhEAlj+xVFde6hh5m6A9ntMe6zEzSi9i9R9 4RdDSKShOp2vmR78Uvto5e2SKVqtBaa9J6YsvKJUgvldVehIEPBTrL4e5JRjIusScalM 44qA== X-Gm-Message-State: AOJu0YwaQMonkypItwHG3mNssVkEFs8eK40REAb4yIwqEGRu8gJZQrSH 9EtONVKJP77b459vXxIIMNQ5Erk/Kxn9xrqZGUYsJqjnvt5ZNejiL/tsWnyJ7Ns= X-Google-Smtp-Source: AGHT+IG5Uvp6TK1WMriFXsCmn/81LHkatybrIYhzmbTUwWCSm7kr2s9/FC686CPPSl8Hkr0WbvBvoA== X-Received: by 2002:a6b:e204:0:b0:7c8:7d11:9d99 with SMTP id z4-20020a6be204000000b007c87d119d99mr2859496ioc.19.1709781821966; Wed, 06 Mar 2024 19:23:41 -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 v2 9/9] Hexagon (target/hexagon) Remove hex_common.read_attribs_file Date: Wed, 6 Mar 2024 20:23:27 -0700 Message-Id: <20240307032327.4799-10-ltaylorsimpson@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240307032327.4799-1-ltaylorsimpson@gmail.com> References: <20240307032327.4799-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::d31; envelope-from=ltaylorsimpson@gmail.com; helo=mail-io1-xd31.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: 1709781860052100008 The attribinfo data structure is not used Adjust the command-line arguments to the python scripts Add hex_common.read_common_files for TCG/helper generation scripts Signed-off-by: Taylor Simpson Reviewed-by: Brian Cain Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- target/hexagon/gen_analyze_funcs.py | 21 ++------------- target/hexagon/gen_helper_funcs.py | 21 ++------------- target/hexagon/gen_helper_protos.py | 21 ++------------- target/hexagon/gen_idef_parser_funcs.py | 5 ++-- target/hexagon/gen_op_attribs.py | 5 ++-- target/hexagon/gen_opcodes_def.py | 4 +-- target/hexagon/gen_printinsn.py | 5 ++-- target/hexagon/gen_tcg_func_table.py | 5 ++-- target/hexagon/gen_tcg_funcs.py | 21 ++------------- target/hexagon/hex_common.py | 35 +++++++++++++++---------- target/hexagon/meson.build | 31 +++++++++++----------- 11 files changed, 54 insertions(+), 120 deletions(-) diff --git a/target/hexagon/gen_analyze_funcs.py b/target/hexagon/gen_analy= ze_funcs.py index a9af666cef..b73b4e2349 100755 --- a/target/hexagon/gen_analyze_funcs.py +++ b/target/hexagon/gen_analyze_funcs.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 =20 ## -## Copyright(c) 2022-2023 Qualcomm Innovation Center, Inc. All Rights Res= erved. +## Copyright(c) 2022-2024 Qualcomm Innovation Center, Inc. All Rights Res= erved. ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -67,24 +67,7 @@ def gen_analyze_func(f, tag, regs, imms): =20 =20 def main(): - hex_common.read_semantics_file(sys.argv[1]) - hex_common.read_attribs_file(sys.argv[2]) - hex_common.read_overrides_file(sys.argv[3]) - hex_common.read_overrides_file(sys.argv[4]) - ## Whether or not idef-parser is enabled is - ## determined by the number of arguments to - ## this script: - ## - ## 5 args. -> not enabled, - ## 6 args. -> idef-parser enabled. - ## - ## The 6:th arg. then holds a list of the successfully - ## parsed instructions. - is_idef_parser_enabled =3D len(sys.argv) > 6 - if is_idef_parser_enabled: - hex_common.read_idef_parser_enabled_file(sys.argv[5]) - hex_common.calculate_attribs() - hex_common.init_registers() + hex_common.read_common_files() tagregs =3D hex_common.get_tagregs() tagimms =3D hex_common.get_tagimms() =20 diff --git a/target/hexagon/gen_helper_funcs.py b/target/hexagon/gen_helper= _funcs.py index 9cc3d69c49..e9685bff2f 100755 --- a/target/hexagon/gen_helper_funcs.py +++ b/target/hexagon/gen_helper_funcs.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 =20 ## -## Copyright(c) 2019-2023 Qualcomm Innovation Center, Inc. All Rights Res= erved. +## Copyright(c) 2019-2024 Qualcomm Innovation Center, Inc. All Rights Res= erved. ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -102,24 +102,7 @@ def gen_helper_function(f, tag, tagregs, tagimms): =20 =20 def main(): - hex_common.read_semantics_file(sys.argv[1]) - hex_common.read_attribs_file(sys.argv[2]) - hex_common.read_overrides_file(sys.argv[3]) - hex_common.read_overrides_file(sys.argv[4]) - ## Whether or not idef-parser is enabled is - ## determined by the number of arguments to - ## this script: - ## - ## 5 args. -> not enabled, - ## 6 args. -> idef-parser enabled. - ## - ## The 6:th arg. then holds a list of the successfully - ## parsed instructions. - is_idef_parser_enabled =3D len(sys.argv) > 6 - if is_idef_parser_enabled: - hex_common.read_idef_parser_enabled_file(sys.argv[5]) - hex_common.calculate_attribs() - hex_common.init_registers() + hex_common.read_common_files() tagregs =3D hex_common.get_tagregs() tagimms =3D hex_common.get_tagimms() =20 diff --git a/target/hexagon/gen_helper_protos.py b/target/hexagon/gen_helpe= r_protos.py index c82b0f54e4..4cc72a1581 100755 --- a/target/hexagon/gen_helper_protos.py +++ b/target/hexagon/gen_helper_protos.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 =20 ## -## Copyright(c) 2019-2023 Qualcomm Innovation Center, Inc. All Rights Res= erved. +## Copyright(c) 2019-2024 Qualcomm Innovation Center, Inc. All Rights Res= erved. ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -44,24 +44,7 @@ def gen_helper_prototype(f, tag, tagregs, tagimms): =20 =20 def main(): - hex_common.read_semantics_file(sys.argv[1]) - hex_common.read_attribs_file(sys.argv[2]) - hex_common.read_overrides_file(sys.argv[3]) - hex_common.read_overrides_file(sys.argv[4]) - ## Whether or not idef-parser is enabled is - ## determined by the number of arguments to - ## this script: - ## - ## 5 args. -> not enabled, - ## 6 args. -> idef-parser enabled. - ## - ## The 6:th arg. then holds a list of the successfully - ## parsed instructions. - is_idef_parser_enabled =3D len(sys.argv) > 6 - if is_idef_parser_enabled: - hex_common.read_idef_parser_enabled_file(sys.argv[5]) - hex_common.calculate_attribs() - hex_common.init_registers() + hex_common.read_common_files() tagregs =3D hex_common.get_tagregs() tagimms =3D hex_common.get_tagimms() =20 diff --git a/target/hexagon/gen_idef_parser_funcs.py b/target/hexagon/gen_i= def_parser_funcs.py index 550a48cb7b..eb494abba8 100644 --- a/target/hexagon/gen_idef_parser_funcs.py +++ b/target/hexagon/gen_idef_parser_funcs.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 =20 ## -## Copyright(c) 2019-2023 rev.ng Labs Srl. All Rights Reserved. +## Copyright(c) 2019-2024 rev.ng Labs Srl. All Rights Reserved. ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -44,13 +44,12 @@ ## def main(): hex_common.read_semantics_file(sys.argv[1]) - hex_common.read_attribs_file(sys.argv[2]) hex_common.calculate_attribs() hex_common.init_registers() tagregs =3D hex_common.get_tagregs() tagimms =3D hex_common.get_tagimms() =20 - with open(sys.argv[3], "w") as f: + with open(sys.argv[-1], "w") as f: f.write('#include "macros.inc"\n\n') =20 for tag in hex_common.tags: diff --git a/target/hexagon/gen_op_attribs.py b/target/hexagon/gen_op_attri= bs.py index 41074b8573..99448220da 100755 --- a/target/hexagon/gen_op_attribs.py +++ b/target/hexagon/gen_op_attribs.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 =20 ## -## Copyright(c) 2019-2023 Qualcomm Innovation Center, Inc. All Rights Res= erved. +## Copyright(c) 2019-2024 Qualcomm Innovation Center, Inc. All Rights Res= erved. ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -25,13 +25,12 @@ =20 def main(): hex_common.read_semantics_file(sys.argv[1]) - hex_common.read_attribs_file(sys.argv[2]) hex_common.calculate_attribs() =20 ## ## Generate all the attributes associated with each instruction ## - with open(sys.argv[3], "w") as f: + with open(sys.argv[-1], "w") as f: for tag in hex_common.tags: f.write( f"OP_ATTRIB({tag},ATTRIBS(" diff --git a/target/hexagon/gen_opcodes_def.py b/target/hexagon/gen_opcodes= _def.py index cddd868fe3..536f0eb68a 100755 --- a/target/hexagon/gen_opcodes_def.py +++ b/target/hexagon/gen_opcodes_def.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 =20 ## -## Copyright(c) 2019-2023 Qualcomm Innovation Center, Inc. All Rights Res= erved. +## Copyright(c) 2019-2024 Qualcomm Innovation Center, Inc. All Rights Res= erved. ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -29,7 +29,7 @@ def main(): ## ## Generate a list of all the opcodes ## - with open(sys.argv[3], "w") as f: + with open(sys.argv[-1], "w") as f: for tag in hex_common.tags: f.write(f"OPCODE({tag}),\n") =20 diff --git a/target/hexagon/gen_printinsn.py b/target/hexagon/gen_printinsn= .py index e570bd7c6a..8bf4d0985c 100755 --- a/target/hexagon/gen_printinsn.py +++ b/target/hexagon/gen_printinsn.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 =20 ## -## Copyright(c) 2019-2023 Qualcomm Innovation Center, Inc. All Rights Res= erved. +## Copyright(c) 2019-2024 Qualcomm Innovation Center, Inc. All Rights Res= erved. ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -97,11 +97,10 @@ def spacify(s): =20 def main(): hex_common.read_semantics_file(sys.argv[1]) - hex_common.read_attribs_file(sys.argv[2]) =20 immext_casere =3D re.compile(r"IMMEXT\(([A-Za-z])") =20 - with open(sys.argv[3], "w") as f: + with open(sys.argv[-1], "w") as f: for tag in hex_common.tags: if not hex_common.behdict[tag]: continue diff --git a/target/hexagon/gen_tcg_func_table.py b/target/hexagon/gen_tcg_= func_table.py index f998ef0992..978ac1819b 100755 --- a/target/hexagon/gen_tcg_func_table.py +++ b/target/hexagon/gen_tcg_func_table.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 =20 ## -## Copyright(c) 2019-2023 Qualcomm Innovation Center, Inc. All Rights Res= erved. +## Copyright(c) 2019-2024 Qualcomm Innovation Center, Inc. All Rights Res= erved. ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -25,12 +25,11 @@ =20 def main(): hex_common.read_semantics_file(sys.argv[1]) - hex_common.read_attribs_file(sys.argv[2]) hex_common.calculate_attribs() tagregs =3D hex_common.get_tagregs() tagimms =3D hex_common.get_tagimms() =20 - with open(sys.argv[3], "w") as f: + with open(sys.argv[-1], "w") as f: f.write("#ifndef HEXAGON_FUNC_TABLE_H\n") f.write("#define HEXAGON_FUNC_TABLE_H\n\n") =20 diff --git a/target/hexagon/gen_tcg_funcs.py b/target/hexagon/gen_tcg_funcs= .py index 3d8e3cb6a2..05aa0a7855 100755 --- a/target/hexagon/gen_tcg_funcs.py +++ b/target/hexagon/gen_tcg_funcs.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 =20 ## -## Copyright(c) 2019-2023 Qualcomm Innovation Center, Inc. All Rights Res= erved. +## Copyright(c) 2019-2024 Qualcomm Innovation Center, Inc. All Rights Res= erved. ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -108,24 +108,7 @@ def gen_def_tcg_func(f, tag, tagregs, tagimms): =20 =20 def main(): - hex_common.read_semantics_file(sys.argv[1]) - hex_common.read_attribs_file(sys.argv[2]) - hex_common.read_overrides_file(sys.argv[3]) - hex_common.read_overrides_file(sys.argv[4]) - hex_common.calculate_attribs() - hex_common.init_registers() - ## Whether or not idef-parser is enabled is - ## determined by the number of arguments to - ## this script: - ## - ## 5 args. -> not enabled, - ## 6 args. -> idef-parser enabled. - ## - ## The 6:th arg. then holds a list of the successfully - ## parsed instructions. - is_idef_parser_enabled =3D len(sys.argv) > 6 - if is_idef_parser_enabled: - hex_common.read_idef_parser_enabled_file(sys.argv[5]) + is_idef_parser_enabled =3D hex_common.read_common_files() 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 4bacef223f..43ca78b489 100755 --- a/target/hexagon/hex_common.py +++ b/target/hexagon/hex_common.py @@ -26,7 +26,6 @@ semdict =3D {} # tag -> semantics attribdict =3D {} # tag -> attributes macros =3D {} # macro -> macro information... -attribinfo =3D {} # Register information and misc registers =3D {} # register -> register functions new_registers =3D {} tags =3D [] # list of all tags @@ -257,19 +256,6 @@ def read_semantics_file(name): eval_line =3D "" =20 =20 -def read_attribs_file(name): - attribre =3D re.compile( - r"DEF_ATTRIB\(([A-Za-z0-9_]+), ([^,]*), " - + r'"([A-Za-z0-9_\.]*)", "([A-Za-z0-9_\.]*)"\)' - ) - for line in open(name, "rt").readlines(): - if not attribre.match(line): - continue - (attrib_base, descr, rreg, wreg) =3D attribre.findall(line)[0] - attrib_base =3D "A_" + attrib_base - attribinfo[attrib_base] =3D {"rreg": rreg, "wreg": wreg, "descr": = descr} - - def read_overrides_file(name): overridere =3D re.compile(r"#define fGEN_TCG_([A-Za-z0-9_]+)\(.*") for line in open(name, "rt").readlines(): @@ -1143,3 +1129,24 @@ def helper_args(tag, regs, imms): "uint32_t part1" )) return args + + +def read_common_files(): + read_semantics_file(sys.argv[1]) + read_overrides_file(sys.argv[2]) + read_overrides_file(sys.argv[3]) + ## Whether or not idef-parser is enabled is + ## determined by the number of arguments to + ## this script: + ## + ## 4 args. -> not enabled, + ## 5 args. -> idef-parser enabled. + ## + ## The 5:th arg. then holds a list of the successfully + ## parsed instructions. + is_idef_parser_enabled =3D len(sys.argv) > 5 + if is_idef_parser_enabled: + read_idef_parser_enabled_file(sys.argv[4]) + calculate_attribs() + init_registers() + return is_idef_parser_enabled diff --git a/target/hexagon/meson.build b/target/hexagon/meson.build index 988e7489ba..b0b253aa6b 100644 --- a/target/hexagon/meson.build +++ b/target/hexagon/meson.build @@ -18,7 +18,6 @@ hexagon_ss =3D ss.source_set() =20 hex_common_py =3D 'hex_common.py' -attribs_def =3D meson.current_source_dir() / 'attribs_def.h.inc' gen_tcg_h =3D meson.current_source_dir() / 'gen_tcg.h' gen_tcg_hvx_h =3D meson.current_source_dir() / 'gen_tcg_hvx.h' idef_parser_dir =3D meson.current_source_dir() / 'idef-parser' @@ -51,8 +50,8 @@ tcg_func_table_generated =3D custom_target( 'tcg_func_table_generated.c.inc', output: 'tcg_func_table_generated.c.inc', depends: [semantics_generated], - depend_files: [hex_common_py, attribs_def], - command: [python, files('gen_tcg_func_table.py'), semantics_generated,= attribs_def, '@OUTPUT@'], + depend_files: [hex_common_py], + command: [python, files('gen_tcg_func_table.py'), semantics_generated,= '@OUTPUT@'], ) hexagon_ss.add(tcg_func_table_generated) =20 @@ -60,8 +59,8 @@ printinsn_generated =3D custom_target( 'printinsn_generated.h.inc', output: 'printinsn_generated.h.inc', depends: [semantics_generated], - depend_files: [hex_common_py, attribs_def], - command: [python, files('gen_printinsn.py'), semantics_generated, attr= ibs_def, '@OUTPUT@'], + depend_files: [hex_common_py], + command: [python, files('gen_printinsn.py'), semantics_generated, '@OU= TPUT@'], ) hexagon_ss.add(printinsn_generated) =20 @@ -69,8 +68,8 @@ op_attribs_generated =3D custom_target( 'op_attribs_generated.h.inc', output: 'op_attribs_generated.h.inc', depends: [semantics_generated], - depend_files: [hex_common_py, attribs_def], - command: [python, files('gen_op_attribs.py'), semantics_generated, att= ribs_def, '@OUTPUT@'], + depend_files: [hex_common_py], + command: [python, files('gen_op_attribs.py'), semantics_generated, '@O= UTPUT@'], ) hexagon_ss.add(op_attribs_generated) =20 @@ -78,8 +77,8 @@ opcodes_def_generated =3D custom_target( 'opcodes_def_generated.h.inc', output: 'opcodes_def_generated.h.inc', depends: [semantics_generated], - depend_files: [hex_common_py, attribs_def], - command: [python, files('gen_opcodes_def.py'), semantics_generated, at= tribs_def, '@OUTPUT@'], + depend_files: [hex_common_py], + command: [python, files('gen_opcodes_def.py'), semantics_generated, '@= OUTPUT@'], ) hexagon_ss.add(opcodes_def_generated) =20 @@ -278,7 +277,7 @@ if idef_parser_enabled and 'hexagon-linux-user' in targ= et_dirs output: 'idef_parser_input.h.inc', depends: [semantics_generated], depend_files: [hex_common_py], - command: [python, files('gen_idef_parser_funcs.py'), semantics_gen= erated, attribs_def, '@OUTPUT@'], + command: [python, files('gen_idef_parser_funcs.py'), semantics_gen= erated, '@OUTPUT@'], ) =20 preprocessed_idef_parser_input_generated =3D custom_target( @@ -347,12 +346,12 @@ if idef_parser_enabled and 'hexagon-linux-user' in ta= rget_dirs # Setup input and dependencies for the next step, this depends on whet= her or # not idef-parser is enabled helper_dep =3D [semantics_generated, idef_generated_tcg_c, idef_genera= ted_tcg] - helper_in =3D [semantics_generated, attribs_def, gen_tcg_h, gen_tcg_hv= x_h, idef_generated_list] + helper_in =3D [semantics_generated, gen_tcg_h, gen_tcg_hvx_h, idef_gen= erated_list] else # Setup input and dependencies for the next step, this depends on whet= her or # not idef-parser is enabled helper_dep =3D [semantics_generated] - helper_in =3D [semantics_generated, attribs_def, gen_tcg_h, gen_tcg_hv= x_h] + helper_in =3D [semantics_generated, gen_tcg_h, gen_tcg_hvx_h] endif =20 # @@ -366,7 +365,7 @@ helper_protos_generated =3D custom_target( 'helper_protos_generated.h.inc', output: 'helper_protos_generated.h.inc', depends: helper_dep, - depend_files: [hex_common_py, attribs_def, gen_tcg_h, gen_tcg_hvx_h], + depend_files: [hex_common_py, gen_tcg_h, gen_tcg_hvx_h], command: [python, files('gen_helper_protos.py'), helper_in, '@OUTPUT@'= ], ) hexagon_ss.add(helper_protos_generated) @@ -375,7 +374,7 @@ helper_funcs_generated =3D custom_target( 'helper_funcs_generated.c.inc', output: 'helper_funcs_generated.c.inc', depends: helper_dep, - depend_files: [hex_common_py, attribs_def, gen_tcg_h, gen_tcg_hvx_h], + depend_files: [hex_common_py, gen_tcg_h, gen_tcg_hvx_h], command: [python, files('gen_helper_funcs.py'), helper_in, '@OUTPUT@'], ) hexagon_ss.add(helper_funcs_generated) @@ -384,7 +383,7 @@ tcg_funcs_generated =3D custom_target( 'tcg_funcs_generated.c.inc', output: 'tcg_funcs_generated.c.inc', depends: helper_dep, - depend_files: [hex_common_py, attribs_def, gen_tcg_h, gen_tcg_hvx_h], + depend_files: [hex_common_py, gen_tcg_h, gen_tcg_hvx_h], command: [python, files('gen_tcg_funcs.py'), helper_in, '@OUTPUT@'], ) hexagon_ss.add(tcg_funcs_generated) @@ -393,7 +392,7 @@ analyze_funcs_generated =3D custom_target( 'analyze_funcs_generated.c.inc', output: 'analyze_funcs_generated.c.inc', depends: helper_dep, - depend_files: [hex_common_py, attribs_def, gen_tcg_h, gen_tcg_hvx_h], + depend_files: [hex_common_py, gen_tcg_h, gen_tcg_hvx_h], command: [python, files('gen_analyze_funcs.py'), helper_in, '@OUTPUT@'= ], ) hexagon_ss.add(analyze_funcs_generated) --=20 2.34.1