From nobody Tue Nov 26 13:29:24 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=1707180714; cv=none; d=zohomail.com; s=zohoarc; b=ET97V6Miyu6Pge0ndSLXiJHSX4b6co0pihkC+m66u8nTWBYrgyPLPsKQxcX0vJN4+L1i/k0JTy4zebVDpAy2cuUqRebf0zI4Wk3IKlCukQuL8qEhOlPI+ooKaShTiv5cSAbiyFcJ0O9ijZmrAv2P3xyVNtdkuYrUmvXyl6jbv7I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707180714; 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=gM3kEimAZ8RmJFomVzINHAkYspMcJtgmOD3pmftJlXs=; b=kI1sXL6BCT2kdO0RV9IlS6U8uY4OEifNjdCB+5fSX02l3/UPNdAmnZGE8zLg8+/A87hkSS+pFwAVDNjel6Lx8jEO5XY3HhWvG7LU/eS/QAm0fpIESSX5oy/w6xI5VKGilmR9rQaS+sRliK5pOK2Ywtiu4W1VJYW9ytvIfu7Jros= 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 1707180713986496.05901848228746; Mon, 5 Feb 2024 16:51:53 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rX9ff-0008Au-E1; Mon, 05 Feb 2024 19:50:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rX9fc-0008AM-V2 for qemu-devel@nongnu.org; Mon, 05 Feb 2024 19:50:40 -0500 Received: from mail-il1-x12b.google.com ([2607:f8b0:4864:20::12b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rX9fb-0000Le-EK for qemu-devel@nongnu.org; Mon, 05 Feb 2024 19:50:40 -0500 Received: by mail-il1-x12b.google.com with SMTP id e9e14a558f8ab-363cdbd584eso3354755ab.0 for ; Mon, 05 Feb 2024 16:50:39 -0800 (PST) Received: from taylor-ubuntu.hsd1.co.comcast.net (c-73-169-12-54.hsd1.co.comcast.net. [73.169.12.54]) by smtp.gmail.com with ESMTPSA id c8-20020a02a408000000b0046e2ce45dafsm245840jal.165.2024.02.05.16.50.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 16:50:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707180638; x=1707785438; 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=gM3kEimAZ8RmJFomVzINHAkYspMcJtgmOD3pmftJlXs=; b=NqHnRgHiheNQEqCSx8WhVtdrw2ELsoB0Uk6NkQsHlBMwRZq0gPeYTOcpyH3DhOQg+t AUy2cZE8yPKLUC1ejc+I61S6jaQiaqQpvx96Q6Ci/W20eBJ5+6k8DLIs3ZY5FhwRALq+ /0Alpc6bhGPVCmdiEQytwyh3UMlVAM5Z63X2Y+AGjXle1VU/00ii/9cicJwfOGwgEafi 7R/yGvamIzuEe0XE0dKZ+mxNoGHT0RrzBgOKW4hCD00nq3hmlsJ9W3e6QezYsprD8v7T Z8YyYsyipJ3XNIuroacKpoTiS+PqHy79UL1hFV3FDLI97oARaBPavmDIAD/AyRrO17bm P0mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707180638; x=1707785438; 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=gM3kEimAZ8RmJFomVzINHAkYspMcJtgmOD3pmftJlXs=; b=idPwuuxcsOPZNJaR/lBsodgWO9EnW/fbBiW0+OGMHVvu56x5kCoaAJ5tmUYyiwOIwI wV14tv+JZnPsPJdfkGGEngLBpNbMmxQOKMfFhLZWaW8faDkbzQQrcyu27XpTuSRFfUr7 JkzUfYTOxINrjEpXqsvLlsIL+9iCjCSNX0uJAE4TdcaN+rqGHzO6TTLaZK5QyFq2D2Ot tOEqxUkloYH1RO/lV+SK74gjXvUzbm2iMdv+xvAiMWQflLZaTMSDIEq2NsIf039yI6ZG Sc3Zd/tNVU9UAQrtPbTPmS8xUAmDKWZp+P51qRUlW9t3G+4Mx73eOre1Tg88e8CHD0Do RORA== X-Gm-Message-State: AOJu0Ywzk+MWPdEszYvDpkgT0TQs4OkixSFAIRFtGO4Yb/9HZkzpIqP2 Ms0ozyWfccdi6Z74TBqfYCYeM06ae9eK1SBFeOaF8V2rKK5wmEUJdTGvUeyKcZo= X-Google-Smtp-Source: AGHT+IH4LTtaphClGWWtV91PUayvQ1Zpc7y+FrJqvMY28IZoWkaWkYKkmpkV12cS3xtvj2O7qJ57sQ== X-Received: by 2002:a05:6e02:144c:b0:363:bdb9:72af with SMTP id p12-20020a056e02144c00b00363bdb972afmr1806032ilo.23.1707180637868; Mon, 05 Feb 2024 16:50:37 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCX9g1UHHh99vV/DXwFmYgn1ZQOHquetQN2g8z3ihtgEHIU9ljfK/dFY0gyXQtoCE4663o5wnOWRDGZSjHIejkGUm5aGX7Dpso3vwwj3eUcBv1oYLW8RiSAoCmpK8Y7fMUN9iNpiB94Gdwpco/YSlwsk0/p1YGG3pe21Nq7TeFnMDN/qQBfYBWDG6thsNRFERlw+pw+3td6DR0oqj/4h2ov3ECx7YB496y7Zr9WOKXpMGeXc61c5KCfC6Q+8N1AL3lj8g6kEx/Pix2zQYigS8TdBeDGfWgkiA8Plm1k6 From: Taylor Simpson To: qemu-devel@nongnu.org Cc: bcain@quicinc.com, quic_mathbern@quicinc.com, sidneym@quicinc.com, quic_mliebel@quicinc.com, richard.henderson@linaro.org, philmd@linaro.org, ale@rev.ng, anjo@rev.ng, ltaylorsimpson@gmail.com Subject: [PATCH v2 1/3] Hexagon (target/hexagon) Pass P0 explicitly to helpers that need it Date: Mon, 5 Feb 2024 17:50:32 -0700 Message-Id: <20240206005034.267283-2-ltaylorsimpson@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240206005034.267283-1-ltaylorsimpson@gmail.com> References: <20240206005034.267283-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::12b; envelope-from=ltaylorsimpson@gmail.com; helo=mail-il1-x12b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1707180714713100001 Rather than reading P0 from the env, pass it explicitly Signed-off-by: Taylor Simpson Reviewed-by: Anton Johansson Tested-by: Anton Johansson --- target/hexagon/macros.h | 2 +- target/hexagon/hex_common.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/target/hexagon/macros.h b/target/hexagon/macros.h index 1376d6ccc1..9c700ce8ef 100644 --- a/target/hexagon/macros.h +++ b/target/hexagon/macros.h @@ -358,7 +358,7 @@ static inline TCGv gen_read_ireg(TCGv result, TCGv val,= int shift) #endif #define fREAD_PC() (PC) =20 -#define fREAD_P0() (env->pred[0]) +#define fREAD_P0() (P0) =20 #define fCHECK_PCALIGN(A) =20 diff --git a/target/hexagon/hex_common.py b/target/hexagon/hex_common.py index 195620c7ec..2dbd0ea737 100755 --- a/target/hexagon/hex_common.py +++ b/target/hexagon/hex_common.py @@ -197,6 +197,10 @@ def get_tagimms(): return dict(zip(tags, list(map(compute_tag_immediates, tags)))) =20 =20 +def need_p0(tag): + return "A_IMPLICIT_READS_P0" in attribdict[tag] + + def need_slot(tag): if ( "A_CVI_SCATTER" not in attribdict[tag] @@ -1118,6 +1122,12 @@ def helper_args(tag, regs, imms): "tcg_constant_tl(ctx->next_PC)", "target_ulong next_PC" )) + if need_p0(tag): + args.append(HelperArg( + "i32", + "hex_pred[0]", + "uint32_t P0" + )) if need_slot(tag): args.append(HelperArg( "i32", --=20 2.34.1 From nobody Tue Nov 26 13:29:24 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=1707180709; cv=none; d=zohomail.com; s=zohoarc; b=dmjGqxvVhaQcaX9atdPUQ4zURfkSbHpe7L+Uw2HR/F3Rs6io7T0SohzanFPeuatrMr6Pe2anupLFzLVF0YMpGxfA8zxZTN5RoVQTz35OvSfcVMfxXUx8Ef8GsqgZd5aXy15T6yLX5vsQoDEz3uMJ+PCanCD/PvEDtnh0Zn99qFc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707180709; 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=tYLiDCFABC1lp2MV8V62ONedvtOy+ShpcqL/t5bf5Qc=; b=BgpNcz6f4MeXb7i0iII8yvaH4vVHHhw1wzPqrXwockgNnrJkSIcSpb/AQzv/x6GDsxBVFqGxf59ewhZddQQiSqzQfRTaB3FMLiSj/73v39wHNW1Mix2ZpzCoQH7HMhUmaRloLMrXlQOX84tLed1HbJ9VSJo738fPbpDfBmSV8gk= 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 1707180709724893.0263335124852; Mon, 5 Feb 2024 16:51:49 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rX9fg-0008BE-V5; Mon, 05 Feb 2024 19:50: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 1rX9fe-0008Ai-Do for qemu-devel@nongnu.org; Mon, 05 Feb 2024 19:50:42 -0500 Received: from mail-il1-x12e.google.com ([2607:f8b0:4864:20::12e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rX9fc-0000Ln-Qh for qemu-devel@nongnu.org; Mon, 05 Feb 2024 19:50:42 -0500 Received: by mail-il1-x12e.google.com with SMTP id e9e14a558f8ab-363c9e3f814so5175615ab.0 for ; Mon, 05 Feb 2024 16:50:40 -0800 (PST) Received: from taylor-ubuntu.hsd1.co.comcast.net (c-73-169-12-54.hsd1.co.comcast.net. [73.169.12.54]) by smtp.gmail.com with ESMTPSA id c8-20020a02a408000000b0046e2ce45dafsm245840jal.165.2024.02.05.16.50.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 16:50:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707180639; x=1707785439; 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=tYLiDCFABC1lp2MV8V62ONedvtOy+ShpcqL/t5bf5Qc=; b=a07bHP7Ddj/m0u9KfoYAf1sNxwlBR3n9POJbHaNIT9qb6QJ/CTZksHwK98rt6v0ok6 IwW8IMv5jfrjCMAU2J+s6Hzbce+0IxzxhNziMILyPIHdVryJyFWXDqiipGzLZm0hKnUH SQVmZ/IyAc0g0NAE3GSENyUrBlcf/9YWO3J2xRWYh/s8O7yl10hxqd6nU7DeHZiWZdGU WMO+tx962vcFZVno/LeJDuSJwOr7Smh0AtSaN5MOuBcQP/+D1dN4N0BR8mLn4H+DNHgj K65+qCmVl44ieDMxZosMKW5bZATWHzl8mxS9ZxrfDRhUYpgcmzrsfb7Jd8rY94yIkHVK sQWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707180639; x=1707785439; 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=tYLiDCFABC1lp2MV8V62ONedvtOy+ShpcqL/t5bf5Qc=; b=pgPbl0MaXF2Hy8YHJ5Ii3nWlETLW1SaX7v9JrHaNnRl65gwBiPCXLeHBAcIx2gy8UR Gq8YaN59Awo4QH5rNxW2PDjOsi4T541LqJDt20cdXWp60jRAiVWwcVSv2CdxSdXxPEKi b+26xy1pQkW0TBLTP4ZjoHGZ/cNUbrpHsM8b9PK675aOpvJUNW1Z6zufJGKMCvxZJIE1 XCIPI0EtqgemIDmBxdozAnzDPrY0PnYfXsz725Gr94ZnwlfKd937jHu/WMvKbybdtong /y6XxYPrqRexQH2RC1y1sRtAE86AcZMUNhLLiBubC5hyFXe5F281SqovvKy0WVH5qw1f a46w== X-Gm-Message-State: AOJu0YyJR4yNyFuQDxTVb0sI5acsh1ysCERf1VXD555pG0mcssKjBm9C YhDSQnhoXczWx64ebQYPsSOXhFvnSttHy09G1/0fbHlQD2Im6rtT9wiACFH/88g= X-Google-Smtp-Source: AGHT+IGO6ndZVr7SfiN7mLBTfBOkNW71ETvxgtxiIcIjtLmO+qV3vqWZzz3mTCUXymSEEMQ46UVl4A== X-Received: by 2002:a92:4a0f:0:b0:363:c1f9:16f4 with SMTP id m15-20020a924a0f000000b00363c1f916f4mr1606149ilf.28.1707180638873; Mon, 05 Feb 2024 16:50:38 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCXvrgA/Rt2c69jve9mgs4WVyRjvjV9QsWKSkoc1gjJRDSQWD2kOMIIMHbLD03dcrYv4Ih5X+p25AHErRlMVogVC6/SnDhndq+qTErat6dwpXLs2Qu9/I4P7Rucs9FHWvxhURFJZ7lHc+yFU6ZMAR71QCD2CrCyaSy9YO9cHednG1u+Dm7eXzLdLdnUWGuahmk8DTI0tbC/6rIGmbPp6szOYml0B4AmOSfLb0Jqa2Sx/LJL0sXZEkD8u2sUVn4C6vQ2jAJMSI+RMh4DRpU4Dhowatvi2RxSz8G+8uc0F From: Taylor Simpson To: qemu-devel@nongnu.org Cc: bcain@quicinc.com, quic_mathbern@quicinc.com, sidneym@quicinc.com, quic_mliebel@quicinc.com, richard.henderson@linaro.org, philmd@linaro.org, ale@rev.ng, anjo@rev.ng, ltaylorsimpson@gmail.com Subject: [PATCH v2 2/3] Hexagon (target/hexagon) Pass SP explicitly to helpers that need it Date: Mon, 5 Feb 2024 17:50:33 -0700 Message-Id: <20240206005034.267283-3-ltaylorsimpson@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240206005034.267283-1-ltaylorsimpson@gmail.com> References: <20240206005034.267283-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::12e; envelope-from=ltaylorsimpson@gmail.com; helo=mail-il1-x12e.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: 1707180710733100006 Rather than reading SP from the env, pass it explicitly Signed-off-by: Taylor Simpson Reviewed-by: Anton Johansson Tested-by: Anton Johansson --- target/hexagon/macros.h | 2 +- target/hexagon/attribs_def.h.inc | 1 + target/hexagon/hex_common.py | 11 +++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/target/hexagon/macros.h b/target/hexagon/macros.h index 9c700ce8ef..4b8665a9da 100644 --- a/target/hexagon/macros.h +++ b/target/hexagon/macros.h @@ -343,7 +343,7 @@ static inline TCGv gen_read_ireg(TCGv result, TCGv val,= int shift) =20 #define fREAD_LR() (env->gpr[HEX_REG_LR]) =20 -#define fREAD_SP() (env->gpr[HEX_REG_SP]) +#define fREAD_SP() (SP) #define fREAD_LC0 (env->gpr[HEX_REG_LC0]) #define fREAD_LC1 (env->gpr[HEX_REG_LC1]) #define fREAD_SA0 (env->gpr[HEX_REG_SA0]) diff --git a/target/hexagon/attribs_def.h.inc b/target/hexagon/attribs_def.= h.inc index 87942d46f4..8949ee09cf 100644 --- a/target/hexagon/attribs_def.h.inc +++ b/target/hexagon/attribs_def.h.inc @@ -117,6 +117,7 @@ DEF_ATTRIB(IMPLICIT_READS_P1, "Reads the P1 register", = "", "") DEF_ATTRIB(IMPLICIT_READS_P2, "Reads the P2 register", "", "") DEF_ATTRIB(IMPLICIT_READS_P3, "Reads the P3 register", "", "") DEF_ATTRIB(IMPLICIT_WRITES_USR, "May write USR", "", "") +DEF_ATTRIB(IMPLICIT_READS_SP, "Reads the SP register", "", "") DEF_ATTRIB(COMMUTES, "The operation is communitive", "", "") DEF_ATTRIB(DEALLOCRET, "dealloc_return", "", "") DEF_ATTRIB(DEALLOCFRAME, "deallocframe", "", "") diff --git a/target/hexagon/hex_common.py b/target/hexagon/hex_common.py index 2dbd0ea737..eb28aa98fe 100755 --- a/target/hexagon/hex_common.py +++ b/target/hexagon/hex_common.py @@ -101,6 +101,7 @@ def calculate_attribs(): add_qemu_macro_attrib('fLSBNEW1', 'A_IMPLICIT_READS_P1') add_qemu_macro_attrib('fLSBNEW1NOT', 'A_IMPLICIT_READS_P1') add_qemu_macro_attrib('fREAD_P3', 'A_IMPLICIT_READS_P3') + add_qemu_macro_attrib('fREAD_SP', 'A_IMPLICIT_READS_SP') =20 # Recurse down macros, find attributes from sub-macros macroValues =3D list(macros.values()) @@ -201,6 +202,10 @@ def need_p0(tag): return "A_IMPLICIT_READS_P0" in attribdict[tag] =20 =20 +def need_sp(tag): + return "A_IMPLICIT_READS_SP" in attribdict[tag] + + def need_slot(tag): if ( "A_CVI_SCATTER" not in attribdict[tag] @@ -1128,6 +1133,12 @@ def helper_args(tag, regs, imms): "hex_pred[0]", "uint32_t P0" )) + if need_sp(tag): + args.append(HelperArg( + "i32", + "hex_gpr[HEX_REG_SP]", + "uint32_t SP" + )) if need_slot(tag): args.append(HelperArg( "i32", --=20 2.34.1 From nobody Tue Nov 26 13:29:24 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=1707180727; cv=none; d=zohomail.com; s=zohoarc; b=J2yor6LRj3/wDNQWFjl5N2tT3oBgBIKQThoqVTwikbAzf2neVWts71Vni/1efwcO9G58JqaTQoACLCHkLLY874hZx28muA1lYZBdKs/t8RNM7foivT9vqaNvj+ilOu4/vc9SywdWv+e4+fBhy/dcT2ad0AT3euSPgYKBsKzzCs8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707180727; 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=Q5zixAlF4wZ6FLSTr9hS2N8Z0evbTrh/CxGYDAI0MKE=; b=nhOPGMLSorSvi5lmdXGTMWQ/3RBKoswOmhAo/41zZd4GTMQugwDwO/+SkqvFPbzy/HNr8rgsqxAFodbbXPWGYFASvgszbnC/vPQwaMo5I3L25Prfg1EvZuu8qdt1/fRQKgg7hJ8mGe3VkPLodItD+aXeD73L1WIxe5cEQVIuK+I= 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 1707180727982373.0364671604707; Mon, 5 Feb 2024 16:52:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rX9fm-0008Bk-H7; Mon, 05 Feb 2024 19:50:50 -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 1rX9fl-0008BY-2O for qemu-devel@nongnu.org; Mon, 05 Feb 2024 19:50:49 -0500 Received: from mail-il1-x12c.google.com ([2607:f8b0:4864:20::12c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rX9fj-0000MP-9N for qemu-devel@nongnu.org; Mon, 05 Feb 2024 19:50:48 -0500 Received: by mail-il1-x12c.google.com with SMTP id e9e14a558f8ab-363cdbd584eso3355045ab.0 for ; Mon, 05 Feb 2024 16:50:46 -0800 (PST) Received: from taylor-ubuntu.hsd1.co.comcast.net (c-73-169-12-54.hsd1.co.comcast.net. [73.169.12.54]) by smtp.gmail.com with ESMTPSA id c8-20020a02a408000000b0046e2ce45dafsm245840jal.165.2024.02.05.16.50.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 16:50:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707180645; x=1707785445; 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=Q5zixAlF4wZ6FLSTr9hS2N8Z0evbTrh/CxGYDAI0MKE=; b=aCU//OuklJHAoe0pAz2hQhs8bXV0j6g8yX4bL6zsobFXHJsbrEDVycsYpoQm+qJiL/ G7bBRAR7IZ6fUR0hwrMIMesGp70//QTlf8Tp1BI0r4bU/Fp09UPMQI5Q6n1KRsYL9NMK xoivR+HVfAuvZCJEoCUQhwEttYO/4+P7kv33YgKGuvnu51aZLM6Gx6fo4kuyHZUIvGoi aBPjuao+h/4H4Ii89o/qjyfzzbGq35+pY6dy8hwySAMSx7LagI76nUhqbRfE2USzZisQ 99HAqckEWAQ/bJ7e6yxCByiAZPhSrRGSsAD82fLBw1An7yx/ysPNU+tU6/C/pM8366UP sN4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707180645; x=1707785445; 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=Q5zixAlF4wZ6FLSTr9hS2N8Z0evbTrh/CxGYDAI0MKE=; b=gfIbPvIwMZHYzXlD9G6tsXssVbnFBkLdG77XggbY99qWz83Hjjzjbe7geAf3GvW9qU 0zLQO5aazP99nYSpLFoPBLnqUX92osYs4KaB9rNkKdtgC2eokMnDPRX7RXHJuV1A6Gcm m49iJ5MuGvJLMdU+TGiecQG11fEZkZRURhyYbIH0JhWcHRQbdL6cLG0TxyM8f5y+BbCl liU3cxoQuGp6O3u5DJDDEDhBEghjkMSA3lN9/MCNtNpHwJsKI8uDXyms9Tj07vJjTi85 bMcruv8BqH+jcouw52hamu2mL0wsNa0gwIVKeL5O4ChnCIZJFaZnq580oNjpBggGM0i6 eViA== X-Gm-Message-State: AOJu0YzN76+LlAxHuB9MWGMX6wiGTq/Q4VPltiQYyU9IAtMi1JSnhy+x VKXgkJ6LW0y+jx77xXqoV2shz6XIkE5jexCwCmyCA3I/iyWntC+Dtb0YZQy4Ghw= X-Google-Smtp-Source: AGHT+IEISFLpty9naf6ZLEqQhCvliwaUFcWUGiW6qTz5b7eqtQ1ISLxAMUTMKSJT0cE5cKJBmS5hFg== X-Received: by 2002:a92:d6cc:0:b0:363:bfc7:74b1 with SMTP id z12-20020a92d6cc000000b00363bfc774b1mr1309408ilp.32.1707180640120; Mon, 05 Feb 2024 16:50:40 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCW65dofP5CJrXYFRlXsf7zFuI6CLu1m2WZvrLIr4gKYVu3QXdzBC3neVb6o6lKqL0GJ65pbqecjNhX937sdpXwRRYjbZdaF+9AE0etnrcRzszPUOymOFVBAvvvldODCHhvxJre8Jxj8WFdJlh6DOzonngBMSOkuxf/zCC/nXSUVKjtlch4GANqxbMbUSzff1l5C6+k4Zb3nUJ4INzwZwdcoJyeMcJ6ftt3qnmm6jt4NBi4P6RUJqCCF5SZESCF368uBBkp2pTo2Glb6jUVfdXjZEm+WxnCBAoPLx516 From: Taylor Simpson To: qemu-devel@nongnu.org Cc: bcain@quicinc.com, quic_mathbern@quicinc.com, sidneym@quicinc.com, quic_mliebel@quicinc.com, richard.henderson@linaro.org, philmd@linaro.org, ale@rev.ng, anjo@rev.ng, ltaylorsimpson@gmail.com Subject: [PATCH v2 3/3] Hexagon (target/hexagon) Only pass env to generated helper when needed Date: Mon, 5 Feb 2024 17:50:34 -0700 Message-Id: <20240206005034.267283-4-ltaylorsimpson@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240206005034.267283-1-ltaylorsimpson@gmail.com> References: <20240206005034.267283-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::12c; envelope-from=ltaylorsimpson@gmail.com; helo=mail-il1-x12c.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: 1707180728754100003 Currently, we pass env to every generated helper. When the semantics of the instruction only depend on the arguments, this is unnecessary and adds extra overhead to the helper call. We add the TCG_CALL_NO_RWG_SE flag to any non-HVX helpers that don't get the ptr to env. The A2_nop and SA1_setin1 instructions end up with no arguments. This results in a "old-style function definition" error from the compiler, so we write overrides for them. With this change, the number of helpers with env argument is idef-parser enabled: 329 total, 23 with env idef-parser disabled: 1543 total, 550 with env Signed-off-by: Taylor Simpson Reviewed-by: Anton Johansson Tested-by: Anton Johansson --- target/hexagon/gen_tcg.h | 3 +++ target/hexagon/gen_helper_protos.py | 10 +++++++++- target/hexagon/hex_common.py | 23 ++++++++++++++++++----- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/target/hexagon/gen_tcg.h b/target/hexagon/gen_tcg.h index 1c4391b415..e9ac2e3fe0 100644 --- a/target/hexagon/gen_tcg.h +++ b/target/hexagon/gen_tcg.h @@ -1369,3 +1369,6 @@ gen_helper_raise_exception(tcg_env, excp); \ } while (0) #endif + +#define fGEN_TCG_A2_nop(SHORTCODE) do { } while (0) +#define fGEN_TCG_SA1_setin1(SHORTCODE) tcg_gen_movi_tl(RdV, -1) diff --git a/target/hexagon/gen_helper_protos.py b/target/hexagon/gen_helpe= r_protos.py index c82b0f54e4..6e98429752 100755 --- a/target/hexagon/gen_helper_protos.py +++ b/target/hexagon/gen_helper_protos.py @@ -40,7 +40,15 @@ def gen_helper_prototype(f, tag, tagregs, tagimms): declared.append(arg.proto_arg) =20 arguments =3D ", ".join(declared) - f.write(f"DEF_HELPER_{len(declared) - 1}({tag}, {arguments})\n") + + ## Add the TCG_CALL_NO_RWG_SE flag to helpers that don't take the env + ## argument and aren't HVX instructions. Since HVX instructions take + ## pointers to their arguments, they will have side effects. + if hex_common.need_env(tag) or hex_common.is_hvx_insn(tag): + f.write(f"DEF_HELPER_{len(declared) - 1}({tag}, {arguments})\n") + else: + f.write(f"DEF_HELPER_FLAGS_{len(declared) - 1}({tag}, " + f"TCG_CALL_NO_RWG_SE, {arguments})\n") =20 =20 def main(): diff --git a/target/hexagon/hex_common.py b/target/hexagon/hex_common.py index eb28aa98fe..ee08195aba 100755 --- a/target/hexagon/hex_common.py +++ b/target/hexagon/hex_common.py @@ -206,6 +206,18 @@ def need_sp(tag): return "A_IMPLICIT_READS_SP" in attribdict[tag] =20 =20 +def is_hvx_insn(tag): + return "A_CVI" in attribdict[tag] + + +def need_env(tag): + return ("A_STORE" in attribdict[tag] or + "A_LOAD" in attribdict[tag] or + "A_CVI_GATHER" in attribdict[tag] or + "A_CVI_SCATTER" in attribdict[tag] or + "A_IMPLICIT_WRITES_USR" in attribdict[tag]) + + def need_slot(tag): if ( "A_CVI_SCATTER" not in attribdict[tag] @@ -1069,11 +1081,12 @@ def helper_args(tag, regs, imms): args =3D [] =20 ## First argument is the CPU state - args.append(HelperArg( - "env", - "tcg_env", - "CPUHexagonState *env" - )) + if need_env(tag): + args.append(HelperArg( + "env", + "tcg_env", + "CPUHexagonState *env" + )) =20 ## For predicated instructions, we pass in the destination register if is_predicated(tag): --=20 2.34.1