From nobody Wed Nov 27 04:42:55 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=1702246137; cv=none; d=zohomail.com; s=zohoarc; b=HeOSsAsTPzQJRhG6lCfpfdIPpodPzXXIasPokIFf+n5NFYp1QL1bwKVleaSc9OjKbYzZZcgZ8WiY9Xd118VHGvVAK2SG1JieUKU6Ys5hLEPtNui9yNIdF3/Oz3c5/O+zIR4rC/l2vjF3gdA1e6Hh0J1bcdxZNU4xOGvxVGzQWf4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1702246137; 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=YNCZEt0jssVqmuXszpYWIIpR+RwMQc0XvTsifV7CiSY=; b=gau6ORop/x0duc4ZMhSawl5t6CkbSfvJ1mF9mavGidIYQx+IYkbQRmdgbiVx7Rjfd1QJBjCXb/4aYXWEGieu9/K5JvX4oB+L8BE5k8UrTbnoTg0+lwYHL5VA+Geky+EyVLH6je6xXxvbybAEHfYy4FcsKdx5luqzwqCSDeJeT6s= 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 1702246137437858.2446978533843; Sun, 10 Dec 2023 14:08:57 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rCRxR-0004xU-8T; Sun, 10 Dec 2023 17:07:29 -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 1rCRxP-0004wY-73 for qemu-devel@nongnu.org; Sun, 10 Dec 2023 17:07:27 -0500 Received: from mail-oo1-xc36.google.com ([2607:f8b0:4864:20::c36]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rCRxN-0004Z9-Gj for qemu-devel@nongnu.org; Sun, 10 Dec 2023 17:07:26 -0500 Received: by mail-oo1-xc36.google.com with SMTP id 006d021491bc7-590bb31ccf5so945295eaf.3 for ; Sun, 10 Dec 2023 14:07:25 -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 q23-20020a4a6c17000000b0058e200a9065sm1588173ooc.29.2023.12.10.14.07.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Dec 2023 14:07:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702246043; x=1702850843; 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=YNCZEt0jssVqmuXszpYWIIpR+RwMQc0XvTsifV7CiSY=; b=aPZTcNLZAsdHBHIzpK5eW/N7U1SrrrUpiSMVzVATdxZ4QDCbVSgAXGWwHsR3pkBTuL UYuPANx2mkUMMTVzFSsohssAGoddDJ/H6lya9JqGngVkO52ArbZqoO4wdm7GnSvk0OnB 6+MPbes5WkouLYm2Fmfi0kNsWFwsAfJWkCVZbXeLEkMwfLlkzOPtUg6zZi+MJWDmOv8I 2aaCz8H7X6nsx5xb4kdke/SSFX6oefxP5HruYnsyrb1trRDIjv8gJQw5VkV63iC34kur Klspxz0hekzzyDZWyEgHx97MwjEZxsRdXdkPOGRJfNCDvrfVMbyokrWniW/dBPwErjqX U/eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702246043; x=1702850843; 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=YNCZEt0jssVqmuXszpYWIIpR+RwMQc0XvTsifV7CiSY=; b=Zs+pxurLCtnw5mfw+QSSl9k1AqXMzOH/5V6tmXiNb5gbkuU8/PSFxPX+3OKscNU2EU iI754Hh9Y8UPixRqCEyKjOQFEymLf89nmuEogKIF9XxMZcR7eF/Nj1ifgQXawEwC/bR7 pe+Gedw2D/6lu2Lrze6Ctlz5fBHRM81TgSlL2bxF7TqUBsGen7tPx8HB6ncudJaWDnnj wRRuyakkzHLopYf20sQDU7ovIY5aY3f4+Q8Y27mF1Wi7ghepempZeS6YL8XZ8YkS7Azl 6xc1Go50vK6LzPjHgBaSLEcD7DmZRkUq7n+8vscZouJbLO7EXWVIYyqraaBqaiVUQUtU uTZQ== X-Gm-Message-State: AOJu0YzPumW0BK7vPJ5u+DZHFKv+EzgLIPYsdsCk//sNl4uIddwG2qSn RKpVblxjiQl/muh88uvt3XTkxoNWoeKHAQ== X-Google-Smtp-Source: AGHT+IHOKIo9l+HhCbudN5Hy/qFOhKW92sg3pbu5hYw+CbxGKklahPHXcHvZ+sNogL1FgE1omEkY6Q== X-Received: by 2002:a05:6820:22a4:b0:590:16e7:d767 with SMTP id ck36-20020a05682022a400b0059016e7d767mr2408527oob.3.1702246043596; Sun, 10 Dec 2023 14:07:23 -0800 (PST) From: Taylor Simpson To: qemu-devel@nongnu.org Cc: bcain@quicinc.com, quic_mathbern@quicinc.com, sidneym@quicinc.com, quic_mliebel@quicinc.com, richard.henderson@linaro.org, philmd@linaro.org, ale@rev.ng, anjo@rev.ng, ltaylorsimpson@gmail.com Subject: [PATCH v2 5/9] Hexagon (target/hexagon) Make generators object oriented - gen_idef_parser_funcs Date: Sun, 10 Dec 2023 15:07:08 -0700 Message-Id: <20231210220712.491494-6-ltaylorsimpson@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231210220712.491494-1-ltaylorsimpson@gmail.com> References: <20231210220712.491494-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::c36; envelope-from=ltaylorsimpson@gmail.com; helo=mail-oo1-xc36.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: 1702246137920100001 Signed-off-by: Taylor Simpson Reviewed-by: Brian Cain --- target/hexagon/gen_idef_parser_funcs.py | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/target/hexagon/gen_idef_parser_funcs.py b/target/hexagon/gen_i= def_parser_funcs.py index f4518e653f..550a48cb7b 100644 --- a/target/hexagon/gen_idef_parser_funcs.py +++ b/target/hexagon/gen_idef_parser_funcs.py @@ -46,6 +46,7 @@ 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 @@ -132,22 +133,9 @@ def main(): =20 arguments =3D [] for regtype, regid in regs: - prefix =3D "in " if hex_common.is_read(regid) else "" - - is_pair =3D hex_common.is_pair(regid) - is_single_old =3D hex_common.is_single(regid) and hex_comm= on.is_old_val( - regtype, regid, tag - ) - is_single_new =3D hex_common.is_single(regid) and hex_comm= on.is_new_val( - regtype, regid, tag - ) - - if is_pair or is_single_old: - arguments.append(f"{prefix}{regtype}{regid}V") - elif is_single_new: - arguments.append(f"{prefix}{regtype}{regid}N") - else: - hex_common.bad_register(regtype, regid) + reg =3D hex_common.get_register(tag, regtype, regid) + prefix =3D "in " if reg.is_read() else "" + arguments.append(f"{prefix}{reg.reg_tcg()}") =20 for immlett, bits, immshift in imms: arguments.append(hex_common.imm_name(immlett)) --=20 2.34.1