From nobody Tue Nov 26 15:24:47 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1707188892; cv=none; d=zohomail.com; s=zohoarc; b=TGqxrvO3TyxIh8uTGK4UXX3ksIwUqj7X2gMtkBylBntaWCxdORntj4GnBoH23ij8pm4fofUjlXy7zz7LWHKXyUgl0YW0zg7f+ODY5NcKhbFwWpPnhxHoznKd2vqJNAGHjBwBhFBVCSfhEkv+6Kn6SmFu3DhOTmAyh0gffU7cFDQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707188892; h=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=AqRQXC9e1yIrSAcLNE1gvR7WQ2p8XFPS+9BATHPSGv4=; b=fWp2x/2K8eKBefnxFrPDPJR2lnywvf6R1LP9c8CdUsHDGtVaE4AjUP7zc3F1d4L//ScUnkSK2ceicqq1r1gSB+leM1wYxehp+D6TTLGbR1w65Cjz85Z3ftGRSrrg4ba8iltK1GjYC6IOuOvlClEpsurNdCtHR+pSorDzY7ZdoDI= 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 1707188892304567.448740017809; Mon, 5 Feb 2024 19:08:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rXBmW-0006wb-If; Mon, 05 Feb 2024 22:05:56 -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 1rXBmU-0006un-Cj for qemu-devel@nongnu.org; Mon, 05 Feb 2024 22:05:54 -0500 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rXBmQ-0003EM-Ad for qemu-devel@nongnu.org; Mon, 05 Feb 2024 22:05:54 -0500 Received: by mail-pg1-x52d.google.com with SMTP id 41be03b00d2f7-5dbcfa0eb5dso442241a12.3 for ; Mon, 05 Feb 2024 19:05:39 -0800 (PST) Received: from stoup.. ([43.252.112.200]) by smtp.gmail.com with ESMTPSA id r14-20020a62e40e000000b006e025030700sm627478pfh.190.2024.02.05.19.05.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 19:05:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707188738; x=1707793538; 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=AqRQXC9e1yIrSAcLNE1gvR7WQ2p8XFPS+9BATHPSGv4=; b=mAzSzR8QPg97G3Y+N95tjnHJQoY6EiI1KX3esKCT+y0QBXkrnlKRYMPMhdB0IIdfAF Hp57b1zl0L7hmkW1Ebt/npDOvkY8YCjgub391hHdoejbk1WQNTrkZVFwxwGUKG4sGwYd 0V1vEb+ZRdPbvNxW7qRzbyOYqF/3ZaoeaWPpaLM9AcFcTAmeI+xGkxvCDMshLmLCrFEY cXPNWDK0Ob/B0C0Ris2ziipU5qxFkipeDLLmTKE2zeOzhvSZUEjSzJx7xmbSpqVyZbx2 lJubaBamTsVNu0eu+CQxhfepSoA4xhXjr4s3+CYBb5l2K4xWmVpPUKu6ph4J43SsLlWP TN5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707188738; x=1707793538; 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=AqRQXC9e1yIrSAcLNE1gvR7WQ2p8XFPS+9BATHPSGv4=; b=QgO4RZVpQCiM7b+BvViL/QDWM/bCg9I2RK16GpgM6uqQ8k6897rOeoSQE6vVp+WWYO xms6ka1uiR3I7iiN23ZKrdLngcDq4JluitOIHpg7luE9TtB5CSK34+44BLXUsnu6aIxJ uKV6DLFJEx3GQ5Cmg2Y27xEhxeWngUhpMqUeDw9tI9AOfRaspkuL9e45EwlnPKSfj5I5 jA4v8P2ZUA9EDvbCFeVsMT5eeD4qoSP237SbAUhVbiOn8VgtkemEBCwMA1kKKzcCImVx H5UjdEBvrEpM2PzI1Tfn7KGNz9rbCqZKOP3xhV9gwQbKismYUI9RhaXAG18Tx8Zl8/sS mmLQ== X-Gm-Message-State: AOJu0Yz9hhR7lpSCTygO7+GThi8JqHRsORWvvWZSQi73+S8yABVsZizp oM9pseyttGs15rZbf8ekCPR6X3iXvisMeHVfx9h1qEtoAmd0dloQ/zSpUfqpqO2NP6+D4jDTdWM f+C0= X-Google-Smtp-Source: AGHT+IF+xZIz24H5/m5NNzK98t572juqzYzNAxlBCebAKeOioTVHcUUloWIWyXlOlzQXOJzMlwv/HA== X-Received: by 2002:a05:6a20:939d:b0:19c:9ea1:692b with SMTP id x29-20020a056a20939d00b0019c9ea1692bmr524716pzh.10.1707188738443; Mon, 05 Feb 2024 19:05:38 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCVyt1Y3IExw8JrgxPhbkw35x8dsDv1Uy4dNgqfJFktsplP9lQgtfPlq/HuYzf3kwqc2Ng3pGZnDPwdvDWOSkM9dm3tmj5z/eUo0JWCUxSaidEMIULQJMsUa3iwGy8ujQowH From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, gustavo.romero@linaro.org, qemu-stable@nongnu.org Subject: [PATCH v2 2/6] target/arm: Fix nregs computation in do_ld_zpa Date: Tue, 6 Feb 2024 13:05:23 +1000 Message-Id: <20240206030527.169147-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240206030527.169147-1-richard.henderson@linaro.org> References: <20240206030527.169147-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::52d; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52d.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 @linaro.org) X-ZM-MESSAGEID: 1707188894139100006 Content-Type: text/plain; charset="utf-8" The field is encoded as [0-3], which is convenient for indexing our array of function pointers, but the true value is [1-4]. Adjust before calling do_mem_zpa. Add an assert, and move the comment re passing ZT to the helper back next to the relevant code. Cc: qemu-stable@nongnu.org Fixes: 206adacfb8d ("target/arm: Add mte helpers for sve scalar + int loads= ") Signed-off-by: Richard Henderson --- target/arm/tcg/translate-sve.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/target/arm/tcg/translate-sve.c b/target/arm/tcg/translate-sve.c index 296e7d1ce2..f50a426c98 100644 --- a/target/arm/tcg/translate-sve.c +++ b/target/arm/tcg/translate-sve.c @@ -4445,11 +4445,7 @@ static void do_mem_zpa(DisasContext *s, int zt, int = pg, TCGv_i64 addr, TCGv_ptr t_pg; int desc =3D 0; =20 - /* - * For e.g. LD4, there are not enough arguments to pass all 4 - * registers as pointers, so encode the regno into the data field. - * For consistency, do this even for LD1. - */ + assert(mte_n >=3D 1 && mte_n <=3D 4); if (s->mte_active[0]) { int msz =3D dtype_msz(dtype); =20 @@ -4463,6 +4459,11 @@ static void do_mem_zpa(DisasContext *s, int zt, int = pg, TCGv_i64 addr, addr =3D clean_data_tbi(s, addr); } =20 + /* + * For e.g. LD4, there are not enough arguments to pass all 4 + * registers as pointers, so encode the regno into the data field. + * For consistency, do this even for LD1. + */ desc =3D simd_desc(vsz, vsz, zt | desc); t_pg =3D tcg_temp_new_ptr(); =20 @@ -4600,7 +4601,7 @@ static void do_ld_zpa(DisasContext *s, int zt, int pg, * accessible via the instruction encoding. */ assert(fn !=3D NULL); - do_mem_zpa(s, zt, pg, addr, dtype, nreg, false, fn); + do_mem_zpa(s, zt, pg, addr, dtype, nreg + 1, false, fn); } =20 static bool trans_LD_zprr(DisasContext *s, arg_rprr_load *a) --=20 2.34.1