From nobody Tue Nov 26 06:55:18 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=1708978721; cv=none; d=zohomail.com; s=zohoarc; b=ivGlSMhNMzP1Gv+APA4w89aJfXoioigSsl63ZA5P7V7GMAb6EHMyWIrnEK5s4vweKCNbHGO+H60uqJaQaabsLGqvC69igi0tspeMGpXkLf5U76/eAhjGB9SNmI6fTBNw2tDFwQtcwkbeIe2KY8is091cQ8wZHR6WXvXLai6RTVw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708978721; 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=CRjb46WdqEPMqkZSAvVdtRTJCtj+kvcnkZkQaWAfooI=; b=A0FDLG5687++8JA4lssEj5ElbwYmbKozAsl1S+2xuUIsreRdc+E9ueTSw87aQZSciYPwOwDGv5ia2ZIZUnHC7JgiWRIym7zMH6JkBIhvkpyWzMfh16a2Z6osDiOgVXvfGd3/wHjpn2JJoEyR+dbhb/haZtqggm9DkQp6cKnXeSk= 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 1708978720920387.0534438458718; Mon, 26 Feb 2024 12:18:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rehPr-0001cX-P4; Mon, 26 Feb 2024 15:17:35 -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 1rehPp-0001bT-Mg for qemu-devel@nongnu.org; Mon, 26 Feb 2024 15:17:33 -0500 Received: from mail-oi1-x22a.google.com ([2607:f8b0:4864:20::22a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rehPm-0007zH-IF for qemu-devel@nongnu.org; Mon, 26 Feb 2024 15:17:33 -0500 Received: by mail-oi1-x22a.google.com with SMTP id 5614622812f47-3c1a172e158so250906b6e.0 for ; Mon, 26 Feb 2024 12:17:28 -0800 (PST) Received: from taylor-ubuntu.austin.rr.com (068-203-008-061.res.spectrum.com. [68.203.8.61]) by smtp.gmail.com with ESMTPSA id by11-20020a056808340b00b003c1a4a9ad17sm330594oib.46.2024.02.26.12.17.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 12:17:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708978647; x=1709583447; 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=CRjb46WdqEPMqkZSAvVdtRTJCtj+kvcnkZkQaWAfooI=; b=D2OvewPWCe+Rb9nKXFr2V75ffzC0apR0vheuwh0WQhdTktfMMQOiYt5F4A9gR9aTMF dm5a58uwg/Jz6V3G49/AoVfDNHTK9MDYzOh5dDngLmm0LwZq2ctuMIhyrIgs5aPA+jGd bDZRQp/EN5LlzRLhIQIgDAxPqhZYh405lVThRtM5Tfoywm2LN+ftoerPGoJusXHw6YaG wuwlLjgI6p9rP5nDOYpi+yBkaZz4sWeysmnwoIzBXjPsuO9xCEmXOJJfK1YJxYYEC6zl ZnsZ1ilDcONNx6CFcJpDht2RdDG6V2JuDtjWlUD2TuTfDomtxLGaVgtwrXiRh1VMRE+P CBbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708978647; x=1709583447; 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=CRjb46WdqEPMqkZSAvVdtRTJCtj+kvcnkZkQaWAfooI=; b=TtiPDvWvHiISQ+VxfO1Kh37/hv3PISzjJwkMyHL9w8niGBGhFlhzyp+ULvF28nndw9 KlbxJSAiXUn/Un/gqHCIMONclmVpgTS++LJsUOWbwz2OQ9nsab13zj/OcM93ZiKS3Kh8 C4bW/9PWbiu3EbHrWG5/1/9KXacSAJoAB4JNtz/ivnHumiulAISY8KN3YxIN2UIIRs3c 5cNSgrsZ3++Me8pw0PNCDZWvU0ajd64WBMHwrIwnPC46lo88fHOFmXmOyRdQePYPCZgD 9CjymPTuX12IJ+l7R3FqfvWVljlh5ShUERI3ZG5Yy3b2ZWR3jkn/+AE0+gX7kDUW9FWZ /Hww== X-Gm-Message-State: AOJu0YyIUVw6JQ4Rd3OjTUMjq2FEyAuPsG4bv1jHDWIz2RXTE2a9IgaV cz4+ACkWbyKEr0hS+e/5w8/uNym1OoW6tTiczUgKA6bctu/uniJKPV7CZXL/70Q= X-Google-Smtp-Source: AGHT+IEiY2QoZhU/f1IY5AVw5xH2J8iMPXwY4ylnxBnPExap4nLqI8CQnThVm2npQTws8Sb9L+rlfA== X-Received: by 2002:a05:6808:14c7:b0:3c1:7ebb:e24f with SMTP id f7-20020a05680814c700b003c17ebbe24fmr98056oiw.16.1708978646972; Mon, 26 Feb 2024 12:17:26 -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 1/9] Hexagon (target/hexagon) Add is_old/is_new to Register class Date: Mon, 26 Feb 2024 13:17:14 -0700 Message-Id: <20240226201722.391879-2-ltaylorsimpson@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240226201722.391879-1-ltaylorsimpson@gmail.com> References: <20240226201722.391879-1-ltaylorsimpson@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::22a; envelope-from=ltaylorsimpson@gmail.com; helo=mail-oi1-x22a.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: 1708978723358100006 Signed-off-by: Taylor Simpson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- 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 Tue Nov 26 06:55:18 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=1708978698; cv=none; d=zohomail.com; s=zohoarc; b=OzH2YfKMLr+DI3ZQnW/H6s17JFVdQmRlhQ9hHjUdl/j1698vZ/0exInA+th/Ac1EHfJYE5Dk0YUzyQbcAJrgXYpj4PB9vBYBaB65VVx0dWA12G1Fu2mV4C+3z21Ky/g7pURhc1IGofJ9lee4+/s24wU0Flh+oM4utVhJV3zL+50= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708978698; 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=34hyOq9fT2wY/9uJL975rSySKZ4ZdVHzRHf6WhirkXw=; b=cksGwHJ3eVEjRAsbWLgThdAJpNeyICK+RKl9y58T6XLty0pzFLYCoptiDfkdabVzi9KHx0H6XG9AV6yiju111nTuwy6Z7yp3PLU20odq3tYog44jwjWBpX1pFZ76OBn8g3b4pSBYXdx6wzdcRVHhe7T5r0x5C1r7utaDn30MFxU= 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 170897869876482.16862545508548; Mon, 26 Feb 2024 12:18:18 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rehPq-0001bt-Jd; Mon, 26 Feb 2024 15:17:34 -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 1rehPo-0001bE-Vw for qemu-devel@nongnu.org; Mon, 26 Feb 2024 15:17:33 -0500 Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rehPn-0007zS-2X for qemu-devel@nongnu.org; Mon, 26 Feb 2024 15:17:32 -0500 Received: by mail-oi1-x230.google.com with SMTP id 5614622812f47-3bbbc6bcc78so2686305b6e.1 for ; Mon, 26 Feb 2024 12:17:30 -0800 (PST) Received: from taylor-ubuntu.austin.rr.com (068-203-008-061.res.spectrum.com. [68.203.8.61]) by smtp.gmail.com with ESMTPSA id by11-20020a056808340b00b003c1a4a9ad17sm330594oib.46.2024.02.26.12.17.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 12:17:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708978648; x=1709583448; 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=34hyOq9fT2wY/9uJL975rSySKZ4ZdVHzRHf6WhirkXw=; b=CYbgfOBa374bDvWsey0snO37YHu/6zF5sC2oeVjXU+G/McgbCueSFd7g73DxBQqR94 UI9Wkk+3tfE2g9vdR96nW6a4nXSMdcZwswTpzQ8JylO6i8Oa0Erdf+gzuG1s4rKwo4ab TBpqXrrNeKFKGBamVR15oZkV6bQryQomnl0xWPCZd3jUpEKG5wVVDjfCp42P8JPGbvMc nGpD4N2JKPqSgeoopwbU8Z4/gmRdGjeTb9GFD5UKLOiZwgLiFYCKXSW+ClcryL8kjADI 8j88n3JGJndH/inHk1+cdzwHxlRO9yb10RgsYZqBvHdNnXHnjrqxWQbBXraXxQNo1D6i 6d2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708978648; x=1709583448; 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=34hyOq9fT2wY/9uJL975rSySKZ4ZdVHzRHf6WhirkXw=; b=OKlfnp4yOGxivsWHz7/D67ppJQUWXWCDRJhE5WIpL+QnZltqJHLaFAV+ZwCmyXwEIj 3drtPSMbCvgV6ILZ41+wOkYhWpm2BfR7ocdWpcuMvJnJC2gUQi4hnUtSEbB4IDnXDVQv qa8QDjMFvjYTXQlHGeTVHeqqZw+tZa6u9wspCsY8+laj2R4SEPNY29U7+0l+1wJ7dYAQ qZ52cZf8q3oXw4CnOBN8PiTNZysZw1iDFa7TmXITs7NFQ0fraNioWrOkpk2O4XBD/6Pc //bLYhIc3t6+BcaE4/bZqdbh8WcQ5Y1MwiGkcWW5ZyxvuVyi7wQK/Qzf4muq5BsgeZnB SGFw== X-Gm-Message-State: AOJu0Yw/kF/+8H9a/emgipfI8EADYg06cC7n/yhXKt9aB8AllM5dDEZt czEURhbq0Pljt8ri5SZ6EvJOWdG3a+5a5/ZSzvvlBQyoMXSdRX5X3bfnI41Rq5c= X-Google-Smtp-Source: AGHT+IFMnfcuz/BXJtpbev/b7IA7y65QBd6hv40SImK1PfsehBx87OTUNsQ85p/oxW3H9HrvbTYHhQ== X-Received: by 2002:a05:6808:11c1:b0:3c1:78b0:9ce1 with SMTP id p1-20020a05680811c100b003c178b09ce1mr264941oiv.13.1708978648442; Mon, 26 Feb 2024 12:17:28 -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 2/9] Hexagon (target/hexagon) Mark new_read_idx in trans functions Date: Mon, 26 Feb 2024 13:17:15 -0700 Message-Id: <20240226201722.391879-3-ltaylorsimpson@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240226201722.391879-1-ltaylorsimpson@gmail.com> References: <20240226201722.391879-1-ltaylorsimpson@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::230; envelope-from=ltaylorsimpson@gmail.com; helo=mail-oi1-x230.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: 1708978699517100001 Check that the value matches opcode_reginfo Signed-off-by: Taylor Simpson --- 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..79475b2946 100755 --- a/target/hexagon/gen_trans_funcs.py +++ b/target/hexagon/gen_trans_funcs.py @@ -84,14 +84,15 @@ 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, regstruct in enumerate(regs): + reg_type, reg_id, _, _ =3D regstruct + 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 Tue Nov 26 06:55:18 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=1708978721; cv=none; d=zohomail.com; s=zohoarc; b=PhxwrlYQm6Gg/9jNq1aiLCQl1hS+Ou0ZKE79gTh5Q9GXoNuxe/Ld9dDKTQQ6uCc24rkzj61zo7PdQLRotF9IqGGq3v8lD3u2u6FeQnyGMtjvSq2vLg+ImCmopsNmaHv84qN54p7RS2B3uGJwCxEAL6GMEsOagfHXj2yP+GSNh+Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708978721; 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=IKDpTWyScsaSBI11X+2N+qTatk0v8tuwGtm68rKYDSc=; b=ZungxbI1UJJZpIAA4tWGHMQMQW2zMdFKul//wXr6aa3QGnHnmTrKYtIib9kaEwnaoY9QAjdR58Gvgi1eUlLrBI8daJerxT7Tb8HWWr6FjVxcJs7BPmeq/5NdoNGxZyDXiYFR00zn+hO0FLWBM5tkupw1QU+yp+oPTDqlnA24o+c= 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 1708978720973778.6223627605885; Mon, 26 Feb 2024 12:18:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rehPr-0001cL-7X; Mon, 26 Feb 2024 15:17:35 -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 1rehPp-0001bb-T0 for qemu-devel@nongnu.org; Mon, 26 Feb 2024 15:17:33 -0500 Received: from mail-oi1-x236.google.com ([2607:f8b0:4864:20::236]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rehPo-0007zh-6T for qemu-devel@nongnu.org; Mon, 26 Feb 2024 15:17:33 -0500 Received: by mail-oi1-x236.google.com with SMTP id 5614622812f47-3bb9b28acb4so2482055b6e.2 for ; Mon, 26 Feb 2024 12:17:31 -0800 (PST) Received: from taylor-ubuntu.austin.rr.com (068-203-008-061.res.spectrum.com. [68.203.8.61]) by smtp.gmail.com with ESMTPSA id by11-20020a056808340b00b003c1a4a9ad17sm330594oib.46.2024.02.26.12.17.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 12:17:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708978650; x=1709583450; 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=IKDpTWyScsaSBI11X+2N+qTatk0v8tuwGtm68rKYDSc=; b=fDJfjxdsXXog2SQOST/zChPImlnccMqkCvbsgoADahMjLbI5IK8IUEouIAKSu2gZkU 8A/M4J2vc2b5Z0IVbDl9Na4R3UnD57a1Dya85lfspHsu8bgcRtumyBPzJ041FveCvY/l GSYH1RFYR01CREK9H+QMiqE07KhLdSgLItLV6ZfbQWhNuIp3SMxXrfFakWlmBYz1VwVY Q14rxF2nOsiv81c+1vbx3qJ/51DoPocMCtc56YPFi31rQlxHwz88vvznPAVzzmBFragZ CTQ9RJYYMh1JtQj4aY039qQdIn1m3x/xbtEKQkj/bwQdaWIpRjyX6K0iuA1HDyGTWZVr XELQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708978650; x=1709583450; 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=IKDpTWyScsaSBI11X+2N+qTatk0v8tuwGtm68rKYDSc=; b=qqPazthVnoePMORDXQpIBXs2jbnaCUuG7xQMxrizihqD1ONAd7sB7JCEAO5fq8Asao NxWpK9mN8yBRMjWlD9c4tGg4yRAaAvKR8cECqV9ACf52n0vdpAtXPGs0wRn0+z7N/Yco OKdzJX3a4zptyQJzCtBB1pU6W17eLwlF3CvwCvzCQq7RD4zcQ6rTYGqzMgnv5mblUqMm q+GrhR293pQSMHJb9uZ/i5PJwus6L+sijN1/x14s/DEFn4xW5bN5CK60/5txJB/o/2Jp zilZcpzhzma6n3wvDUO4hLRxF2oYJA4EKAgj0Zmxjuc8aK6dzZX6EgvFhXY64xC7uJ5U MpxA== X-Gm-Message-State: AOJu0YwtDZ3O9PliGnFKyswPNrpTdjaLzThePxRM2AsK4CHFS/FQKblL rYQheLtdVCtnceeg1+8ZMKWoiPHQEsaHTsEJruSGZ/cSrLHi8lJQGZ3WxxyezSM= X-Google-Smtp-Source: AGHT+IEVH0ezXJDe2WjAD+U30CNhVeDx+5TgV1dWJQd9Q0jS57IeWHDd107TwZPYXhyCQ6kAoTrjsw== X-Received: by 2002:a05:6808:1286:b0:3c0:3e27:b122 with SMTP id a6-20020a056808128600b003c03e27b122mr184923oiw.39.1708978650061; Mon, 26 Feb 2024 12:17:30 -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 3/9] Hexagon (target/hexagon) Mark dest_idx in trans functions Date: Mon, 26 Feb 2024 13:17:16 -0700 Message-Id: <20240226201722.391879-4-ltaylorsimpson@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240226201722.391879-1-ltaylorsimpson@gmail.com> References: <20240226201722.391879-1-ltaylorsimpson@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::236; envelope-from=ltaylorsimpson@gmail.com; helo=mail-oi1-x236.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: 1708978723354100005 Check that the value matches opcode_reginfo/opcode_wregs Signed-off-by: Taylor Simpson --- target/hexagon/insn.h | 1 + target/hexagon/decode.c | 2 ++ target/hexagon/mmvec/decode_ext_mmvec.c | 2 ++ target/hexagon/gen_trans_funcs.py | 4 ++++ 4 files changed, 9 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 79475b2946..07292e0170 100755 --- a/target/hexagon/gen_trans_funcs.py +++ b/target/hexagon/gen_trans_funcs.py @@ -85,6 +85,7 @@ def gen_trans_funcs(f): """)) =20 new_read_idx =3D -1 + dest_idx =3D -1 for regno, regstruct in enumerate(regs): reg_type, reg_id, _, _ =3D regstruct reg =3D hex_common.get_register(tag, reg_type, reg_id) @@ -93,6 +94,8 @@ def gen_trans_funcs(f): """)) if reg.is_read() and reg.is_new(): new_read_idx =3D regno + 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 +118,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 Tue Nov 26 06:55:18 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=1708978737; cv=none; d=zohomail.com; s=zohoarc; b=jChAALVWEQVSHDRI5qChbtowGVoXsaXCso2gxLMgRlpe4dCp7SEZ6GRNXSv1gJLOJJ4NVv/KjegcdsjiGMCUuO+oTG9vbSh0AR7qj8LA6GzQ3IZacR3fHYdsSdUp5e4ucIB/VAmoL4jucuCANWXXzdBs8Voo5CCiRWCvhcaG+Iw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708978737; 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=yMW6AxjBVDIdk1/2CbavQRJvPc+W233QtqwWnqwEGOg=; b=Cpe/vkkfGdivetkkFrNVu2Y65SmPSAiGTyiW/l6ABW2VWQpYS20lTKFCGtEjoXTRm44RNqh6Ua9H/fgvRUcSHhQ1zlQqdoW6O34KoC46BtSXM6NLO9ZDA7l3sL/aJHlUGtEk+hwdsJgI2Yz5gOULuBbTzRVABN7WPwzl0+2coiE= 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 1708978737439527.7902635773172; Mon, 26 Feb 2024 12:18:57 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rehPr-0001cd-Pj; Mon, 26 Feb 2024 15:17:35 -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 1rehPq-0001c7-OI for qemu-devel@nongnu.org; Mon, 26 Feb 2024 15:17:34 -0500 Received: from mail-oi1-x229.google.com ([2607:f8b0:4864:20::229]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rehPp-000803-6F for qemu-devel@nongnu.org; Mon, 26 Feb 2024 15:17:34 -0500 Received: by mail-oi1-x229.google.com with SMTP id 5614622812f47-3bb9b28acb4so2482073b6e.2 for ; Mon, 26 Feb 2024 12:17:32 -0800 (PST) Received: from taylor-ubuntu.austin.rr.com (068-203-008-061.res.spectrum.com. [68.203.8.61]) by smtp.gmail.com with ESMTPSA id by11-20020a056808340b00b003c1a4a9ad17sm330594oib.46.2024.02.26.12.17.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 12:17:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708978651; x=1709583451; 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=yMW6AxjBVDIdk1/2CbavQRJvPc+W233QtqwWnqwEGOg=; b=Q+GPhQXabJHbTeYOOvQ6og0ZmVRWMYJiKpmzEoRMEoyYHNPzXaN9UjaQ0dtGb6ZdPE dNtn78X+t7SlpdKyvZCA8Lms/s5/9pZ7c3UzlUAqWjkWEbOndOgMoIWoMcuRWHQ1kMuH LZSQ5ORm0K9WK/r75rc2Q+JHNZbsJhZNlV9exhSydZR9swKmJwX/EjXKx3xaPdIrstju J4xchHopFKfwlwWvSW/rCKA/TeuIEuhq2LIZh7Qsm3jrVSsAGwkIOXd0rEXp+wCSLwzs +xs9A3NNdmuoZUA2AssG8h5rTAW+C1p1Q1Bh9/in/535L8nwUtEPQsVacRb/mWTOt2h9 VV6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708978651; x=1709583451; 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=yMW6AxjBVDIdk1/2CbavQRJvPc+W233QtqwWnqwEGOg=; b=I8za7lbo7B/Nf2spn1iTRB8U0pTgIzZTrPlldE0fZ/+lEpkh6irprh1rRtVRy+lw+S rq56qVar/5SqBeZ/P6PBkisYstr1BLZBgX1PhT8EciYtZdOtLC5sOrrkyEvJewuEzgAt Us75m94YGCFLYPiJjgrik9xs+KNtbMioRx5qlaB1Dp4K0kwSrk3ThIZMDXofwdZtdcu5 2+N0pzf99O69Y3gnJXZtQxqEU5MBrToA4dsHuyoGnkptoSLTl2dQ7Oahbxt/NIwC2fCB fYdqTIeQrOng3ThjRPBiNBi8+TvOgGjvWucLTywMALzFSvW8pTDa7uBjINt/xRsarWDD QDSw== X-Gm-Message-State: AOJu0YzbejoLXl4pdOs5d51pV7BwyolnQf40HQ6IPW+WI7E2Bk7WFqWX WtOBD04v9ui/kmxhuWI0rGT5lu/ZxzOH4PFINLkbCjfH4BkbQtskWHG6Iz7DsR4= X-Google-Smtp-Source: AGHT+IFVNxavW8N79nMnwL4jbkbBBZwkCjd/ENpRKu/qPCb6zKA1BLcU061IcUoOJMMb6FSXD0QmdQ== X-Received: by 2002:a05:6808:2189:b0:3bf:fdb2:ca5b with SMTP id be9-20020a056808218900b003bffdb2ca5bmr222894oib.3.1708978651490; Mon, 26 Feb 2024 12:17: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 4/9] Hexagon (target/hexagon) Mark has_pred_dest in trans functions Date: Mon, 26 Feb 2024 13:17:17 -0700 Message-Id: <20240226201722.391879-5-ltaylorsimpson@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240226201722.391879-1-ltaylorsimpson@gmail.com> References: <20240226201722.391879-1-ltaylorsimpson@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::229; envelope-from=ltaylorsimpson@gmail.com; helo=mail-oi1-x229.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: 1708978739401100003 Check that the value matches opcode_wregs Signed-off-by: Taylor Simpson --- target/hexagon/insn.h | 1 + target/hexagon/decode.c | 3 +++ target/hexagon/gen_trans_funcs.py | 4 ++++ 3 files changed, 8 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 07292e0170..f1972fd2dd 100755 --- a/target/hexagon/gen_trans_funcs.py +++ b/target/hexagon/gen_trans_funcs.py @@ -86,6 +86,7 @@ def gen_trans_funcs(f): =20 new_read_idx =3D -1 dest_idx =3D -1 + has_pred_dest =3D "false" for regno, regstruct in enumerate(regs): reg_type, reg_id, _, _ =3D regstruct reg =3D hex_common.get_register(tag, reg_type, reg_id) @@ -96,6 +97,8 @@ def gen_trans_funcs(f): new_read_idx =3D regno if reg.is_written() and dest_idx =3D=3D -1: dest_idx =3D regno + if reg_type =3D=3D "P" and not reg.is_read(): + has_pred_dest =3D "true" =20 if len(imms) !=3D 0: mark_which_imm_extended(f, tag) @@ -119,6 +122,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 Tue Nov 26 06:55:18 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1708978702; cv=none; d=zohomail.com; s=zohoarc; b=MbeWKKn2Bczl7dCizMt7rS5r7UKllC4OZ+RIDXvhqO975I7jYUhn77V0GZpDJnV5C7V8huxZkaBtUDQ/s5VBYoD5rNzyA+hmM1uFAD7srD1sMWrOrG+l22ktHZd5Yw/6LTOVhad/MRjgxBbPc3KDzuK1a1DYe+ch2TdtexpVmA8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708978702; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=G8J7F2iE5kae+EJMR1Fj9GxIukzXTHmw7zGOIwbFMQA=; b=bJC9tCxrcrMHXRh7DfLt6DXueD3s3DDF4Vx4LGuvXb8po6/5+N6dgGnanHdKHq345BorBfQuDPusSp6YWf32hMBErF0eTgXMkf2h0nlm97RSzLNneY5cTqjaIVvKZcgYsiqoQuBX5g2EQVmhTSoa//s4y/ibOb0fthDsrXILSd4= 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 1708978702682476.7236673121797; Mon, 26 Feb 2024 12:18:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rehPu-0001dm-W0; Mon, 26 Feb 2024 15:17: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 1rehPs-0001dK-KY for qemu-devel@nongnu.org; Mon, 26 Feb 2024 15:17:36 -0500 Received: from mail-oi1-x22b.google.com ([2607:f8b0:4864:20::22b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rehPr-00080T-34 for qemu-devel@nongnu.org; Mon, 26 Feb 2024 15:17:36 -0500 Received: by mail-oi1-x22b.google.com with SMTP id 5614622812f47-3bb9d54575cso2843902b6e.2 for ; Mon, 26 Feb 2024 12:17:34 -0800 (PST) Received: from taylor-ubuntu.austin.rr.com (068-203-008-061.res.spectrum.com. [68.203.8.61]) by smtp.gmail.com with ESMTPSA id by11-20020a056808340b00b003c1a4a9ad17sm330594oib.46.2024.02.26.12.17.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 12:17:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708978653; x=1709583453; 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=BE8twdb330PofWpkkN7hEK/zvyaZBgFRcswu9WsSXDR3J9zzF+DaHKruUAiQtTq/bY YkVVaWp5RpQU0OPdmdTMUzNqScyHEb0eLNnSdxe/xm7eOicrSfx9oSwP6IuTuyKD1GGW 5QXgPtdBe0xd9bYQKfkKEXX9m1MAxHnw/h2WGMehyEHARYKlxqVbOBEDc3E4CPpkX+hy z31RPtQ8ZGxENIP8qfwbkTBx71214ydmHg8N95OBUHiKuEXkwgawsSLl3TnCVhNlAY74 AB4eo9FJ5Gi586QC7jBWdq3vxn7Uw0ila+0FmTTVwgX8JO4E2f1gQ2+7aRNKtMMV7H6R kmKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708978653; x=1709583453; 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=AO3TZKz5MXwRpXA12wngs1I6JOd7dS/rhp+wXTpjeoPBxAMc3MN/wC8IKi7Wt6yuej O4aIrLSy2wofpvqwWsEx+ZoBecCg8wfelvdiwAZ3Gk3hFDN4+tz9DwE18ZzKju3+F39H IP/SkjcR5BZsWHXrGq6ZVOksVTqN09/BBcS88WyisfRvQ3mMfl3ngmrpbyLBWvYoji5R kPQJMOXKUjxw86mIUEJoeuK9URlECBVgGy21e05K/7ZjSue7echt3731fkSNEtzxTqfW 5GB5IM5dQ3XLvMA7YUuSWgMbs+mBpyVZsw/1JZuiRxYjkIUBl4PEeiVLRhgjrEecmS76 ZHQA== X-Gm-Message-State: AOJu0YxLpvwqRFbUEiiakfjN/P5yRQFS0bRAsNVgMUO37+8z/Z75YyWf fsCwb9qQwY0qdvZQUcNfOiwgnG7g1k4Vx6YUxHGqf1WsvrYvL1BjZ2NKoVHRO+E= X-Google-Smtp-Source: AGHT+IEF+Gf5eHD4D9fvOwUflsXd+8nXtTRdx8mW78HPwg4g0NWFhwKusFrCTpriaLNL/8rqcJIscg== X-Received: by 2002:a05:6808:17a6:b0:3c1:9b7b:5836 with SMTP id bg38-20020a05680817a600b003c19b7b5836mr256826oib.12.1708978652743; Mon, 26 Feb 2024 12:17: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 5/9] Hexagon (tests/tcg/hexagon) Test HVX .new read from high half of pair Date: Mon, 26 Feb 2024 13:17:18 -0700 Message-Id: <20240226201722.391879-6-ltaylorsimpson@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240226201722.391879-1-ltaylorsimpson@gmail.com> References: <20240226201722.391879-1-ltaylorsimpson@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::22b; envelope-from=ltaylorsimpson@gmail.com; helo=mail-oi1-x22b.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: 1708978703332100001 Make sure the decoding of HVX .new is correctly handling this case Signed-off-by: Taylor Simpson --- 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 Tue Nov 26 06:55:18 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1708978702; cv=none; d=zohomail.com; s=zohoarc; b=cERG0VQN5tqzKE1tMC8J/5n1ZqzJaLC7mvF/4WzatC28aeapaWnvZ/Exaj+wMXZkP1CwQ/muFtw8tcHFZqlwfHxy0ZSimsT0wq4xSOzXJJNKUphE9yttXIJoXOtizoKCNUqB5QPZLTVXgDo7ArgOaxHnioDDNkc8vwHAYrKgHyo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708978702; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=U46l8139A+4KRjWcCLYKQaeKeiOnLqLqKh4dYSCOgv0=; b=eSGFprQUzNW9lrRm1od3j6PSI1IaRqrguNivVq5VGGxIZkVRCKdusrUHuuW/Dfd0dbPLkSB9TaI4RVlQf+eEdg0Sqa5pZkLQMo7ItmBxjagCILtWZ6Q24SLUerQDUXXQNOqzLgV9XyS0ohZqormT7ed1xZ19Fd3piWOug24QWkQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1708978702962740.9087748173527; Mon, 26 Feb 2024 12:18:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rehPw-0001el-S7; Mon, 26 Feb 2024 15:17:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rehPv-0001e0-7U for qemu-devel@nongnu.org; Mon, 26 Feb 2024 15:17:39 -0500 Received: from mail-oi1-x231.google.com ([2607:f8b0:4864:20::231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rehPs-00080f-9Y for qemu-devel@nongnu.org; Mon, 26 Feb 2024 15:17:37 -0500 Received: by mail-oi1-x231.google.com with SMTP id 5614622812f47-3c132695f1bso2211438b6e.2 for ; Mon, 26 Feb 2024 12:17:35 -0800 (PST) Received: from taylor-ubuntu.austin.rr.com (068-203-008-061.res.spectrum.com. [68.203.8.61]) by smtp.gmail.com with ESMTPSA id by11-20020a056808340b00b003c1a4a9ad17sm330594oib.46.2024.02.26.12.17.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 12:17:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708978654; x=1709583454; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=U46l8139A+4KRjWcCLYKQaeKeiOnLqLqKh4dYSCOgv0=; b=QJkde2e+YrDypsguCqjVwZqwamLyyFadwtPNNssHLgfMtB11ZBaTYzAsR0T8cEISZ7 9K8+nZFFzAMGWlymz9oxAWnzsszo0NEsuzj/uK+blTZCTiMcCpfYminyz6YQ2OT4ZWb2 rSygvpsSgYKsQlzPPN4T0N8oXMXiVMqQjnXGO7OCrp/Ty5S5ZKGiAtbuZq003xwnISKF LhXlGnGKQV1pA69MfxkIbB6ecR7lr82sMQIegM7Q7z9jBenNA0nn+793mRX5nZL4PrjN gODYQJVA9wEjpbOWNTCJpLdroZo0cyYqaVddEKaXJSNCFjQdiESJfXj/oD8a9QGyz1SB wjog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708978654; x=1709583454; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=U46l8139A+4KRjWcCLYKQaeKeiOnLqLqKh4dYSCOgv0=; b=deJS/SkrWJSyu/6yMgMGn+VrCfIXI2XOlg8Spkedem3f8KyhrGCafEWdPMm95imKjD Z+Ok+1YSbgUrANxkA2/L4nifVYQahxzC5MC5nkQLdU0tAGxg3/27LU54H61yrLPoQ+JO yqaFGFxBIexKnNbJ+pCU5LVT2IojxlOaSewOhIXnoJ5RGkL3E9LqWq0eNn6QMkUhN2ko kpw+Bn4OC81yigov/Zcqw0Nl7U91DXrnTlLQhxYU5otBQ73NwKu23JOZZX1z/nX0dQXl FYseaUOyvNLcxuJHkjb2eT8VjVxzr5+e5ro+179XZYetC3uAl0yviu8vL8YEIt8SuIut JD+w== X-Gm-Message-State: AOJu0YyAbNb5U2J6EWORNKeilEbNg8ofXcLyp4bDrJB9tFtgJ5yRUp5I fI2Ue5XT/ufE6CXUc2g17e0qtLq9g3qz/qkb1bKiR6VfrE7h/4bX9dvesof+A8k= X-Google-Smtp-Source: AGHT+IHt+qhzIoEYfFd+/u+8C5uGLpYDaMJGcX8nXgMeK+xSBcUJqm3UIGI8apQzt3BmtClFw1zQMw== X-Received: by 2002:a05:6808:130f:b0:3c1:81ad:f45f with SMTP id y15-20020a056808130f00b003c181adf45fmr210492oiv.28.1708978654268; Mon, 26 Feb 2024 12:17:34 -0800 (PST) From: Taylor Simpson To: qemu-devel@nongnu.org Cc: bcain@quicinc.com, quic_mathbern@quicinc.com, sidneym@quicinc.com, quic_mliebel@quicinc.com, richard.henderson@linaro.org, philmd@linaro.org, ale@rev.ng, anjo@rev.ng, ltaylorsimpson@gmail.com Subject: [PATCH 6/9] Hexagon (target/hexagon) Remove uses of op_regs_generated.h.inc Date: Mon, 26 Feb 2024 13:17:19 -0700 Message-Id: <20240226201722.391879-7-ltaylorsimpson@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240226201722.391879-1-ltaylorsimpson@gmail.com> References: <20240226201722.391879-1-ltaylorsimpson@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::231; envelope-from=ltaylorsimpson@gmail.com; helo=mail-oi1-x231.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1708978703362100003 Signed-off-by: Taylor Simpson --- target/hexagon/opcodes.h | 4 -- target/hexagon/decode.c | 57 +++---------------------- target/hexagon/mmvec/decode_ext_mmvec.c | 34 +++------------ target/hexagon/opcodes.c | 28 ------------ 4 files changed, 13 insertions(+), 110 deletions(-) diff --git a/target/hexagon/opcodes.h b/target/hexagon/opcodes.h index fa7e321950..0ee11bd445 100644 --- a/target/hexagon/opcodes.h +++ b/target/hexagon/opcodes.h @@ -40,10 +40,6 @@ typedef enum { =20 extern const char * const opcode_names[]; =20 -extern const char * const opcode_reginfo[]; -extern const char * const opcode_rregs[]; -extern const char * const opcode_wregs[]; - typedef struct { const char * const encoding; const EncClass enc_class; diff --git a/target/hexagon/decode.c b/target/hexagon/decode.c index 84a3899556..23deba2426 100644 --- a/target/hexagon/decode.c +++ b/target/hexagon/decode.c @@ -115,24 +115,13 @@ static void decode_fill_newvalue_regno(Packet *packet) { int i, use_regidx, offset, def_idx, dst_idx; - uint16_t def_opcode, use_opcode; - char *dststr; =20 for (i =3D 1; i < packet->num_insns; i++) { if (GET_ATTRIB(packet->insn[i].opcode, A_DOTNEWVALUE) && !GET_ATTRIB(packet->insn[i].opcode, A_EXTENSION)) { - use_opcode =3D packet->insn[i].opcode; - - /* It's a store, so we're adjusting the Nt field */ - if (GET_ATTRIB(use_opcode, A_STORE)) { - use_regidx =3D strchr(opcode_reginfo[use_opcode], 't') - - opcode_reginfo[use_opcode]; - } else { /* It's a Jump, so we're adjusting the Ns field */ - use_regidx =3D strchr(opcode_reginfo[use_opcode], 's') - - opcode_reginfo[use_opcode]; - } - g_assert(packet->insn[i].new_read_idx !=3D -1 && - packet->insn[i].new_read_idx =3D=3D use_regidx); + + g_assert(packet->insn[i].new_read_idx !=3D -1); + use_regidx =3D packet->insn[i].new_read_idx; =20 /* * What's encoded at the N-field is the offset to who's produc= ing @@ -153,39 +142,9 @@ decode_fill_newvalue_regno(Packet *packet) */ g_assert(!((def_idx < 0) || (def_idx > (packet->num_insns - 1)= ))); =20 - /* - * packet->insn[def_idx] is the producer - * Figure out which type of destination it produces - * and the corresponding index in the reginfo - */ - def_opcode =3D packet->insn[def_idx].opcode; - dststr =3D strstr(opcode_wregs[def_opcode], "Rd"); - if (dststr) { - dststr =3D strchr(opcode_reginfo[def_opcode], 'd'); - } else { - dststr =3D strstr(opcode_wregs[def_opcode], "Rx"); - if (dststr) { - dststr =3D strchr(opcode_reginfo[def_opcode], 'x'); - } else { - dststr =3D strstr(opcode_wregs[def_opcode], "Re"); - if (dststr) { - dststr =3D strchr(opcode_reginfo[def_opcode], 'e'); - } else { - dststr =3D strstr(opcode_wregs[def_opcode], "Ry"); - if (dststr) { - dststr =3D strchr(opcode_reginfo[def_opcode], = 'y'); - } else { - g_assert_not_reached(); - } - } - } - } - g_assert(dststr !=3D NULL); - /* Now patch up the consumer with the register number */ - dst_idx =3D dststr - opcode_reginfo[def_opcode]; - g_assert(packet->insn[def_idx].dest_idx !=3D -1 && - packet->insn[def_idx].dest_idx =3D=3D dst_idx); + g_assert(packet->insn[def_idx].dest_idx !=3D -1); + dst_idx =3D packet->insn[def_idx].dest_idx; packet->insn[i].regno[use_regidx] =3D packet->insn[def_idx].regno[dst_idx]; /* @@ -366,11 +325,7 @@ static void decode_shuffle_for_execution(Packet *packe= t) for (flag =3D false, i =3D 0; i < last_insn + 1; i++) { int opcode =3D packet->insn[i].opcode; =20 - g_assert(packet->insn[i].has_pred_dest =3D=3D - (strstr(opcode_wregs[opcode], "Pd4") || - strstr(opcode_wregs[opcode], "Pe4"))); - if ((strstr(opcode_wregs[opcode], "Pd4") || - strstr(opcode_wregs[opcode], "Pe4")) && + if (packet->insn[i].has_pred_dest && GET_ATTRIB(opcode, A_STORE) =3D=3D 0) { /* This should be a compare (not a store conditional) */ if (flag) { diff --git a/target/hexagon/mmvec/decode_ext_mmvec.c b/target/hexagon/mmvec= /decode_ext_mmvec.c index c1320406df..f850d0154d 100644 --- a/target/hexagon/mmvec/decode_ext_mmvec.c +++ b/target/hexagon/mmvec/decode_ext_mmvec.c @@ -28,21 +28,15 @@ check_new_value(Packet *pkt) { /* .new value for a MMVector store */ int i, j; - const char *reginfo; - const char *destletters; - const char *dststr =3D NULL; uint16_t def_opcode; - char letter; =20 for (i =3D 1; i < pkt->num_insns; i++) { uint16_t use_opcode =3D pkt->insn[i].opcode; if (GET_ATTRIB(use_opcode, A_DOTNEWVALUE) && GET_ATTRIB(use_opcode, A_CVI) && GET_ATTRIB(use_opcode, A_STORE)) { - int use_regidx =3D strchr(opcode_reginfo[use_opcode], 's') - - opcode_reginfo[use_opcode]; - g_assert(pkt->insn[i].new_read_idx !=3D -1 && - pkt->insn[i].new_read_idx =3D=3D use_regidx); + int use_regidx =3D pkt->insn[i].new_read_idx; + g_assert(pkt->insn[i].new_read_idx !=3D -1); /* * What's encoded at the N-field is the offset to who's produc= ing * the value. @@ -70,33 +64,19 @@ check_new_value(Packet *pkt) =20 /* def_idx is the index of the producer */ def_opcode =3D pkt->insn[def_idx].opcode; - reginfo =3D opcode_reginfo[def_opcode]; - destletters =3D "dexy"; - for (j =3D 0; (letter =3D destletters[j]) !=3D 0; j++) { - dststr =3D strchr(reginfo, letter); - if (dststr !=3D NULL) { - break; - } - } - if ((dststr =3D=3D NULL) && GET_ATTRIB(def_opcode, A_CVI_GATH= ER)) { + if ((pkt->insn[def_idx].dest_idx =3D=3D -1) && + GET_ATTRIB(def_opcode, A_CVI_GATHER)) { pkt->insn[i].regno[use_regidx] =3D def_oreg; pkt->insn[i].new_value_producer_slot =3D pkt->insn[def_idx= ].slot; } else { - if (dststr =3D=3D NULL) { + if (pkt->insn[def_idx].dest_idx =3D=3D -1) { /* still not there, we have a bad packet */ g_assert_not_reached(); } - g_assert(pkt->insn[def_idx].dest_idx !=3D -1 && - pkt->insn[def_idx].dest_idx =3D=3D dststr - regin= fo); - int def_regnum =3D pkt->insn[def_idx].regno[dststr - regin= fo]; + int def_regnum =3D + pkt->insn[def_idx].regno[pkt->insn[def_idx].dest_idx]; /* Now patch up the consumer with the register number */ pkt->insn[i].regno[use_regidx] =3D def_regnum ^ def_oreg; - /* special case for (Vx,Vy) */ - dststr =3D strchr(reginfo, 'y'); - if (def_oreg && strchr(reginfo, 'x') && dststr) { - def_regnum =3D pkt->insn[def_idx].regno[dststr - regin= fo]; - pkt->insn[i].regno[use_regidx] =3D def_regnum; - } /* * We need to remember who produces this value to later * check if it was dynamically cancelled diff --git a/target/hexagon/opcodes.c b/target/hexagon/opcodes.c index 1f7f3def38..02ae9cf787 100644 --- a/target/hexagon/opcodes.c +++ b/target/hexagon/opcodes.c @@ -36,34 +36,6 @@ const char * const opcode_names[] =3D { #undef OPCODE }; =20 -const char * const opcode_reginfo[] =3D { -#define IMMINFO(TAG, SIGN, SIZE, SHAMT, SIGN2, SIZE2, SHAMT2) /* nothin= g */ -#define REGINFO(TAG, REGINFO, RREGS, WREGS) REGINFO, -#include "op_regs_generated.h.inc" - NULL -#undef REGINFO -#undef IMMINFO -}; - - -const char * const opcode_rregs[] =3D { -#define IMMINFO(TAG, SIGN, SIZE, SHAMT, SIGN2, SIZE2, SHAMT2) /* nothin= g */ -#define REGINFO(TAG, REGINFO, RREGS, WREGS) RREGS, -#include "op_regs_generated.h.inc" - NULL -#undef REGINFO -#undef IMMINFO -}; - - -const char * const opcode_wregs[] =3D { -#define IMMINFO(TAG, SIGN, SIZE, SHAMT, SIGN2, SIZE2, SHAMT2) /* nothin= g */ -#define REGINFO(TAG, REGINFO, RREGS, WREGS) WREGS, -#include "op_regs_generated.h.inc" - NULL -#undef REGINFO -#undef IMMINFO -}; =20 const char * const opcode_short_semantics[] =3D { #define DEF_SHORTCODE(TAG, SHORTCODE) [TAG] =3D #SHORTCODE, --=20 2.34.1 From nobody Tue Nov 26 06:55:18 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=1708978704; cv=none; d=zohomail.com; s=zohoarc; b=hNmxUR1ddgzJUAG7lRMeIo62SK9o0aeRC58KU2DZP2uNIJNvJjr+H+HY1IJXRs5gm6ddBSpZcMhYZbYR5SZP+VAiLs4d2ydjavLdvOK4DMtcSN2FMUApk9ziJKIhz1xst50BEP+3PNmv5jdamQ4bs8rPt6WaGLeNpyN8ohrYi/0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708978704; 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=Sbgk/zluHKfPmO5dc7o3tgzgMpOrfW5WOHv6UDu7Cvl+rpGFwxn+WQJSWMrnP+g1hY3PlrhWgkfemxFPSvxi2cY+401RH0qHf7B5W2JbuRAK7YGtjaWlEgwLciAanAMC/Nzhx6gGNrZ9LHgWkSiEVDPm5vs+9PpAucxwSNYdVCs= 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 1708978704688276.82842573560356; Mon, 26 Feb 2024 12:18:24 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rehQ1-0001gW-KE; Mon, 26 Feb 2024 15:17:45 -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 1rehQ0-0001g9-0L for qemu-devel@nongnu.org; Mon, 26 Feb 2024 15:17:44 -0500 Received: from mail-oi1-x231.google.com ([2607:f8b0:4864:20::231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rehPt-00080p-SI for qemu-devel@nongnu.org; Mon, 26 Feb 2024 15:17:42 -0500 Received: by mail-oi1-x231.google.com with SMTP id 5614622812f47-3c199237eaeso1896267b6e.0 for ; Mon, 26 Feb 2024 12:17:37 -0800 (PST) Received: from taylor-ubuntu.austin.rr.com (068-203-008-061.res.spectrum.com. [68.203.8.61]) by smtp.gmail.com with ESMTPSA id by11-20020a056808340b00b003c1a4a9ad17sm330594oib.46.2024.02.26.12.17.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 12:17:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708978656; x=1709583456; 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=KuyxHXqSF0tKC0XvdygtDxYYZ9+wqyODIBRQe00/rwNQc8ZAyANSq7iyHLwIVqbRXB fbFIxHbb5nPnLwEslVhhOPX0UrwXnzE0ZtWFLiammDOVgtTHNcnIpmOVDQkcniKlDY3x /sjEKMXK/tP8AGxqv7d7ZJA5wdrFtR+9EJRhlBW2q9RPYdq5heBErCaYWjoUSNiesrLI FWvRCGtcLA3xCVsTRKgYNbPlCEPyGNSs9NHq3kRyVKgRIZd0QHUFtl52DJRAwgFkZNR1 klB6JQdTkfbAiZ6lvn+MVZMdUvGaRkZCzSCqdVsPp4qnO2k5h3qQYkRLyXGd3Qc2nlNi id1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708978656; x=1709583456; 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=mram3a9Ba0meDBh7HoAzNgM2GDMLdheiG0kXawyHhf3QprHmbR59E13VTsz0a2rrl/ 6sVzKanpqUm2a8xftGZPUJZjEH8kg+vZ31iyQoChp7Aal7b5pExt4a0vwBdsTsDKL0BF Ak0zsGt6H3ihQbRDorCpX1fDUq2oTtaucsYhi35/oUCvqxK2mjqJ37EDPmI5CI2UWXDH OCiKY3POP62Rp24EDHFCkw7ScmFhiAQYTNjdHMyrDdZxoyy8PNRs2Lz6GpkeXsMcI7vh JloMVfaubkKGyhciTU8pcWZGxFls0MxHaIOJ00yuhsXKr5fH4hEHYNJzPmZOOiBHjUzU 8AvA== X-Gm-Message-State: AOJu0YxtUyxaANuxnRAjPiE5frczxoKQo7jIyQ+9k682Ct6bDSFQvjPX PtHclMVuIXJiaq4/pzl8zzZv8yGcSOtVpa/GYr0zhLffLo2sEQhrZ+R6tDVDMpA= X-Google-Smtp-Source: AGHT+IF3a893SMloMtD5gR4asIlbjvL5GwLKGfmH0MIPtNOfhCb1MnHkhP0sMvFBFA+wuNojQ0AqLQ== X-Received: by 2002:a05:6808:15a9:b0:3c0:34ff:891f with SMTP id t41-20020a05680815a900b003c034ff891fmr217745oiw.57.1708978655785; Mon, 26 Feb 2024 12:17: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 7/9] Hexagon (target/hexagon) Remove gen_op_regs.py Date: Mon, 26 Feb 2024 13:17:20 -0700 Message-Id: <20240226201722.391879-8-ltaylorsimpson@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240226201722.391879-1-ltaylorsimpson@gmail.com> References: <20240226201722.391879-1-ltaylorsimpson@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::231; envelope-from=ltaylorsimpson@gmail.com; helo=mail-oi1-x231.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=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: 1708978705339100013 Signed-off-by: Taylor Simpson --- 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 Tue Nov 26 06:55:19 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=1708978747; cv=none; d=zohomail.com; s=zohoarc; b=j0erFYz7qiwKVVPGgv32D8AyMmAmtdh3vW/Jb7bUMnP4fpGZywIMrHqLNPZkURvj6UbO5zyX7i+jvF5+rcvjGr0jA1iRZB8xRhJzePHRcLa7g6iYeuRKG/rUuk8I7GJvApeU7jzIookER0gtrD74wLrPy5TJkKuDTpYrrtJRAdA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708978747; 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=McK6pMCkk1JHZXjOHIk0iRYYNOPSgsKj+4bmXVma35nsEhZg3AgCWo8sK84deuWFa5MJ5y8pZMXk1G8raAP4u1/M2ilOVTfLvvow8hpZPsC5AAeBEI+WvH8glqjRwlMifgpd0kSWcIsR7pXjUOgk3Z14laxlQSjtkDIut1pSPTs= 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 1708978747778484.5922016516431; Mon, 26 Feb 2024 12:19:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rehQ0-0001gB-5L; Mon, 26 Feb 2024 15:17: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 1rehPx-0001ew-CN for qemu-devel@nongnu.org; Mon, 26 Feb 2024 15:17:41 -0500 Received: from mail-oi1-x232.google.com ([2607:f8b0:4864:20::232]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rehPv-000811-BM for qemu-devel@nongnu.org; Mon, 26 Feb 2024 15:17:41 -0500 Received: by mail-oi1-x232.google.com with SMTP id 5614622812f47-3bb9b28acb4so2482133b6e.2 for ; Mon, 26 Feb 2024 12:17:38 -0800 (PST) Received: from taylor-ubuntu.austin.rr.com (068-203-008-061.res.spectrum.com. [68.203.8.61]) by smtp.gmail.com with ESMTPSA id by11-20020a056808340b00b003c1a4a9ad17sm330594oib.46.2024.02.26.12.17.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 12:17:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708978657; x=1709583457; 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=X0jRWafIfmHCQy4wudzjJon6cdZ6nMaQbT1QBUZZgd/HS7aQVqMxAnaZ9zfX2Xg6H7 MfZcBIDvdzJ5EftWNnjSnZztVddg4pV7IP173ZSITblHUgBatjIQKvgjIUukSfvmI/Bk fTleKwOBfn0SfxwKD54nUp+8dld/e5BT7VCOjzx1Sj8lHyk/EOM9CS2AgpRoc0JAAmAV gwteBUL9qc03wezJZJIg/o4q93bePKk5kr4FedaMkelDKEfbMO4rpoTUQwN+NONdNT+L xImQwap2zxirupCI+RV0SbBDS5QW3vb3T9e5YYK+3oETyDe3NeAmmUdxlcJD+J7B1nj7 WEzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708978657; x=1709583457; 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=DxZ1sFYZ8u65K/PE/6mz4SrIeZbSR57LQgN19xto6qV3/ivkiJjGFc9azhJgpWgUnd tuS4tEBV2MN5nFJUt6owfEQkqTbKIccpWTWaq1BNJHh6TaL2dwagdofYV82+fCMGJV93 9KLiF4PXiv/9lOBKujqbWDqhrMhA/VmO3fPyeiz3zY3cKnAhTziRRHwaQx2TjjfP+oq4 W+xJLyuScc3v6mc/w+jgo+OngQfRTYTUcV0TvN5wzb5PGi+hbQyO+OVl/rTaiTh7qWOn YyHT0N92YVMqokjrEQM/Y04vvttpdyaxhpR6iXdfDAGIZa4gmsHf3WCW+Ct26uHK0EwP 6gig== X-Gm-Message-State: AOJu0YwoPP/m6H741kyuwJNDf2v6E453rYlokMT4MGadG6p1krYgdsrA jhrJ87ju+PaoPBHMgVK+rk1L2/fCUhwPrWIrHhYTWcebWGpCTzU/SqXq6vZBNxI= X-Google-Smtp-Source: AGHT+IGIC2MNmJJaHD7E3Ew6yvs00WWSjxluTznzDrPZxeqVIlr8drzbSNVdgyUEFxxpJFCgShyqBw== X-Received: by 2002:a05:6808:2189:b0:3bf:fdb2:ca5b with SMTP id be9-20020a056808218900b003bffdb2ca5bmr223210oib.3.1708978657341; Mon, 26 Feb 2024 12:17: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 8/9] Hexagon (target/hexagon) Remove gen_shortcode.py Date: Mon, 26 Feb 2024 13:17:21 -0700 Message-Id: <20240226201722.391879-9-ltaylorsimpson@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240226201722.391879-1-ltaylorsimpson@gmail.com> References: <20240226201722.391879-1-ltaylorsimpson@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::232; envelope-from=ltaylorsimpson@gmail.com; helo=mail-oi1-x232.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: 1708978749451100003 This data structure is not used Signed-off-by: Taylor Simpson --- 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 Tue Nov 26 06:55:19 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=1708978703; cv=none; d=zohomail.com; s=zohoarc; b=G4yx/RuENvt3fiJOJDy+e14N6+nszrp/sNrrtwtPH8n1XJnm99U5bF0Y6WfZtN9q9Jd7nDmi5KvCaA48jCZ6dS38qpDg8P2aZJ8x1wC4IG0KuGn0v5crpNIlecWTsRlmRnuDpe6CIxZXo+RxBm0fjo/12bDcCcipKAtHcN7PDUI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708978702; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=2mZF31pVOsPdanhM75ZSyb+FCM6gHs0R2hRgmZ/lF6E=; b=eL1IjErUwJDpVJu5CS2m93POof68rHyNJXJqG4qK8dpv1KX7x+4/hkJ1nZYXvMg/bPItkcwIjiXeXFYGw3A2bn0rI1C8GtgY4HA+Ol1dDnbkNSwYmf2eND1b3b3IvVBmHPSsP/2RzV/gKtSZdgWNrSqK8vHzQubovTOOEa/WJQg= 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 1708978702990532.0670726729592; Mon, 26 Feb 2024 12:18:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rehQD-0001ij-4m; Mon, 26 Feb 2024 15:17:57 -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 1rehQB-0001i7-TU for qemu-devel@nongnu.org; Mon, 26 Feb 2024 15:17:55 -0500 Received: from mail-oi1-x236.google.com ([2607:f8b0:4864:20::236]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rehPw-00081B-GW for qemu-devel@nongnu.org; Mon, 26 Feb 2024 15:17:55 -0500 Received: by mail-oi1-x236.google.com with SMTP id 5614622812f47-3c19937913fso1739947b6e.3 for ; Mon, 26 Feb 2024 12:17:40 -0800 (PST) Received: from taylor-ubuntu.austin.rr.com (068-203-008-061.res.spectrum.com. [68.203.8.61]) by smtp.gmail.com with ESMTPSA id by11-20020a056808340b00b003c1a4a9ad17sm330594oib.46.2024.02.26.12.17.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 12:17:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708978659; x=1709583459; 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=NTccxSmM0MwGh/SsrZhozDglv5BVButVPLmecOAsiP+Argu9I56IZMzHog6dM750rr eyMSjQiQXI2M3L7Q4qTiVMALXC/sQklCTrwXXcRNU9VGeabRJwqBVufDVukmvjH5Ks2H aEOa2uwLOP+yTY3vqbzHYiT6co+Q86IiUw2QTUSV6BWm4O9mKQ6/P0772xHn/07sXir/ dZ8TDWjAy4owI/ha8cE2YfgrfaRh9FxA/B+8LUwtctRspu0ry1cMy7ytOw1OALweIGNl J9eMf9+jLepK8RgSJlU6lo3ZoVIDffe1+sR8ue/16D0d3d2b5iJnoJnB1U1Rj9BIZnJX jPvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708978659; x=1709583459; 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=nZUOAbHJXDKd8EGoYwbcgie5VLo9Cjexd19bKmLYpge8TMX9iEg8x4M+GMRaCEgzCU nv3X+KNagUnNk4zxQXkpumk0CUNZXH/oLLjOiVzxpbDQjE4ttyYbDSOiMCqIlO6g79PF ThfqLgyg/zAU864keroXfFqeMXz6SXCuEj89Vj3CoGzSk+BUVnMqnxMj3rLJtHG/vvsP yqDnNorbj44GFCcCSLx51ye7SZWVhNOVKaiVVNdnpDE+hheGqjpUsS7EdXOGRxU3ff14 fEyNdSXHCPeKt4qBnkYPxMTj+KVmoKlixIHkgz/uqJNHmzxTuKACipctRrPfofUGpEh7 wA1w== X-Gm-Message-State: AOJu0YxKWN1WPlJengF7rxoVV0WoUEAoox3XiluDn8CtC+uJhTAXa4FH DeLytYmuOXta5h24o60j+yKfdWpIukD61i7ocwCH6ZCBYSZ3ZnS4EqpPttlHRU4= X-Google-Smtp-Source: AGHT+IE38zPgztZiA0dPGoyZs1Bd/krX4Dk/Lsw6CR3SCC/tATASTybDXDt1zGBOkr/nBx0rR/BRtQ== X-Received: by 2002:a05:6808:640c:b0:3c1:abb6:b4b3 with SMTP id fg12-20020a056808640c00b003c1abb6b4b3mr222146oib.2.1708978658915; Mon, 26 Feb 2024 12:17: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 9/9] Hexagon (target/hexagon) Remove hex_common.read_attribs_file Date: Mon, 26 Feb 2024 13:17:22 -0700 Message-Id: <20240226201722.391879-10-ltaylorsimpson@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240226201722.391879-1-ltaylorsimpson@gmail.com> References: <20240226201722.391879-1-ltaylorsimpson@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::236; envelope-from=ltaylorsimpson@gmail.com; helo=mail-oi1-x236.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, 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: 1708978703381100004 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 --- 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