From nobody Mon Feb 9 17:47:07 2026 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=1770351868; cv=none; d=zohomail.com; s=zohoarc; b=HZaqkABU6HUsA1xh4yT6ZB7O5cw51zA9wa3uQ/zpdoP03pgs6YTj5/iK04QDR8XM/6KypGvpL7bQQwJLmS0/cvaeMLVkn13kZGFks0tjnyHNbeTZ4qrWuniJUJeARNG8g20ZH97/RVqVqivvenaQa1XMer4yRaR0PWshQz+BiZc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770351868; 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=msDy34BXNBauha6BX6yiPrC2FkV4a2ByUqGrOK5VCFU=; b=PT16KGIKFvGY0Li4reo+dYwa3XGSzrLaxcTlY57Hsh16nXWMuQnV40VwwnSPrMxS4YDLNBrj42hmnP1YicKsdea5KanvwG9BzlC5rpvZ9SmpXgmCPfMjrKu6JFGXaBHXML/Y6BF2WlRLJZaBrf+ouWdF/dNoxDJtUA+P1pAA5Fw= 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 1770351868216315.32075670204244; Thu, 5 Feb 2026 20:24:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1voDM7-0004Jx-NA; Thu, 05 Feb 2026 23:22:07 -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 1voDM6-0004JB-L5 for qemu-devel@nongnu.org; Thu, 05 Feb 2026 23:22:06 -0500 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1voDM3-0003Pw-6p for qemu-devel@nongnu.org; Thu, 05 Feb 2026 23:22:06 -0500 Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-c6541e35fc0so990691a12.3 for ; Thu, 05 Feb 2026 20:22:02 -0800 (PST) Received: from pc.taild8403c.ts.net (216-71-219-44.dyn.novuscom.net. [216.71.219.44]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8244168fdf5sm926914b3a.17.2026.02.05.20.22.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 20:22:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1770351721; x=1770956521; 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=msDy34BXNBauha6BX6yiPrC2FkV4a2ByUqGrOK5VCFU=; b=r3EJKRlOfCw78gptDtHTZjogy4jUyP8Xn4K9HL1R4RQ2QGfkP+hLSlfSSL9QsGI2zH 4hKRQX0LmtjOke669hJ5QjwLIWpKrnlTq/N31it76eFS1mSOK7VZsS6Xa5soMpqKT9EP VfC9hsLum2qgkZJUaTEWpynA7y/54Kto5+MVfeOo2BOTD+FZvoHAtKVeHnFS1T+RtJS8 WWuIHl1Ie96/8WP6r9wZF1xi0aVPXFu3J83sbAscY++k9WUsIzuAMVb6H6Gyj/U2iXQQ Sp0QaynGsjBD+3m1jaF/qr1m8Lw54iRI15zGX12ji2ngY9tdl+hJmqK5KyLRbqyNB8Gx daAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770351721; x=1770956521; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=msDy34BXNBauha6BX6yiPrC2FkV4a2ByUqGrOK5VCFU=; b=FtMcLxVadjvdH54rRULo6ZDzzWq1gY9DyvQMHNqWQifIxgYY0ZwF9M+11ZEZJx9Xgo 1MNlAOqOq256yBAngIsAaP5z3DkrtUCwcjvgMG0DmfpjaOTdopiWwhT+qJ5oOl752ZX4 RwMCfZN2wHsuSk2r0uXhlz2iC7sGpyjhGXWaUQyB+aa9jiyzA95wAMGh5Hkuis4QawU3 EwhVBkQ7i/535zg0d219nLPLV9rCLxV2mNcFTdU5JSKY8HfqofcVNksauPS+td13qn3Q RNMjqVIKmXcK3eAm/YisLSuYSgkPBRPCoexDpKobsYKUyLAMxhbc80Cxfm18OvO8onZR h02Q== X-Gm-Message-State: AOJu0Yy28IC16Y4WZq9FJx2FqSbbpvlxhDE9jVAG3uS7fhfRUbeOs2O2 /WZpMDP1+jWXyJrcsEonthD8A9KcxELeVJe6okt5B3RqfN8Dr4gJNyMKSRNoPco7P8iD5HK/W8i AlX7d X-Gm-Gg: AZuq6aJtBvb6A5DV2tbtT1YuK8Va8mxDdWfi5jywiFkipbZdeuzSTgsVHo5kqxMD2sG WwJ/9cVOCVreetmkiDD0of5++6clHy/vNI/SYYa0risiXIkFCCOsa3GGP1IdU1hn2kOtDAHiqxi NZpgG2UfD6uq/D4YLJkblIyATGhSTAKBIIBuimbSLHsFQaicDTgJeNgirRTgIagEn4TyCH0+I33 heXNten5d082xy6aduTrgUMo2LqBeLo4ncLg/tXgSaStDgDSaKe/hie834rOhHb6A5HxEwNGAkV e84HCLoKR39JcqzjV+vdVJ4ofoXB+MJrbsEQm9vlquxZsv+9FesrxfuedfEKKrliFNikIKyNJAN xR7E4MRZYDVvcGy+gtIrZw82BiRTfzlHmUGaqO4wayR6Daf66nIKNo/2jll8t3AvCeCP/2R+EGn v9n1CHQK/3rahNAa57K4aLzQ2Cl2BlMDmqfmus3oakxn5+Y63F68oJMIk1B5KPXuhr X-Received: by 2002:a17:90b:1650:b0:339:ec9c:b275 with SMTP id 98e67ed59e1d1-354b3c41871mr1384005a91.6.1770351721024; Thu, 05 Feb 2026 20:22:01 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: anjo@rev.ng, Richard Henderson , Jim MacArthur , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell , Paolo Bonzini , kvm@vger.kernel.org, qemu-arm@nongnu.org, Pierrick Bouvier Subject: [PATCH v2 01/12] target/arm/arm-qmp-cmds.c: make compilation unit common Date: Thu, 5 Feb 2026 20:21:39 -0800 Message-ID: <20260206042150.912578-2-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260206042150.912578-1-pierrick.bouvier@linaro.org> References: <20260206042150.912578-1-pierrick.bouvier@linaro.org> 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::536; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pg1-x536.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 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: qemu development 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: 1770351870768154100 Move gic_cap_kvm_probe to target/arm/kvm.c to remove #ifdef CONFIG_KVM. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Pierrick Bouvier --- target/arm/kvm_arm.h | 3 +++ target/arm/arm-qmp-cmds.c | 27 +++------------------------ target/arm/kvm-stub.c | 5 +++++ target/arm/kvm.c | 21 +++++++++++++++++++++ target/arm/meson.build | 2 +- 5 files changed, 33 insertions(+), 25 deletions(-) diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index 6a9b6374a6d..cc0b374254e 100644 --- a/target/arm/kvm_arm.h +++ b/target/arm/kvm_arm.h @@ -11,6 +11,7 @@ #ifndef QEMU_KVM_ARM_H #define QEMU_KVM_ARM_H =20 +#include "qapi/qapi-types-misc-arm.h" #include "system/kvm.h" #include "target/arm/cpu-qom.h" =20 @@ -263,4 +264,6 @@ void kvm_arm_enable_mte(Object *cpuobj, Error **errp); =20 void arm_cpu_kvm_set_irq(void *arm_cpu, int irq, int level); =20 +void arm_gic_cap_kvm_probe(GICCapability *v2, GICCapability *v3); + #endif diff --git a/target/arm/arm-qmp-cmds.c b/target/arm/arm-qmp-cmds.c index 45df15de782..83ec95c290f 100644 --- a/target/arm/arm-qmp-cmds.c +++ b/target/arm/arm-qmp-cmds.c @@ -43,29 +43,6 @@ static GICCapability *gic_cap_new(int version) return cap; } =20 -static inline void gic_cap_kvm_probe(GICCapability *v2, GICCapability *v3) -{ -#ifdef CONFIG_KVM - int fdarray[3]; - - if (!kvm_arm_create_scratch_host_vcpu(fdarray, NULL)) { - return; - } - - /* Test KVM GICv2 */ - if (kvm_device_supported(fdarray[1], KVM_DEV_TYPE_ARM_VGIC_V2)) { - v2->kernel =3D true; - } - - /* Test KVM GICv3 */ - if (kvm_device_supported(fdarray[1], KVM_DEV_TYPE_ARM_VGIC_V3)) { - v3->kernel =3D true; - } - - kvm_arm_destroy_scratch_host_vcpu(fdarray); -#endif -} - GICCapabilityList *qmp_query_gic_capabilities(Error **errp) { GICCapabilityList *head =3D NULL; @@ -74,7 +51,9 @@ GICCapabilityList *qmp_query_gic_capabilities(Error **err= p) v2->emulated =3D true; v3->emulated =3D true; =20 - gic_cap_kvm_probe(v2, v3); + if (kvm_enabled()) { + arm_gic_cap_kvm_probe(v2, v3); + } =20 QAPI_LIST_PREPEND(head, v2); QAPI_LIST_PREPEND(head, v3); diff --git a/target/arm/kvm-stub.c b/target/arm/kvm-stub.c index c93462c5b9b..ea67deea520 100644 --- a/target/arm/kvm-stub.c +++ b/target/arm/kvm-stub.c @@ -124,3 +124,8 @@ bool kvm_arm_cpu_post_load(ARMCPU *cpu) { g_assert_not_reached(); } + +void arm_gic_cap_kvm_probe(GICCapability *v2, GICCapability *v3) +{ + g_assert_not_reached(); +} diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 3e35570f15f..ded582e0da0 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -2580,3 +2580,24 @@ void arm_cpu_kvm_set_irq(void *arm_cpu, int irq, int= level) } kvm_arm_set_irq(cs->cpu_index, KVM_ARM_IRQ_TYPE_CPU, irq_id, !!level); } + +void arm_gic_cap_kvm_probe(GICCapability *v2, GICCapability *v3) +{ + int fdarray[3]; + + if (!kvm_arm_create_scratch_host_vcpu(fdarray, NULL)) { + return; + } + + /* Test KVM GICv2 */ + if (kvm_device_supported(fdarray[1], KVM_DEV_TYPE_ARM_VGIC_V2)) { + v2->kernel =3D true; + } + + /* Test KVM GICv3 */ + if (kvm_device_supported(fdarray[1], KVM_DEV_TYPE_ARM_VGIC_V3)) { + v3->kernel =3D true; + } + + kvm_arm_destroy_scratch_host_vcpu(fdarray); +} diff --git a/target/arm/meson.build b/target/arm/meson.build index 462c71148d2..1a1bcde2601 100644 --- a/target/arm/meson.build +++ b/target/arm/meson.build @@ -16,7 +16,7 @@ arm_common_ss.add(files( 'mmuidx.c', )) =20 -arm_system_ss.add(files( +arm_common_system_ss.add(files( 'arm-qmp-cmds.c', )) arm_system_ss.add(when: 'CONFIG_KVM', if_true: files('hyp_gdbstub.c', 'kvm= .c')) --=20 2.47.3 From nobody Mon Feb 9 17:47:07 2026 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=1770351838; cv=none; d=zohomail.com; s=zohoarc; b=EsOrNllG6356eHwWVwq36lpY56n/Em2y5cG6Zxr2o92EiWpeTSQEejhHQOleC2OjXs1qxxr/Btd5TpYk7ZEKuv0GEpHY4JRzhltrPnDEU5zfRLtyldZzeWkAducVwq9vqeaZ91K+QdujptPCVn4I7h8NWnDkz1AXU8sodrlcync= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770351838; 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=SLG6GFjz6gMYPUgqxMsYfEaJwPICYaIcXQ6XuIJ4wGg=; b=Q0dD0VloPe3jyp6aJpr4xqd3PZgx/3IShxTK3Rmw/+q62PjgJ5RS2/pY/Gm/aqXOrVeitGHOYRw1DlhLvH0nRYhTswB38Xoi3p/3ywp3YxuYSsQ5/wCesS3Pm57EN0fV8mVBqCeBVskKd4lJmGeRf76oWDsMggWikz01sIk+4L8= 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 1770351838196343.7476182526568; Thu, 5 Feb 2026 20:23:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1voDM9-0004Kz-5n; Thu, 05 Feb 2026 23:22:09 -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 1voDM7-0004JY-2U for qemu-devel@nongnu.org; Thu, 05 Feb 2026 23:22:07 -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 1voDM3-0003Q1-8X for qemu-devel@nongnu.org; Thu, 05 Feb 2026 23:22:06 -0500 Received: by mail-pg1-x52d.google.com with SMTP id 41be03b00d2f7-c61343f82d7so95317a12.1 for ; Thu, 05 Feb 2026 20:22:02 -0800 (PST) Received: from pc.taild8403c.ts.net (216-71-219-44.dyn.novuscom.net. [216.71.219.44]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8244168fdf5sm926914b3a.17.2026.02.05.20.22.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 20:22:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1770351722; x=1770956522; 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=SLG6GFjz6gMYPUgqxMsYfEaJwPICYaIcXQ6XuIJ4wGg=; b=TUOTn8GEggHHjtDWJ9x7FP7zDZGoct7wP0HprIrwdy1nHlxftdD+rPymEbwCAsctKi K/eYxDrZggOkB61uwlRtiB0OUfO6xyaBnrVPeVedYaa870bwqRfmeSL/IOY01236oYaW fB+xybqeik8fv4TRQ0dNRFWhAovA8/YgiaVdUQrDu6PhxES+xaL/qFfMvx7GJhcl15vl cgOaQRPBQJTPIBRrZLlWGtedn9sAuBlpukhyGRlQRr8dcXiPnOuOiDI2JqN40W/eBSCa bAs2PucrE5WTJXZVskagMLSzkOsMOxEc2GV6gccR3Ceg2oDu8S0o+nnVLSvM+skpVAFk SSug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770351722; x=1770956522; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=SLG6GFjz6gMYPUgqxMsYfEaJwPICYaIcXQ6XuIJ4wGg=; b=OpOBZUzxjiD3HzKGOag1vQvR4E4z58K6dP90ban/CMvoGbkiwDwtOrhZ15bptpPA6V QP0Ajb0RucpxClwqSSiR8pgm13sGoXb8noBQxiz8LHibe3g5potvGyisA638lVWzzI7P s7XBH7LdE/vh1qgZb60cVre+Qn1EsdukFqfP5ZGJIYI0Fm0OX6uyjlSgkVHDeVnertCa 9sgcbLVUWPRKXkfZbrDmq7Mv0+QlcjXqGKSWQ3MoLImKYB5unZhuH4UlX84pSXpDFKyF k+ISwqiEhkjlQEcuEpq7XDuBhDSRGeAJOTfpe2Mz2bEjLV/ZzQsySDn9nQqwBD9oGdUi hzjw== X-Gm-Message-State: AOJu0YzI/2fYmeY2k+agU83WjDZ+qQSQYL+Pm1euF6CdXQelYO6I7JdF b1r3HotBQEgQwYCvA63cMQIj7GqlOY0vFfBiOtBYN0/kdu8vi3yCuj3tPRLpTTSFFZyi3/O5Ebu jMuJ+ X-Gm-Gg: AZuq6aK1nI3WL/DAYE7jxsm+m55mQfmBWfJnq9jjDuXKAzXsGTf/M5OpiQWCnfDRiHM drLyx/pRwqtBVM9BVf9KMzwB33CwVuplPW9Wme5G9ew2+t+sTtqWAYbOBgtzpP5E4Q86L9Ss/rr sP5/RLrGeqR2SWdbOrRGOw/x9n3fRkaoV2t/icVSasuuCp7eIDsylgfmk1roosblToJiBjOOkY9 etSma8W8HavPEcW8s7YUaTiRQhGvQPKeUCGarIIqRRLxDrjeoqchekAgs6/eoTRo9nDtMSclOuq /9c3SmtNwGMHj40xZsNWOP+5T3tLv5Wt0G2wEJ07bqkzxACnQ0Zp8K58CytEchuBrzP1p7IgztA cOk7c8eOJE6iurxhGQCTKp+66RWFZld9yyRoyumZjaDJzVmPFxKgbUWEmKr4TqrmG3keGS2/ggx zeQxYQiHovdHQncjZfcthT5k5Dl47Xs/yVcnN3uNQrbsC4ZredNW9AD5Q5kL04VY8G X-Received: by 2002:a17:90b:3a05:b0:33b:a906:e40 with SMTP id 98e67ed59e1d1-354b3c3823amr1156910a91.2.1770351721846; Thu, 05 Feb 2026 20:22:01 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: anjo@rev.ng, Richard Henderson , Jim MacArthur , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell , Paolo Bonzini , kvm@vger.kernel.org, qemu-arm@nongnu.org, Pierrick Bouvier Subject: [PATCH v2 02/12] target/arm: extract helper-mve.h from helper.h Date: Thu, 5 Feb 2026 20:21:40 -0800 Message-ID: <20260206042150.912578-3-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260206042150.912578-1-pierrick.bouvier@linaro.org> References: <20260206042150.912578-1-pierrick.bouvier@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=pierrick.bouvier@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 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: qemu development 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: 1770351839875158500 Content-Type: text/plain; charset="utf-8" A few points to mention: - We mix helper prototypes and gen_helper definitions in a single header for convenience and to avoid headers boilerplate. - We rename existing tcg/helper-mve.h to helper-mve-defs.h to avoid conflict when including helper-mve.h. - We move mve helper_info definitions to tcg/mve_helper.c We'll repeat the same for other helpers. This allow to get rid of TARGET_AARCH64 in target/arm/helper.h. Signed-off-by: Pierrick Bouvier --- target/arm/helper-mve.h | 14 ++++++++++++++ target/arm/helper.h | 2 -- target/arm/tcg/{helper-mve.h =3D> helper-mve-defs.h} | 0 target/arm/tcg/mve_helper.c | 4 ++++ target/arm/tcg/translate-mve.c | 1 + target/arm/tcg/translate.c | 1 + 6 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 target/arm/helper-mve.h rename target/arm/tcg/{helper-mve.h =3D> helper-mve-defs.h} (100%) diff --git a/target/arm/helper-mve.h b/target/arm/helper-mve.h new file mode 100644 index 00000000000..32ef3f64661 --- /dev/null +++ b/target/arm/helper-mve.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef HELPER_MVE_H +#define HELPER_MVE_H + +#include "exec/helper-proto-common.h" +#include "exec/helper-gen-common.h" + +#define HELPER_H "tcg/helper-mve-defs.h" +#include "exec/helper-proto.h.inc" +#include "exec/helper-gen.h.inc" +#undef HELPER_H + +#endif /* HELPER_MVE_H */ diff --git a/target/arm/helper.h b/target/arm/helper.h index f340a49a28a..44c7f3ed751 100644 --- a/target/arm/helper.h +++ b/target/arm/helper.h @@ -7,5 +7,3 @@ #include "tcg/helper-sve.h" #include "tcg/helper-sme.h" #endif - -#include "tcg/helper-mve.h" diff --git a/target/arm/tcg/helper-mve.h b/target/arm/tcg/helper-mve-defs.h similarity index 100% rename from target/arm/tcg/helper-mve.h rename to target/arm/tcg/helper-mve-defs.h diff --git a/target/arm/tcg/mve_helper.c b/target/arm/tcg/mve_helper.c index 63ddcf3fecf..f33642df1f9 100644 --- a/target/arm/tcg/mve_helper.c +++ b/target/arm/tcg/mve_helper.c @@ -19,6 +19,7 @@ =20 #include "qemu/osdep.h" #include "cpu.h" +#include "helper-mve.h" #include "internals.h" #include "vec_internal.h" #include "exec/helper-proto.h" @@ -27,6 +28,9 @@ #include "fpu/softfloat.h" #include "crypto/clmul.h" =20 +#define HELPER_H "tcg/helper-mve-defs.h" +#include "exec/helper-info.c.inc" + static uint16_t mve_eci_mask(CPUARMState *env) { /* diff --git a/target/arm/tcg/translate-mve.c b/target/arm/tcg/translate-mve.c index b1a8d6a65c0..4ca88f4d3a3 100644 --- a/target/arm/tcg/translate-mve.c +++ b/target/arm/tcg/translate-mve.c @@ -18,6 +18,7 @@ */ =20 #include "qemu/osdep.h" +#include "helper-mve.h" #include "translate.h" #include "translate-a32.h" =20 diff --git a/target/arm/tcg/translate.c b/target/arm/tcg/translate.c index 63735d97898..febb7f1532a 100644 --- a/target/arm/tcg/translate.c +++ b/target/arm/tcg/translate.c @@ -28,6 +28,7 @@ #include "cpregs.h" #include "exec/helper-proto.h" #include "exec/target_page.h" +#include "helper-mve.h" =20 #define HELPER_H "helper.h" #include "exec/helper-info.c.inc" --=20 2.47.3 From nobody Mon Feb 9 17:47:07 2026 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=1770351838; cv=none; d=zohomail.com; s=zohoarc; b=Wt+/O978clACEQEw9dQrPx0J2dCPYudBzZDFJ7vUgsNGaIeAismoas/MEeeN/7vW4sC0mmEW+Agf0Qtgv6UC32oNaAXdSsDAxIh8mwfJCgL2H8hAtoeuQBJ3amhnhK7z4j0pGkXtvTg/R44Zy0qQjLyIDJQzfvf81ABEaClekew= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770351838; 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=3Lk/jdHTDjt74Lp5Po40mEBHEbq+K7p4bEQ2ho7U/vE=; b=l3l12ipT/4qZjr8XRZGq18RY1nteqxZwujnPb4GBDCAwC5G7dIXNK2zReu6xn8rzYytBqeZT8JXVhPsCjbmMsyN+PbxrP/52FFI0c/1AYqmh00LSwv6eV0gMKJLsTfvIEw+Ice0K8vJfDml6/kb+oPbTPZP3zSpFpZGhZv23FG0= 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 177035183851168.40680754693881; Thu, 5 Feb 2026 20:23:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1voDMB-0004Mm-39; Thu, 05 Feb 2026 23:22:11 -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 1voDM8-0004KG-7n for qemu-devel@nongnu.org; Thu, 05 Feb 2026 23:22:08 -0500 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1voDM4-0003QA-6Y for qemu-devel@nongnu.org; Thu, 05 Feb 2026 23:22:07 -0500 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-81f39438187so1227833b3a.2 for ; Thu, 05 Feb 2026 20:22:03 -0800 (PST) Received: from pc.taild8403c.ts.net (216-71-219-44.dyn.novuscom.net. [216.71.219.44]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8244168fdf5sm926914b3a.17.2026.02.05.20.22.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 20:22:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1770351723; x=1770956523; 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=3Lk/jdHTDjt74Lp5Po40mEBHEbq+K7p4bEQ2ho7U/vE=; b=n2XrrVWaARCGSO0rHOSdsD0LJ8J12Ci/zYzzAeZGTCfNFvIeHMemCZ5JwvPT3941kg nwameDGT/UF91yvqueGozsqiTYA3hhm1zF/IL2xIxFD7vuuFJNS/csD6+/cJyuAjSnT8 i1b6pHMq0BAldhe7fo8UKD8Wgpqh2LCgdIhT/BFZHLUuWYRvAZSPpb400bTWFvMOq1rn NwVgPnBp4r0VW+/ZNKPrSvjGhLzW5fQl4Uv69eoHhXDegLhmHQWpZXHYExrkKlZ9y1TR +o7crTt++BWUWP7qQaYtSOPRiBl/FiYdm6WnaX0e34kTnyKQMuNR4vesd0NLqr8rjJ2D k63A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770351723; x=1770956523; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=3Lk/jdHTDjt74Lp5Po40mEBHEbq+K7p4bEQ2ho7U/vE=; b=gmfdlUfFfFTqmck2b7va+g4WI2SC18F/vLeb1sbs3x+37B0GO22dP/Rq4wLc7Sgc33 jUnRsHQ+DVtJ+QgfEjCrpDChjjdBcJ4bswUic2NAs5hsHaTe9nDkQ+nBtdXnN9Q8EqP9 u+Gu3mM1KntAhOGsvwzM/TvujX0A7yGAqIugeXbD/II+6aNWK90txqitSREjvHKVLOEn qhN3K2A8Jxnb9WfaIVzeU2u3KeX4O6uLZjpxOFFrZq8asX+Qv0MqBbvvpOLD5msrKzVz 7QTga9dVbxsuYGpB4kEXoU45nvzqcae6zpRhmOZV9oGOyDArOuPOigDkcRruVnibvdP/ VDgg== X-Gm-Message-State: AOJu0YxYifj23Ze6LyG2SaUbgB6jXujv10Oq1JTWgCJ8uucQnoSSLxpC pW40gMa8GscLTgXFbj7B+t85EHuoQmMAzXMrYidzQs5hm2QoxonPzGKVLQKdMcd6LgNCBLNtBXV GP+XB X-Gm-Gg: AZuq6aJaEbH0qEKdR5YWfGert6f/vZEuMkh9S/FaGYCDtErjmCWRIHtDmn91jy5+6Xz CQEJX2Jo6a+oBYcRDRbHDrXogwiGZHdYQCEsnVwm5q1oVxbwFosJX8+RemAU3/ymEMn1MbsU52N jBXip/0t6khBxCyYBj+m353CCIqImGLGNWCNtV/kf1CCyB/iXGI51BpcbzF6pjiPnjL6SEnHPRB c/CyDpmXnsNkzzJtJ1mCbvQU15A1U9vUzr5o5pkI0o3cvIH0iVZ/Ul5Qfw2DMn3IVLlTzDDJGky Bf3RTB4OOVmTTj6Yn1usswqvzgrMgp6x+thlqAcZhICyfF0ENdLnPgZWBLzNUEy6GJgRqVx5vHQ xLo2Rghh7SDREwsLfvXJx1QEhQFMToWUZvO7b1qJQjYM6WSbweGmFyIYtFrOSYN/o8vzIDxBRhQ X16JjfrlBfPWM7PqZs7wGGVEx5qulW7ElwGmigE7xxHNd0N0KuzrzxxKF1B892rO59 X-Received: by 2002:a05:6a00:4215:b0:81f:3d13:e07b with SMTP id d2e1a72fcca58-824416f29bfmr1053511b3a.43.1770351722621; Thu, 05 Feb 2026 20:22:02 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: anjo@rev.ng, Richard Henderson , Jim MacArthur , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell , Paolo Bonzini , kvm@vger.kernel.org, qemu-arm@nongnu.org, Pierrick Bouvier Subject: [PATCH v2 03/12] target/arm: extract helper-a64.h from helper.h Date: Thu, 5 Feb 2026 20:21:41 -0800 Message-ID: <20260206042150.912578-4-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260206042150.912578-1-pierrick.bouvier@linaro.org> References: <20260206042150.912578-1-pierrick.bouvier@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::430; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pf1-x430.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 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: qemu development 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: 1770351839994158500 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pierrick Bouvier Reviewed-by: Richard Henderson --- target/arm/helper-a64.h | 14 ++++++++++++++ target/arm/helper.h | 1 - target/arm/tcg/{helper-a64.h =3D> helper-a64-defs.h} | 0 target/arm/tcg/helper-a64.c | 4 ++++ target/arm/tcg/mte_helper.c | 1 + target/arm/tcg/pauth_helper.c | 1 + target/arm/tcg/sve_helper.c | 1 + target/arm/tcg/translate-a64.c | 1 + target/arm/tcg/vec_helper.c | 1 + 9 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 target/arm/helper-a64.h rename target/arm/tcg/{helper-a64.h =3D> helper-a64-defs.h} (100%) diff --git a/target/arm/helper-a64.h b/target/arm/helper-a64.h new file mode 100644 index 00000000000..cda7e039b72 --- /dev/null +++ b/target/arm/helper-a64.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef HELPER_A64_H +#define HELPER_A64_H + +#include "exec/helper-proto-common.h" +#include "exec/helper-gen-common.h" + +#define HELPER_H "tcg/helper-a64-defs.h" +#include "exec/helper-proto.h.inc" +#include "exec/helper-gen.h.inc" +#undef HELPER_H + +#endif /* HELPER_A64_H */ diff --git a/target/arm/helper.h b/target/arm/helper.h index 44c7f3ed751..79f8de1e169 100644 --- a/target/arm/helper.h +++ b/target/arm/helper.h @@ -3,7 +3,6 @@ #include "tcg/helper.h" =20 #ifdef TARGET_AARCH64 -#include "tcg/helper-a64.h" #include "tcg/helper-sve.h" #include "tcg/helper-sme.h" #endif diff --git a/target/arm/tcg/helper-a64.h b/target/arm/tcg/helper-a64-defs.h similarity index 100% rename from target/arm/tcg/helper-a64.h rename to target/arm/tcg/helper-a64-defs.h diff --git a/target/arm/tcg/helper-a64.c b/target/arm/tcg/helper-a64.c index e4d2c2e3928..07ddfb895dd 100644 --- a/target/arm/tcg/helper-a64.c +++ b/target/arm/tcg/helper-a64.c @@ -22,6 +22,7 @@ #include "cpu.h" #include "gdbstub/helpers.h" #include "exec/helper-proto.h" +#include "helper-a64.h" #include "qemu/host-utils.h" #include "qemu/log.h" #include "qemu/main-loop.h" @@ -43,6 +44,9 @@ #endif #include "vec_internal.h" =20 +#define HELPER_H "tcg/helper-a64-defs.h" +#include "exec/helper-info.c.inc" + /* C2.4.7 Multiply and divide */ /* special cases for 0 and LLONG_MIN are mandated by the standard */ uint64_t HELPER(udiv64)(uint64_t num, uint64_t den) diff --git a/target/arm/tcg/mte_helper.c b/target/arm/tcg/mte_helper.c index 08b8e7176a6..01b7f099f4a 100644 --- a/target/arm/tcg/mte_helper.c +++ b/target/arm/tcg/mte_helper.c @@ -31,6 +31,7 @@ #endif #include "accel/tcg/cpu-ldst.h" #include "accel/tcg/probe.h" +#include "helper-a64.h" #include "exec/helper-proto.h" #include "exec/tlb-flags.h" #include "accel/tcg/cpu-ops.h" diff --git a/target/arm/tcg/pauth_helper.c b/target/arm/tcg/pauth_helper.c index c591c3052c3..5a20117ae89 100644 --- a/target/arm/tcg/pauth_helper.c +++ b/target/arm/tcg/pauth_helper.c @@ -22,6 +22,7 @@ #include "internals.h" #include "cpu-features.h" #include "accel/tcg/cpu-ldst.h" +#include "helper-a64.h" #include "exec/helper-proto.h" #include "tcg/tcg-gvec-desc.h" #include "qemu/xxhash.h" diff --git a/target/arm/tcg/sve_helper.c b/target/arm/tcg/sve_helper.c index c442fcb540d..0600eea47c7 100644 --- a/target/arm/tcg/sve_helper.c +++ b/target/arm/tcg/sve_helper.c @@ -24,6 +24,7 @@ #include "exec/helper-proto.h" #include "exec/target_page.h" #include "exec/tlb-flags.h" +#include "helper-a64.h" #include "tcg/tcg-gvec-desc.h" #include "fpu/softfloat.h" #include "tcg/tcg.h" diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 7a8cd99e004..1a54337b6a8 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -18,6 +18,7 @@ */ #include "qemu/osdep.h" #include "exec/target_page.h" +#include "helper-a64.h" #include "translate.h" #include "translate-a64.h" #include "qemu/log.h" diff --git a/target/arm/tcg/vec_helper.c b/target/arm/tcg/vec_helper.c index 33a136b90a6..7451a283efa 100644 --- a/target/arm/tcg/vec_helper.c +++ b/target/arm/tcg/vec_helper.c @@ -20,6 +20,7 @@ #include "qemu/osdep.h" #include "cpu.h" #include "exec/helper-proto.h" +#include "helper-a64.h" #include "tcg/tcg-gvec-desc.h" #include "fpu/softfloat.h" #include "qemu/int128.h" --=20 2.47.3 From nobody Mon Feb 9 17:47:07 2026 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=1770351846; cv=none; d=zohomail.com; s=zohoarc; b=Pd2Yd43GRDnw7RVLDZj5QcANVVi2FsXOMd8jUZt8cnYrm6fGTyRWniqLEy2yToo3zHTdPmHVBB/R1182/EhnwfsMccB9mY2VLboyCaRTa4wS0rPI9b9RqdSCEwT6YhrujyCRgCAmiu/nAOmRxSdQXTkfa0NxkQlAd5YBOBVSJbA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770351846; 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=YLdsG4HlWuWSh+GlyasLIetJzfEL7Zerke5StBuCcPc=; b=oLbUPbA6QNlmo1KNXxUZyocvoFvRVORbccHJT1VRhozH50+IChURT+p+idUPbbrnHwmPnwwj9XDEsGcmpi9W51DkaOEYvcaCkn91092Oavk9WkNIN3KFE1JQZy+nBs+69bCSAB1Vx5tLEM1GcN1AKiKaX3eKt1/mrPdEIof9858= 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 1770351846580852.818348499133; Thu, 5 Feb 2026 20:24:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1voDMA-0004Lp-Ab; Thu, 05 Feb 2026 23:22:10 -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 1voDM8-0004Kb-HR for qemu-devel@nongnu.org; Thu, 05 Feb 2026 23:22:08 -0500 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1voDM5-0003Qt-4u for qemu-devel@nongnu.org; Thu, 05 Feb 2026 23:22:08 -0500 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-8217f2ad01eso1464332b3a.2 for ; Thu, 05 Feb 2026 20:22:04 -0800 (PST) Received: from pc.taild8403c.ts.net (216-71-219-44.dyn.novuscom.net. [216.71.219.44]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8244168fdf5sm926914b3a.17.2026.02.05.20.22.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 20:22:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1770351724; x=1770956524; 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=YLdsG4HlWuWSh+GlyasLIetJzfEL7Zerke5StBuCcPc=; b=XjHWJYWffwCDtBjfCHJUiP+WmvvhCoSZzU9VWHBbg53MRED8+AvBP4QizfF+qwf0Tk RDiyHB3xBnwHHLM51xF5fKC3bDChe07Ia04+C2nuU2MoRFLhy6sgC/Vj8ULGsvYa7rMb ZXPuomGUIstpvN3nPl883ixI9jcJiZhePh60arQhfOvp9eJTulwplufCtRRUbToYnM1z erXxpc0yL5hn8EQ9JrgCL+e2yStU7etfHbbLhg7fKGzIh7eq2yDf6gf+LBn4LcwL2QPy iY1nThyl2W7oZ7VzrYKmP2FuxulDTQrw0c9tLYFeRcqM/Ry0dMIglkfZjigRW/Caz52j FjUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770351724; x=1770956524; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=YLdsG4HlWuWSh+GlyasLIetJzfEL7Zerke5StBuCcPc=; b=iNdzxcDAeCNF8IzvopzMwZjcAV6RX2/TtAPx0Vo7FoNbPSd6/j28eZ5Wnx8icEH7+4 Ntxn/f6ZmhilXr6D/u00qX9/UoAShc0LxkTGMy6/YuoHXyNgSFWHL7CXF+a6xxmo3A4J cttQ01otlZ9iP+a3cH/cnr7EAFT6Yn8f1DLKwJje/tQDzgw4Encom4f0BoCWoPqcjPDj 3hl1VDwvSHtq7BwYZKk7IVkuWLw69rNrlde0kBKeki0bQlt0ZhICYhgma4ABF5TrnQ4m D6zU+kK/jYvNwNXeLCtaz/2kionoeMqZwQSToAAin0361e7xS/MAdWGj5gWAa2dX1TpD +EDw== X-Gm-Message-State: AOJu0YyVvK/T8V3+N2cTMO5wtO2hYi8JOd5l91ySoERM91qgE6JoVVka ftKwFEOdmdbmjRlqpg+M4McyZ+Uq4lJSlXj43+Y5Dkp2Q3h5cfZUa7W7f8YQbaPWgqEYcn+dghi W8L0y X-Gm-Gg: AZuq6aKMYtzaxlmx9EolRxC4lU6vyonbLZLhLTS/PQnHe9J5Q1eeAaatS/yYgWasunQ ayJ7+LeuIloPYwMtTADGpqClVX9GANCaFZJIt85Sj2u+oefk8j2xJsj0pH4tM174pw5pTa6av++ BqLOeiWbSzthgjC11o83qG0fa0hcYamj4PrBlKjclSqlPMDIWZJsRN06aAXvplArN3CZ0xRbWrt X68fG49VWeOi4dd9aU6f0X+huKVp0Ezm8RnG/mh8Zll0lP+qMmAmmowOhWNw8ozE1BOJubT5bZG 4Nax5un4bTn748jM2Gq9ubH9OLiLolqEKSwc5Ckr/Mtz8+hPFytt5FhymCZ4KqBOOZr2MxIRB5K qxaQL0cjnCU7yxvp0gEFN40M86OKVwHPpv/tY/nB+Uo8ECin9DLF7KdYTxVePyWg1qf0dW1Ng0D /BpxMA8tVM5xz2yLKzezhFydnMg5l7qaSSs/y00flw6wzFHaZDmcj1e+xiwyg1xmPz X-Received: by 2002:a05:6a00:2341:b0:81e:f623:b9fe with SMTP id d2e1a72fcca58-82441607461mr1345030b3a.4.1770351723650; Thu, 05 Feb 2026 20:22:03 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: anjo@rev.ng, Richard Henderson , Jim MacArthur , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell , Paolo Bonzini , kvm@vger.kernel.org, qemu-arm@nongnu.org, Pierrick Bouvier Subject: [PATCH v2 04/12] target/arm: extract helper-sve.h from helper.h Date: Thu, 5 Feb 2026 20:21:42 -0800 Message-ID: <20260206042150.912578-5-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260206042150.912578-1-pierrick.bouvier@linaro.org> References: <20260206042150.912578-1-pierrick.bouvier@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::42a; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pf1-x42a.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 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: qemu development 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: 1770351848261154100 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pierrick Bouvier Reviewed-by: Richard Henderson --- target/arm/helper-sve.h | 14 ++++++++++++++ target/arm/helper.h | 1 - target/arm/tcg/{helper-sve.h =3D> helper-sve-defs.h} | 0 target/arm/tcg/gengvec64.c | 3 ++- target/arm/tcg/sve_helper.c | 3 +++ target/arm/tcg/translate-a64.c | 1 + target/arm/tcg/translate-sme.c | 2 ++ target/arm/tcg/translate-sve.c | 2 ++ target/arm/tcg/vec_helper.c | 1 + 9 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 target/arm/helper-sve.h rename target/arm/tcg/{helper-sve.h =3D> helper-sve-defs.h} (100%) diff --git a/target/arm/helper-sve.h b/target/arm/helper-sve.h new file mode 100644 index 00000000000..ae4f46c70a0 --- /dev/null +++ b/target/arm/helper-sve.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef HELPER_SVE_H +#define HELPER_SVE_H + +#include "exec/helper-proto-common.h" +#include "exec/helper-gen-common.h" + +#define HELPER_H "tcg/helper-sve-defs.h" +#include "exec/helper-proto.h.inc" +#include "exec/helper-gen.h.inc" +#undef HELPER_H + +#endif /* HELPER_SVE_H */ diff --git a/target/arm/helper.h b/target/arm/helper.h index 79f8de1e169..2f724643d39 100644 --- a/target/arm/helper.h +++ b/target/arm/helper.h @@ -3,6 +3,5 @@ #include "tcg/helper.h" =20 #ifdef TARGET_AARCH64 -#include "tcg/helper-sve.h" #include "tcg/helper-sme.h" #endif diff --git a/target/arm/tcg/helper-sve.h b/target/arm/tcg/helper-sve-defs.h similarity index 100% rename from target/arm/tcg/helper-sve.h rename to target/arm/tcg/helper-sve-defs.h diff --git a/target/arm/tcg/gengvec64.c b/target/arm/tcg/gengvec64.c index c425d2b1490..c7bdd1ea82f 100644 --- a/target/arm/tcg/gengvec64.c +++ b/target/arm/tcg/gengvec64.c @@ -18,10 +18,11 @@ */ =20 #include "qemu/osdep.h" +#include "cpu.h" +#include "helper-sve.h" #include "translate.h" #include "translate-a64.h" =20 - static void gen_rax1_i64(TCGv_i64 d, TCGv_i64 n, TCGv_i64 m) { tcg_gen_rotli_i64(d, m, 1); diff --git a/target/arm/tcg/sve_helper.c b/target/arm/tcg/sve_helper.c index 0600eea47c7..16e528e41a6 100644 --- a/target/arm/tcg/sve_helper.c +++ b/target/arm/tcg/sve_helper.c @@ -25,6 +25,7 @@ #include "exec/target_page.h" #include "exec/tlb-flags.h" #include "helper-a64.h" +#include "helper-sve.h" #include "tcg/tcg-gvec-desc.h" #include "fpu/softfloat.h" #include "tcg/tcg.h" @@ -38,6 +39,8 @@ #include "user/page-protection.h" #endif =20 +#define HELPER_H "tcg/helper-sve-defs.h" +#include "exec/helper-info.c.inc" =20 /* Return a value for NZCV as per the ARM PredTest pseudofunction. * diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 1a54337b6a8..31fb2ea9cc3 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -19,6 +19,7 @@ #include "qemu/osdep.h" #include "exec/target_page.h" #include "helper-a64.h" +#include "helper-sve.h" #include "translate.h" #include "translate-a64.h" #include "qemu/log.h" diff --git a/target/arm/tcg/translate-sme.c b/target/arm/tcg/translate-sme.c index 091c56da4f4..463ece97ab8 100644 --- a/target/arm/tcg/translate-sme.c +++ b/target/arm/tcg/translate-sme.c @@ -18,6 +18,8 @@ */ =20 #include "qemu/osdep.h" +#include "cpu.h" +#include "helper-sve.h" #include "translate.h" #include "translate-a64.h" =20 diff --git a/target/arm/tcg/translate-sve.c b/target/arm/tcg/translate-sve.c index 64adb5c1ce3..c68a44aff8c 100644 --- a/target/arm/tcg/translate-sve.c +++ b/target/arm/tcg/translate-sve.c @@ -18,6 +18,8 @@ */ =20 #include "qemu/osdep.h" +#include "cpu.h" +#include "helper-sve.h" #include "translate.h" #include "translate-a64.h" #include "fpu/softfloat.h" diff --git a/target/arm/tcg/vec_helper.c b/target/arm/tcg/vec_helper.c index 7451a283efa..bc64c8ff374 100644 --- a/target/arm/tcg/vec_helper.c +++ b/target/arm/tcg/vec_helper.c @@ -21,6 +21,7 @@ #include "cpu.h" #include "exec/helper-proto.h" #include "helper-a64.h" +#include "helper-sve.h" #include "tcg/tcg-gvec-desc.h" #include "fpu/softfloat.h" #include "qemu/int128.h" --=20 2.47.3 From nobody Mon Feb 9 17:47:07 2026 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=1770351773; cv=none; d=zohomail.com; s=zohoarc; b=FDbYf6v9X3YnIzxMKRjiaIKaRWRe+eSN/Vm28LwGkenk7Rz66lxmAAoOyehcz0pHCEQpCfvOuJ8+lI0k7IXd/+mCmtFUKqxYYyayNNgzhAgWG3c7sNaOV6rcgoYxweXIHfW2cC+IGPHemENa8kEkPETekl+9w/EgSOqPMDhsbdE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770351773; 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=NNi8czf1/CFVr3JdN24WUseqYsA6Bdj1+/T6IG97cXc=; b=QYSVRa2CGIfSosl6FNWLY+xSBCZCd1VRk2H1nNCCcnfVea0VKDrZSiYq1UE4GFwuS4oyn828DHA/AsKzi3MBCVsBtTwZPPSco8DEsPM4lauDIr53edSj9m027LqV7rIqX8NhrnfvPzzmQRjqUKxwSn/mXaae0/zbwUDBZQnYCTs= 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 1770351773352456.3174635464675; Thu, 5 Feb 2026 20:22:53 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1voDMC-0004O9-Km; Thu, 05 Feb 2026 23:22:12 -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 1voDM9-0004LG-JG for qemu-devel@nongnu.org; Thu, 05 Feb 2026 23:22:09 -0500 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1voDM5-0003Rr-QB for qemu-devel@nongnu.org; Thu, 05 Feb 2026 23:22:09 -0500 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-81f39438187so1227851b3a.2 for ; Thu, 05 Feb 2026 20:22:05 -0800 (PST) Received: from pc.taild8403c.ts.net (216-71-219-44.dyn.novuscom.net. [216.71.219.44]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8244168fdf5sm926914b3a.17.2026.02.05.20.22.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 20:22:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1770351724; x=1770956524; 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=NNi8czf1/CFVr3JdN24WUseqYsA6Bdj1+/T6IG97cXc=; b=QlZUyOcDmcOP0kIGqSmm6GCfnbo1o20QMnSI6ztuNm3fJbtFBhTTjVXPx0OB9jbIML YFgghe2kXiwxsPUDYA5aO9zoOE50v9VXVxNH1uHS8XIg9VFsclTUL3KtNbM9KNa+Lzed Ttd3vgyc4CT/0QbCxHP+DviAiZLFoxW0UAMVckbA28ZhJwGZs1X6QdLzkBL12462q2ew 9HkiBw1D7BKqVIflFn9duREyI3enLVskLxFh1UCgioIit/6ndFx8DsmSG+9NPgwpXPyE ncRmeK2IdDrMufwZhbU9KdLnNrx8JSNxZ2JHu5eH6qxglMnfKeiJ3l3I8r6QbKfWPndo o5oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770351724; x=1770956524; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=NNi8czf1/CFVr3JdN24WUseqYsA6Bdj1+/T6IG97cXc=; b=QofEWtXmiHDx1TfH5kl/VNsnG7SYafZjrmYvvLGpt1YKD6PfO3c0nyA+R6tOMvoT31 hsFILqbVW/ktbZt3gcZvQbGeHMFJ1ACbec7sD1Kg49ge1w6uRHQycQG+YH6/eOJywhwq wCxXf6Yxu8ox8tBDML6it0ZV3ycyE2J53gFdDq+yx3EhrmbynPvg85+8PPNSA0PVFvgt noQNAbrdkPxBvBFlus04QSblTFi/RZgDKPAQzmS2dywSWqkZM7OvrAlqg3tz2kNe1jIv IrYNhmdSHAW5287SSCp7NDHYHFVrC1t9zl6XvPoCFCQ4xyntfVJjjKpjBZsMx9mUQkSU l0oA== X-Gm-Message-State: AOJu0YzAPqcEYJLn6HuFfjwyd2NDNA/PMigNpGsH9S+5R5paBFFHR6Vi vCXNhjrrEDDlq9ddvGlxUYpMzHWCvzmHTO4Blu/oaUSieXPVShzgL8QV5n+1l0qTntHTBlj9eTK L3tZn X-Gm-Gg: AZuq6aKHnBR1HfZ1HCpHEQIOn0B9cZphjV4VL+B937qVR15sB6ER2HZF3eH1i4I4e1v 126psowCHNcELPz+lDajirHdk7h9uU+ouXvFiffGn6grCcCoCvEfo5uNOzKTtC0fr6itnA674aH rrB9uVionNhaIUWhFBvB4nUa7fQqE8cFVdtlySAH7DYZ7Z6ADWqbo+7aCJRZy/killmBSS2KD1Y dFFisjxXQG9CBhRc6G00XQmN8xxbQsK4bdVuDTAqX39q2EYpo+OfAS7tTaRDmTGg+oX/3Zy6y6F tuwhaFRlwZnqy1NsFDRYs/GpOusuqlbxEMmNI9/4V195kblS4vnDumul2yEu27g45HdmvyvOXy/ OS6g9ftIHQt7ZPwFPG0YVY5FN/zDRIFTihsTfTt8CZ/V6u5Ch8pPFEU3Coj/Y6xjEEgDlV/Lana YhjfVdcI8Argvi0Uksw13Guf94pIYa59XKe0OA0Zefzf1ZQZ//TjdDwXy0h/8Q4zbkmcaVwrNKw ds= X-Received: by 2002:a05:6a00:1790:b0:81f:49cc:ea11 with SMTP id d2e1a72fcca58-824417b8d66mr1225060b3a.65.1770351724414; Thu, 05 Feb 2026 20:22:04 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: anjo@rev.ng, Richard Henderson , Jim MacArthur , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell , Paolo Bonzini , kvm@vger.kernel.org, qemu-arm@nongnu.org, Pierrick Bouvier Subject: [PATCH v2 05/12] target/arm: extract helper-sme.h from helper.h Date: Thu, 5 Feb 2026 20:21:43 -0800 Message-ID: <20260206042150.912578-6-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260206042150.912578-1-pierrick.bouvier@linaro.org> References: <20260206042150.912578-1-pierrick.bouvier@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::42a; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pf1-x42a.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 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: qemu development 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: 1770351775569158500 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pierrick Bouvier --- target/arm/helper-sme.h | 14 ++++++++++++++ target/arm/helper.h | 4 ---- target/arm/tcg/{helper-sme.h =3D> helper-sme-defs.h} | 0 target/arm/tcg/sme_helper.c | 3 +++ target/arm/tcg/translate-a64.c | 1 + target/arm/tcg/translate-sme.c | 1 + target/arm/tcg/translate-sve.c | 1 + target/arm/tcg/vec_helper.c | 1 + 8 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 target/arm/helper-sme.h rename target/arm/tcg/{helper-sme.h =3D> helper-sme-defs.h} (100%) diff --git a/target/arm/helper-sme.h b/target/arm/helper-sme.h new file mode 100644 index 00000000000..27c85fdeef1 --- /dev/null +++ b/target/arm/helper-sme.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef HELPER_SME_H +#define HELPER_SME_H + +#include "exec/helper-proto-common.h" +#include "exec/helper-gen-common.h" + +#define HELPER_H "tcg/helper-sme-defs.h" +#include "exec/helper-proto.h.inc" +#include "exec/helper-gen.h.inc" +#undef HELPER_H + +#endif /* HELPER_SME_H */ diff --git a/target/arm/helper.h b/target/arm/helper.h index 2f724643d39..b1e83196b3b 100644 --- a/target/arm/helper.h +++ b/target/arm/helper.h @@ -1,7 +1,3 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ =20 #include "tcg/helper.h" - -#ifdef TARGET_AARCH64 -#include "tcg/helper-sme.h" -#endif diff --git a/target/arm/tcg/helper-sme.h b/target/arm/tcg/helper-sme-defs.h similarity index 100% rename from target/arm/tcg/helper-sme.h rename to target/arm/tcg/helper-sme-defs.h diff --git a/target/arm/tcg/sme_helper.c b/target/arm/tcg/sme_helper.c index 075360d8b8a..7729732369f 100644 --- a/target/arm/tcg/sme_helper.c +++ b/target/arm/tcg/sme_helper.c @@ -22,6 +22,7 @@ #include "internals.h" #include "tcg/tcg-gvec-desc.h" #include "exec/helper-proto.h" +#include "helper-sme.h" #include "accel/tcg/cpu-ldst.h" #include "accel/tcg/helper-retaddr.h" #include "qemu/int128.h" @@ -29,6 +30,8 @@ #include "vec_internal.h" #include "sve_ldst_internal.h" =20 +#define HELPER_H "tcg/helper-sme-defs.h" +#include "exec/helper-info.c.inc" =20 static bool vectors_overlap(ARMVectorReg *x, unsigned nx, ARMVectorReg *y, unsigned ny) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 31fb2ea9cc3..5d261a5e32b 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -19,6 +19,7 @@ #include "qemu/osdep.h" #include "exec/target_page.h" #include "helper-a64.h" +#include "helper-sme.h" #include "helper-sve.h" #include "translate.h" #include "translate-a64.h" diff --git a/target/arm/tcg/translate-sme.c b/target/arm/tcg/translate-sme.c index 463ece97ab8..7d25ac5a51f 100644 --- a/target/arm/tcg/translate-sme.c +++ b/target/arm/tcg/translate-sme.c @@ -19,6 +19,7 @@ =20 #include "qemu/osdep.h" #include "cpu.h" +#include "helper-sme.h" #include "helper-sve.h" #include "translate.h" #include "translate-a64.h" diff --git a/target/arm/tcg/translate-sve.c b/target/arm/tcg/translate-sve.c index c68a44aff8c..db25636fa3b 100644 --- a/target/arm/tcg/translate-sve.c +++ b/target/arm/tcg/translate-sve.c @@ -19,6 +19,7 @@ =20 #include "qemu/osdep.h" #include "cpu.h" +#include "helper-sme.h" #include "helper-sve.h" #include "translate.h" #include "translate-a64.h" diff --git a/target/arm/tcg/vec_helper.c b/target/arm/tcg/vec_helper.c index bc64c8ff374..a070ac90579 100644 --- a/target/arm/tcg/vec_helper.c +++ b/target/arm/tcg/vec_helper.c @@ -21,6 +21,7 @@ #include "cpu.h" #include "exec/helper-proto.h" #include "helper-a64.h" +#include "helper-sme.h" #include "helper-sve.h" #include "tcg/tcg-gvec-desc.h" #include "fpu/softfloat.h" --=20 2.47.3 From nobody Mon Feb 9 17:47:07 2026 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=1770351810; cv=none; d=zohomail.com; s=zohoarc; b=HLy6OWzYX+I0p4hAou8J4WvHeekAR6w5xIG50K1HAq179R3xx+35v+hHvBXqednIY/vHKN5LKr2DSz5SrLgF0cKsQbht+BG5EUK8OYykCnLvL3p+Ed7ypGm0nTU2AxlE1U2GP6fsudnXu9GyUdBMlQu47Nlxb0RlKfwEbijy5Q8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770351810; 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=H5cXOVfc0cfcELp2wbWGKaUPyMU0neuGXQOK5SCrE88=; b=auo94IPmdiTcSCNeOwpDukjY+o4gB5NTTM2fTP4JBi1uC/wQq0rH32ZpfaalYP/sObFIbkAjQ2RTeIViMh22VrSm7W4+VJ9e5WIljZQMhmRqrhWHRTX+apLsXuycwUCaAz+Utwnnk2DXlL0wPh+h+kiwP2fAwwxx4aZc6QCUxtY= 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 1770351810324810.6518448716198; Thu, 5 Feb 2026 20:23:30 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1voDMA-0004MS-TD; Thu, 05 Feb 2026 23:22:10 -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 1voDM9-0004LR-QA for qemu-devel@nongnu.org; Thu, 05 Feb 2026 23:22:09 -0500 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1voDM6-0003Sd-Mn for qemu-devel@nongnu.org; Thu, 05 Feb 2026 23:22:09 -0500 Received: by mail-pj1-x1036.google.com with SMTP id 98e67ed59e1d1-352e2c59264so1076650a91.0 for ; Thu, 05 Feb 2026 20:22:06 -0800 (PST) Received: from pc.taild8403c.ts.net (216-71-219-44.dyn.novuscom.net. [216.71.219.44]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8244168fdf5sm926914b3a.17.2026.02.05.20.22.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 20:22:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1770351725; x=1770956525; 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=H5cXOVfc0cfcELp2wbWGKaUPyMU0neuGXQOK5SCrE88=; b=InEQfkioflr2GLN65dhPQw/RRgMxa40wq2RO7Yf8xkxYgpt56ewyPCiLG0YQBEWKgS NMc0AkYjsnVhVPk+5Xd453jtS1epf8aRzGRBVj0YPJlyZbcq1M5I5vWG7Q+KcGVz3RxK QAQsimI7isCDg+kilv3TjzQcSCyUeuUhQBAEv0OhyV7dT99WMDVv1l02J21kgKj/j/0N Z7OHiEIc98VvVyCRfvRI47WmRYdZjF/elJfnBojGliFJ6pf/OyIikiyt4tlTNZTYgH9J I7I/P9Dl222JEcGu7ht1mHnlNrZEcC/7UJsSQ/r0zRti0rTNmWLP7GrnH9Xp7hK70bJd l9Ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770351725; x=1770956525; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=H5cXOVfc0cfcELp2wbWGKaUPyMU0neuGXQOK5SCrE88=; b=Ub1xF51XpefWN0yqnpHE6M1ASfhPQ8K2eHZF/WYQnWuyAGzMrL2sr/uNDJThAQbnNj 38QhpWQs5H6M5hn3GVpeaVJbMTFfDzAIVNDBLPpHSjORptc1CSHlOXm6f5McM40MeIW5 Iqut97S4EvoPBV8Uf6isSIV0IpGUWRYKeqWUK1+LacEeXYSvBizLaNi+h6cZ3IxeO6Zt 1f0qptq6cBHh+eGrbU7vBlbFQRBrfGzjzDx57W6O46gHzDCwvUDFEu4ELXYUe5VsbbHz 35oGOaS1CfB5vCNzWpg22ExnoDJd/t0ck7uR7nyArhvJowPKLWK0GbcjVL9ejadGB3n3 ECuQ== X-Gm-Message-State: AOJu0YyTPo/+v8vYvVXomvfT9aaMwazKrWzED1RTc8AVVGIzvyfPdA7P 6pzL1zB+Dt3zaSg0Gx6nft18ZdxE8sMKikJemZwdUOh9u0wPDVuLRnK+QfeDqsWU7X7DtekPurI 792Da X-Gm-Gg: AZuq6aLyTtznrGBBzUEhlxBJBOj7Q5/Zhxry03s84KpW2A/5xk/D7yMDEPRTQHwtS6w ugt9SjqGDwN/euLPA+9TEzl0MbO7B1uo3PoulKlWiCk81VWDD5la15kmkDXdAeeLzhInR7QKCZy a0eTf+E6YI1dTihgdvKj69sbOGJonR/edMxruntyenessDYIYEKCLFpKmoa1dKcdWOlF7u5Wpna Isy3PEEasULTvyRgP/yOXFuN0CnU0upAody7/A6JxE5n72UgyHu/FtXaANSWq3r1x+PhJ5BYdGx YQFBF3jhJ+Em1posHzYDtgYTuABCk7b1kQUn2tUHDph7l+qdNd0HU73qDYNFU0OEcmETkfqqSs9 t05uDvXO6AbRq+tqaYyQ0YeQzqZYCmi7kgPq8EIysSHqFTQFC/A/KGD58hhH+OdxHDRlzkOEEYx abYz/3YIe8L7faUJjnhMZTQGQCaBz1wYTFnyx9jeOUFwscMBMhXrld53aiE/66LwYt X-Received: by 2002:a17:90b:35c5:b0:34c:f92a:ad05 with SMTP id 98e67ed59e1d1-354b3bc38ebmr1131436a91.11.1770351725298; Thu, 05 Feb 2026 20:22:05 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: anjo@rev.ng, Richard Henderson , Jim MacArthur , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell , Paolo Bonzini , kvm@vger.kernel.org, qemu-arm@nongnu.org, Pierrick Bouvier Subject: [PATCH v2 06/12] target/arm/tcg: duplicate tcg/arith_helper.c and tcg/crypto_helper.c between user/system Date: Thu, 5 Feb 2026 20:21:44 -0800 Message-ID: <20260206042150.912578-7-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260206042150.912578-1-pierrick.bouvier@linaro.org> References: <20260206042150.912578-1-pierrick.bouvier@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::1036; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pj1-x1036.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 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: qemu development 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: 1770351811799158500 Content-Type: text/plain; charset="utf-8" In next commit, we'll apply same helper pattern for base helpers remaining. Our new helper pattern always include helper-*-common.h, which ends up including include/tcg/tcg.h, which contains one occurrence of CONFIG_USER_ONLY. Thus, common files not being duplicated between system and target relying on helpers will fail to compile. Existing occurrences are: - target/arm/tcg/arith_helper.c - target/arm/tcg/crypto_helper.c There is a single occurrence of CONFIG_USER_ONLY, for defining variable tcg_use_softmmu. The fix seemed simple, always define it. However, it prevents some dead code elimination which ends up triggering: include/qemu/osdep.h:283:35: error: call to 'qemu_build_not_reached_always'= declared with attribute error: code path is reachable 283 | #define qemu_build_not_reached() qemu_build_not_reached_always() | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ tcg/x86_64/tcg-target.c.inc:1907:45: note: in expansion of macro 'qemu_buil= d_not_reached' 1907 | # define x86_guest_base (*(HostAddress *)({ qemu_build_not_reached(= ); NULL; })) | ^~~~~~~~~~~~~~~~~~~~~~ tcg/x86_64/tcg-target.c.inc:1934:14: note: in expansion of macro 'x86_guest= _base' 1934 | *h =3D x86_guest_base; | ^~~~~~~~~~~~~~ So, roll your eyes, then rollback code, and simply duplicate the two files concerned. We could also do a "special include trick" to prevent pulling helper-*-common.h but it would be sad since the whole point of the series up to here is to have something coherent using the exact same pattern. Signed-off-by: Pierrick Bouvier --- target/arm/tcg/meson.build | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target/arm/tcg/meson.build b/target/arm/tcg/meson.build index 1b115656c46..41cf9bad4f1 100644 --- a/target/arm/tcg/meson.build +++ b/target/arm/tcg/meson.build @@ -58,20 +58,20 @@ arm_user_ss.add(when: 'TARGET_AARCH64', if_false: files= ('cpu-v7m.c')) =20 arm_common_ss.add(zlib) =20 -arm_common_ss.add(files( - 'arith_helper.c', - 'crypto_helper.c', -)) - arm_common_system_ss.add(files( + 'arith_helper.c', + 'crypto_helper.c', 'cpregs-at.c', 'hflags.c', 'neon_helper.c', 'tlb_helper.c', 'tlb-insns.c', 'vfp_helper.c', + 'crypto_helper.c', )) arm_user_ss.add(files( + 'arith_helper.c', + 'crypto_helper.c', 'hflags.c', 'neon_helper.c', 'tlb_helper.c', --=20 2.47.3 From nobody Mon Feb 9 17:47:07 2026 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=1770351771; cv=none; d=zohomail.com; s=zohoarc; b=N3obGaFb+W1U0zSm6qfR1dmapMzQOahezDlmsLlfPucznUxWzMAii513t3ZETFferC+KW+oyW9zNZE6Hj5Wlx/iMJAZNhEXvnO2G5TLSXzNFgpICYfD6U8dzsh7DM4GCFmE5QISzQtDtvA4xSWmp678xSjeXYoD6pUQYLPNt92A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770351771; 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=xUFdts3CrD2LjojjXcJUcXjopBDfFEshkWcx0O/wm9M=; b=CWjDjv4dAKt+I8prVD2HqaNac609PxKq18Q9tqjbIj44fGho5bw0zP2GgF+UzR9n7FkEa8YrdTuw8N2BGzbeGuEBPTByTYynFYxNAib5e8YH+13G1o1R9WV9OjbXDhWF7OiifLFjmxSulv7JUDEtvU+vKOK74wZuZ1gSxIcGBL0= 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 1770351771181194.0511556161482; Thu, 5 Feb 2026 20:22:51 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1voDMC-0004Ni-58; Thu, 05 Feb 2026 23:22:12 -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 1voDMA-0004Lz-MB for qemu-devel@nongnu.org; Thu, 05 Feb 2026 23:22:10 -0500 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1voDM7-0003Tk-Kz for qemu-devel@nongnu.org; Thu, 05 Feb 2026 23:22:10 -0500 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-82318702afbso228567b3a.1 for ; Thu, 05 Feb 2026 20:22:07 -0800 (PST) Received: from pc.taild8403c.ts.net (216-71-219-44.dyn.novuscom.net. [216.71.219.44]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8244168fdf5sm926914b3a.17.2026.02.05.20.22.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 20:22:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1770351726; x=1770956526; 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=xUFdts3CrD2LjojjXcJUcXjopBDfFEshkWcx0O/wm9M=; b=mT+jSa5T1QzXSX4TFvhhD7+CirJIKog1Fe3Hn2BeCT4HzXdq5hlFoQD+8kSH19LX63 7Aqg2fNjfozt6h44gsXju6/sSGXmnETtqXbrCnC4vAcXZSOqrVFm4p+jJORfvyvU1VPP mJIURe/5t0dGpYt808QMtxEouf2q3lT3YemOq0a/K5VlKokWL1mSm4e0XRty0JoTSLN3 dm9kee+NOkItYWfm7Fh5H/Qsus1ESj6FeAJ9s8rZ6Zo8LSf+AcakBSmU5+ZQmrkw/QhA 3q+ztRKC5WorER/C3Qa4DDEuwHPR1FepfFQH8byKVr85+zaUuTBLVGNbT7MU9rpCKA2Q 4YlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770351726; x=1770956526; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=xUFdts3CrD2LjojjXcJUcXjopBDfFEshkWcx0O/wm9M=; b=lRXxQS9+7ABLxPYzvV3VZMP9p7PluGo2uuzumE+PDBrOqpaUFyfznxldViPwZu6kwR UBziooxVVgT1I+vOFwGThpYHSsi/fVqoQYTIiucDaxLpi0xi8RPWCIcu0cvVA+rhTFHV eoejIviLjPWx9ukFhEkNlLQE3vB1ORSeI3B/7ZznBk72Is+Qf0Pb5GvIH7tHGj5U4So7 01+Osf6yxrZeBafU+gOwErB1usk0oC4WcEPMUmjtM9ud2r3Ca9TkXWgGsJNxDe37JF2k XZJLytZPx4iOFz71twBpkN6uxkHwjxYNzmWVzcOUskZ1lvvsQUvAaTtC8431YddvHQGZ 97NA== X-Gm-Message-State: AOJu0YwhvXQWnH6ClEnF7LguqqYt+TZpLmB/j0JJaTzlubn2HvhrFv+a az8aiAT0o4BgDnn6HHpvytjtedLBP1PmCygVI0W1l05tbuj8OJKD+w81WqLUPUfLlSi7miJ6HB+ PfPoW X-Gm-Gg: AZuq6aLf0P+gIieLOXQIfSURgqZeGpzax5ym6AAFDZHbHcs64LXg3zdLJK/zSZJhWWc HI880qS6Tncefs4T6U+jkSUmVEFaBndBUuAPmSKq2V6uOKHqymX2o56QKTfHhgEua+1FYwKrV+Z rXcKQYhLa75czAmYOjrJQGTeKhmhXsNaiuCrZlylUb2gPbPGXW5RS5h+kot2ZBxcHRdGh4vZz9L KNWMGC7f66Vg5axCChTMfqEmnf2VTzNWwMMPe7+YwZAsKaoETn9/Ta/TmCOQPyJLeSNOwNIn0L5 g9yG1/+BcZ92ChJwXigg3TnKLdvDx1vj6sLpI8XhvNp6hvzqgMdgdGHZa49ykwJiCIjAQrW5iCk BbV0ylwEy+bQKx+l8d7ontO+1paIbksees3G/KNj2qvcbp27i/UObcHrLZEhVmD0mBhaWOVTjyR XEOUuy2Vt8Z6pJStuo4qzRZiYjbkIspPG7ZdQi5Pmde5rvNuJh/cgXd7aIWPP34QBRYb8eF1D+f VY= X-Received: by 2002:a05:6a00:4185:b0:81f:3957:2772 with SMTP id d2e1a72fcca58-8244160c6e6mr1317363b3a.3.1770351726160; Thu, 05 Feb 2026 20:22:06 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: anjo@rev.ng, Richard Henderson , Jim MacArthur , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell , Paolo Bonzini , kvm@vger.kernel.org, qemu-arm@nongnu.org, Pierrick Bouvier Subject: [PATCH v2 07/12] target/arm: move exec/helper-* plumbery to helper.h Date: Thu, 5 Feb 2026 20:21:45 -0800 Message-ID: <20260206042150.912578-8-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260206042150.912578-1-pierrick.bouvier@linaro.org> References: <20260206042150.912578-1-pierrick.bouvier@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::436; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pf1-x436.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 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: qemu development 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: 1770351774638158500 Content-Type: text/plain; charset="utf-8" Since we cleaned helper.h, we can continue further and remove all exec/helper-* inclusion. This way, all helpers use the same pattern, and helper include details are limited to those headers. Signed-off-by: Pierrick Bouvier Reviewed-by: Richard Henderson --- target/arm/helper.h | 13 ++++++++++++- target/arm/tcg/{helper.h =3D> helper-defs.h} | 0 target/arm/tcg/translate.h | 2 +- target/arm/debug_helper.c | 4 +--- target/arm/helper.c | 5 +++-- target/arm/tcg/arith_helper.c | 4 +--- target/arm/tcg/crypto_helper.c | 4 +--- target/arm/tcg/helper-a64.c | 2 +- target/arm/tcg/hflags.c | 4 +--- target/arm/tcg/m_helper.c | 2 +- target/arm/tcg/mte_helper.c | 2 +- target/arm/tcg/mve_helper.c | 2 +- target/arm/tcg/neon_helper.c | 4 +--- target/arm/tcg/op_helper.c | 2 +- target/arm/tcg/pauth_helper.c | 2 +- target/arm/tcg/psci.c | 2 +- target/arm/tcg/sme_helper.c | 2 +- target/arm/tcg/sve_helper.c | 2 +- target/arm/tcg/tlb_helper.c | 4 +--- target/arm/tcg/translate.c | 6 +----- target/arm/tcg/vec_helper.c | 2 +- target/arm/tcg/vfp_helper.c | 4 +--- 22 files changed, 34 insertions(+), 40 deletions(-) rename target/arm/tcg/{helper.h =3D> helper-defs.h} (100%) diff --git a/target/arm/helper.h b/target/arm/helper.h index b1e83196b3b..b1c26c180ea 100644 --- a/target/arm/helper.h +++ b/target/arm/helper.h @@ -1,3 +1,14 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ =20 -#include "tcg/helper.h" +#ifndef HELPER__H +#define HELPER__H + +#include "exec/helper-proto-common.h" +#include "exec/helper-gen-common.h" + +#define HELPER_H "tcg/helper-defs.h" +#include "exec/helper-proto.h.inc" +#include "exec/helper-gen.h.inc" +#undef HELPER_H + +#endif /* HELPER__H */ diff --git a/target/arm/tcg/helper.h b/target/arm/tcg/helper-defs.h similarity index 100% rename from target/arm/tcg/helper.h rename to target/arm/tcg/helper-defs.h diff --git a/target/arm/tcg/translate.h b/target/arm/tcg/translate.h index 1e30d7c77c3..027769271c9 100644 --- a/target/arm/tcg/translate.h +++ b/target/arm/tcg/translate.h @@ -6,7 +6,7 @@ #include "tcg/tcg-op-gvec.h" #include "exec/translator.h" #include "exec/translation-block.h" -#include "exec/helper-gen.h" +#include "helper.h" #include "internals.h" #include "cpu-features.h" =20 diff --git a/target/arm/debug_helper.c b/target/arm/debug_helper.c index 579516e1541..ec6a2b0c179 100644 --- a/target/arm/debug_helper.c +++ b/target/arm/debug_helper.c @@ -8,15 +8,13 @@ #include "qemu/osdep.h" #include "qemu/log.h" #include "cpu.h" +#include "helper.h" #include "internals.h" #include "cpu-features.h" #include "cpregs.h" #include "exec/watchpoint.h" #include "system/tcg.h" =20 -#define HELPER_H "tcg/helper.h" -#include "exec/helper-proto.h.inc" - #ifdef CONFIG_TCG /* Return the Exception Level targeted by debug exceptions. */ static int arm_debug_target_el(CPUARMState *env) diff --git a/target/arm/helper.c b/target/arm/helper.c index e86ceb130ce..70227263612 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -10,6 +10,7 @@ #include "qemu/log.h" #include "trace.h" #include "cpu.h" +#include "helper.h" #include "internals.h" #include "cpu-features.h" #include "exec/page-protection.h" @@ -36,8 +37,8 @@ #include "target/arm/gtimer.h" #include "qemu/plugin.h" =20 -#define HELPER_H "tcg/helper.h" -#include "exec/helper-proto.h.inc" +#define HELPER_H "tcg/helper-defs.h" +#include "exec/helper-info.c.inc" =20 static void switch_mode(CPUARMState *env, int mode); =20 diff --git a/target/arm/tcg/arith_helper.c b/target/arm/tcg/arith_helper.c index 97c6362992c..cc081c8f966 100644 --- a/target/arm/tcg/arith_helper.c +++ b/target/arm/tcg/arith_helper.c @@ -8,11 +8,9 @@ #include "qemu/osdep.h" #include "qemu/bswap.h" #include "qemu/crc32c.h" +#include "helper.h" #include /* for crc32 */ =20 -#define HELPER_H "tcg/helper.h" -#include "exec/helper-proto.h.inc" - /* * Note that signed overflow is undefined in C. The following routines are * careful to use unsigned types where modulo arithmetic is required. diff --git a/target/arm/tcg/crypto_helper.c b/target/arm/tcg/crypto_helper.c index 3428bd1bf0b..11977cb7723 100644 --- a/target/arm/tcg/crypto_helper.c +++ b/target/arm/tcg/crypto_helper.c @@ -15,11 +15,9 @@ #include "tcg/tcg-gvec-desc.h" #include "crypto/aes-round.h" #include "crypto/sm4.h" +#include "helper.h" #include "vec_internal.h" =20 -#define HELPER_H "tcg/helper.h" -#include "exec/helper-proto.h.inc" - union CRYPTO_STATE { uint8_t bytes[16]; uint32_t words[4]; diff --git a/target/arm/tcg/helper-a64.c b/target/arm/tcg/helper-a64.c index 07ddfb895dd..2dec587d386 100644 --- a/target/arm/tcg/helper-a64.c +++ b/target/arm/tcg/helper-a64.c @@ -21,7 +21,7 @@ #include "qemu/units.h" #include "cpu.h" #include "gdbstub/helpers.h" -#include "exec/helper-proto.h" +#include "helper.h" #include "helper-a64.h" #include "qemu/host-utils.h" #include "qemu/log.h" diff --git a/target/arm/tcg/hflags.c b/target/arm/tcg/hflags.c index 5c9b9bec3b2..7e6f8d36475 100644 --- a/target/arm/tcg/hflags.c +++ b/target/arm/tcg/hflags.c @@ -7,15 +7,13 @@ */ #include "qemu/osdep.h" #include "cpu.h" +#include "helper.h" #include "internals.h" #include "cpu-features.h" #include "exec/translation-block.h" #include "accel/tcg/cpu-ops.h" #include "cpregs.h" =20 -#define HELPER_H "tcg/helper.h" -#include "exec/helper-proto.h.inc" - static inline bool fgt_svc(CPUARMState *env, int el) { /* diff --git a/target/arm/tcg/m_helper.c b/target/arm/tcg/m_helper.c index 3fb24c77900..5a75e8b3e11 100644 --- a/target/arm/tcg/m_helper.c +++ b/target/arm/tcg/m_helper.c @@ -8,10 +8,10 @@ =20 #include "qemu/osdep.h" #include "cpu.h" +#include "helper.h" #include "internals.h" #include "cpu-features.h" #include "gdbstub/helpers.h" -#include "exec/helper-proto.h" #include "qemu/main-loop.h" #include "qemu/bitops.h" #include "qemu/log.h" diff --git a/target/arm/tcg/mte_helper.c b/target/arm/tcg/mte_helper.c index 01b7f099f4a..a9fb979f639 100644 --- a/target/arm/tcg/mte_helper.c +++ b/target/arm/tcg/mte_helper.c @@ -20,6 +20,7 @@ #include "qemu/osdep.h" #include "qemu/log.h" #include "cpu.h" +#include "helper.h" #include "internals.h" #include "exec/target_page.h" #include "exec/page-protection.h" @@ -32,7 +33,6 @@ #include "accel/tcg/cpu-ldst.h" #include "accel/tcg/probe.h" #include "helper-a64.h" -#include "exec/helper-proto.h" #include "exec/tlb-flags.h" #include "accel/tcg/cpu-ops.h" #include "qapi/error.h" diff --git a/target/arm/tcg/mve_helper.c b/target/arm/tcg/mve_helper.c index f33642df1f9..a67d90d6c75 100644 --- a/target/arm/tcg/mve_helper.c +++ b/target/arm/tcg/mve_helper.c @@ -19,10 +19,10 @@ =20 #include "qemu/osdep.h" #include "cpu.h" +#include "helper.h" #include "helper-mve.h" #include "internals.h" #include "vec_internal.h" -#include "exec/helper-proto.h" #include "accel/tcg/cpu-ldst.h" #include "tcg/tcg.h" #include "fpu/softfloat.h" diff --git a/target/arm/tcg/neon_helper.c b/target/arm/tcg/neon_helper.c index 8d288f3a700..69147969b23 100644 --- a/target/arm/tcg/neon_helper.c +++ b/target/arm/tcg/neon_helper.c @@ -9,13 +9,11 @@ =20 #include "qemu/osdep.h" #include "cpu.h" +#include "helper.h" #include "tcg/tcg-gvec-desc.h" #include "fpu/softfloat.h" #include "vec_internal.h" =20 -#define HELPER_H "tcg/helper.h" -#include "exec/helper-proto.h.inc" - #define SIGNBIT (uint32_t)0x80000000 #define SIGNBIT64 ((uint64_t)1 << 63) =20 diff --git a/target/arm/tcg/op_helper.c b/target/arm/tcg/op_helper.c index 4fbd219555d..5a510730ece 100644 --- a/target/arm/tcg/op_helper.c +++ b/target/arm/tcg/op_helper.c @@ -19,8 +19,8 @@ #include "qemu/osdep.h" #include "qemu/main-loop.h" #include "cpu.h" -#include "exec/helper-proto.h" #include "exec/target_page.h" +#include "helper.h" #include "internals.h" #include "cpu-features.h" #include "accel/tcg/cpu-ldst.h" diff --git a/target/arm/tcg/pauth_helper.c b/target/arm/tcg/pauth_helper.c index 5a20117ae89..67c0d59d9e9 100644 --- a/target/arm/tcg/pauth_helper.c +++ b/target/arm/tcg/pauth_helper.c @@ -19,11 +19,11 @@ =20 #include "qemu/osdep.h" #include "cpu.h" +#include "helper.h" #include "internals.h" #include "cpu-features.h" #include "accel/tcg/cpu-ldst.h" #include "helper-a64.h" -#include "exec/helper-proto.h" #include "tcg/tcg-gvec-desc.h" #include "qemu/xxhash.h" =20 diff --git a/target/arm/tcg/psci.c b/target/arm/tcg/psci.c index 2d409301578..bca6058e41a 100644 --- a/target/arm/tcg/psci.c +++ b/target/arm/tcg/psci.c @@ -18,7 +18,7 @@ =20 #include "qemu/osdep.h" #include "cpu.h" -#include "exec/helper-proto.h" +#include "helper.h" #include "kvm-consts.h" #include "qemu/main-loop.h" #include "system/runstate.h" diff --git a/target/arm/tcg/sme_helper.c b/target/arm/tcg/sme_helper.c index 7729732369f..ab5999c5925 100644 --- a/target/arm/tcg/sme_helper.c +++ b/target/arm/tcg/sme_helper.c @@ -21,7 +21,7 @@ #include "cpu.h" #include "internals.h" #include "tcg/tcg-gvec-desc.h" -#include "exec/helper-proto.h" +#include "helper.h" #include "helper-sme.h" #include "accel/tcg/cpu-ldst.h" #include "accel/tcg/helper-retaddr.h" diff --git a/target/arm/tcg/sve_helper.c b/target/arm/tcg/sve_helper.c index 16e528e41a6..062d8881bd0 100644 --- a/target/arm/tcg/sve_helper.c +++ b/target/arm/tcg/sve_helper.c @@ -21,9 +21,9 @@ #include "cpu.h" #include "internals.h" #include "exec/page-protection.h" -#include "exec/helper-proto.h" #include "exec/target_page.h" #include "exec/tlb-flags.h" +#include "helper.h" #include "helper-a64.h" #include "helper-sve.h" #include "tcg/tcg-gvec-desc.h" diff --git a/target/arm/tcg/tlb_helper.c b/target/arm/tcg/tlb_helper.c index 5c689d3b69f..565954269f9 100644 --- a/target/arm/tcg/tlb_helper.c +++ b/target/arm/tcg/tlb_helper.c @@ -7,12 +7,10 @@ */ #include "qemu/osdep.h" #include "cpu.h" +#include "helper.h" #include "internals.h" #include "cpu-features.h" =20 -#define HELPER_H "tcg/helper.h" -#include "exec/helper-proto.h.inc" - /* * Returns true if the stage 1 translation regime is using LPAE format page * tables. Used when raising alignment exceptions, whose FSR changes depen= ding diff --git a/target/arm/tcg/translate.c b/target/arm/tcg/translate.c index febb7f1532a..982c83ef42a 100644 --- a/target/arm/tcg/translate.c +++ b/target/arm/tcg/translate.c @@ -26,14 +26,10 @@ #include "arm_ldst.h" #include "semihosting/semihost.h" #include "cpregs.h" -#include "exec/helper-proto.h" #include "exec/target_page.h" +#include "helper.h" #include "helper-mve.h" =20 -#define HELPER_H "helper.h" -#include "exec/helper-info.c.inc" -#undef HELPER_H - #define ENABLE_ARCH_4T arm_dc_feature(s, ARM_FEATURE_V4T) #define ENABLE_ARCH_5 arm_dc_feature(s, ARM_FEATURE_V5) /* currently all emulated v5 cores are also v5TE, so don't bother */ diff --git a/target/arm/tcg/vec_helper.c b/target/arm/tcg/vec_helper.c index a070ac90579..1223b843bf1 100644 --- a/target/arm/tcg/vec_helper.c +++ b/target/arm/tcg/vec_helper.c @@ -19,7 +19,7 @@ =20 #include "qemu/osdep.h" #include "cpu.h" -#include "exec/helper-proto.h" +#include "helper.h" #include "helper-a64.h" #include "helper-sme.h" #include "helper-sve.h" diff --git a/target/arm/tcg/vfp_helper.c b/target/arm/tcg/vfp_helper.c index e156e3774ad..45f2eb0930f 100644 --- a/target/arm/tcg/vfp_helper.c +++ b/target/arm/tcg/vfp_helper.c @@ -19,14 +19,12 @@ =20 #include "qemu/osdep.h" #include "cpu.h" +#include "helper.h" #include "internals.h" #include "cpu-features.h" #include "fpu/softfloat.h" #include "qemu/log.h" =20 -#define HELPER_H "tcg/helper.h" -#include "exec/helper-proto.h.inc" - /* * Set the float_status behaviour to match the Arm defaults: * * tininess-before-rounding --=20 2.47.3 From nobody Mon Feb 9 17:47:07 2026 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=1770351791; cv=none; d=zohomail.com; s=zohoarc; b=C12vmpG5NtaNCJaF6AY+DiJ42nBF/u4tKGPrxpVeb2tFgCHCEgHF8/IESukQXbVHI6rQfAcSZVnYw5Y7aNqi1zb2aKkaUqyTLKR7jKFRLGX+IEe95TTslC9dC/0VD5gjn9QG2o5Yo3rLs3y1oA1JEEhdfKkqYhKM4Hni93SalXY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770351791; 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=kwB8GQ+jVdd4zLoHgSYFEXrmt93cdA0BGjD0ZGggFvo=; b=K5YdHdrqiHAwXcT+9hu+EEEsIS38rFhYIMSlzFUQWBjZ5z+2JYrOF4Ox5KDdV3xTJ3o3buRplVHVaPHjRLKZi+BeLpjJl6UdiCJkGbczCcehwdkFz4weZXvG4l2klYSmqS4LGgeDUlCgHw88w6ncNrJhDek9y3o6I8TKHDDVcs8= 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 1770351791029767.5549505685792; Thu, 5 Feb 2026 20:23:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1voDMC-0004OI-Ne; Thu, 05 Feb 2026 23:22:12 -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 1voDMB-0004Mt-4Z for qemu-devel@nongnu.org; Thu, 05 Feb 2026 23:22:11 -0500 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1voDM8-0003U3-Ei for qemu-devel@nongnu.org; Thu, 05 Feb 2026 23:22:10 -0500 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-823f9f81da5so896371b3a.1 for ; Thu, 05 Feb 2026 20:22:08 -0800 (PST) Received: from pc.taild8403c.ts.net (216-71-219-44.dyn.novuscom.net. [216.71.219.44]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8244168fdf5sm926914b3a.17.2026.02.05.20.22.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 20:22:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1770351727; x=1770956527; 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=kwB8GQ+jVdd4zLoHgSYFEXrmt93cdA0BGjD0ZGggFvo=; b=nWV7jOSdwQ4vRigYhtDfu1g7FjeX5+nQQ65LKc2gyAzPImo5hSTXGWmjLAsQkSICNN Oz/Ewr458J9/iC7xTa8NaH22cImeaCZCuM7tVl+pK9u836Is6nanGz3L0404hRNQgQWr PLNTuAx0nhddx0t9Zgyh77hqnbyIFFWvymLYYWC+/wUOdDuboso7p3qEHcKo7G+j9EJZ 2hrYeLgppFQaUE53+kRL2C+n4k3TqyIbHQa1P/vOxtFPTcDUEj8/7edIghOVr56GzDIU IXwjYxHl8xjuJGBVqySjQBg0yovog59VD+z8VwwDLSBlf6NlpFo75PV1cmn7e0bZPA+s wy0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770351727; x=1770956527; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=kwB8GQ+jVdd4zLoHgSYFEXrmt93cdA0BGjD0ZGggFvo=; b=h29CgtI+vyfiP+8IGWlCUC1yacQ83asOTJRbzLGdTnKFPT0b2lkI/MRkNDLanEUmFT d4d7ZT2Pg1xYPO1s/aDCfX+vLkJG1Qd3Q4eJWw59uGhZf4KoQIRISi1XYfvjCmKnH8zG j7NVLgiJei8/rJZ08CzcK8Bl+L+Z3XTP7AO2tBTf0LO4xt4faXHxgrB12EECpFua7JQK J4Y++TtzDQFTEPpd+jq5wOHoZy0veFf3bWNmvVCdsVj3tryRQSKjBZZfa64EdNzWlBRr nm163Fk9wL51M1KTX8kC82x7YcpVTcWCHrxCMLn+w/peXL2/LAiFfmFj0f63zbfxXHTH JKCA== X-Gm-Message-State: AOJu0Yw5312eb8/4s/igiqSxNQz9sZ6RniCmOfMq6ySpZhefj01OP0xK umb4ifPKKj7ZDNFLI+umTk6SopUA2Co1fkGiuhyIHpgn6ChSE0QdG+OQEr2cbiF/I95PBIfg1pP MHTjY X-Gm-Gg: AZuq6aLWD2hY6ejkEmJ0b/AsecDJ+wZxAMiFqmvQp5NeX975VGYb1IQRAiV86ykFDew 3kk8D5wbuMl03P14HOfhne7Pw/jh/Q25RQHcH+MxHH2VtawglT1ReyDPs8k4cZarUDgNGXa9gUw KLAxQfrvNi9L9Zn58UxgvM5i11YDtG36QW2CxmQvLU1PxANp4ZthIkuzFt27+T47oY0agpQqYkQ pSQkqP8mn4O6758X7ZWIUwODNKu12KMi2LklkK2bLW2fRNiA/qbO1ZYspkxRuJAEXVH+mksZuyb +VByBU7It4wfcI2m0fjfJ6CVUv0eRQ5QmOlZyeMVlcxUNa0NL+D4wS5Zezy+Pf7PjSieBh0VnyL vl31D+WXpKmxfgk8FhVKBej7SWDlASXnz91jVVUvhFrDwFdKZ9MTV0hwnHcR8Xjy24dKqKIkWDD 3OeXCNxKapQNDSRPibqtnMzqH+1uVuQ7zpC6LwXztrC9tbOe7BG8Xwjeebi+JFxak7 X-Received: by 2002:a05:6a00:94e3:b0:81f:4dc7:d31 with SMTP id d2e1a72fcca58-824416f5a0cmr1291419b3a.33.1770351727061; Thu, 05 Feb 2026 20:22:07 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: anjo@rev.ng, Richard Henderson , Jim MacArthur , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell , Paolo Bonzini , kvm@vger.kernel.org, qemu-arm@nongnu.org, Pierrick Bouvier Subject: [PATCH v2 08/12] target/arm/tcg/psci.c: make compilation unit common Date: Thu, 5 Feb 2026 20:21:46 -0800 Message-ID: <20260206042150.912578-9-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260206042150.912578-1-pierrick.bouvier@linaro.org> References: <20260206042150.912578-1-pierrick.bouvier@linaro.org> 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::42a; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pf1-x42a.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 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: qemu development 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: 1770351793757154100 Now that helper.h does not contain TARGET_AARCH64 identifier, we can move forward with this file. Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Pierrick Bouvier --- target/arm/tcg/psci.c | 2 +- target/arm/tcg/meson.build | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/target/arm/tcg/psci.c b/target/arm/tcg/psci.c index bca6058e41a..56754bde951 100644 --- a/target/arm/tcg/psci.c +++ b/target/arm/tcg/psci.c @@ -68,7 +68,7 @@ void arm_handle_psci_call(ARMCPU *cpu) CPUARMState *env =3D &cpu->env; uint64_t param[4]; uint64_t context_id, mpidr; - target_ulong entry; + uint64_t entry; int32_t ret =3D 0; int i; =20 diff --git a/target/arm/tcg/meson.build b/target/arm/tcg/meson.build index 41cf9bad4f1..12f126c02cd 100644 --- a/target/arm/tcg/meson.build +++ b/target/arm/tcg/meson.build @@ -49,10 +49,6 @@ arm_ss.add(when: 'TARGET_AARCH64', if_true: files( 'sve_helper.c', )) =20 -arm_system_ss.add(files( - 'psci.c', -)) - arm_system_ss.add(when: 'CONFIG_ARM_V7M', if_true: files('cpu-v7m.c')) arm_user_ss.add(when: 'TARGET_AARCH64', if_false: files('cpu-v7m.c')) =20 @@ -64,6 +60,7 @@ arm_common_system_ss.add(files( 'cpregs-at.c', 'hflags.c', 'neon_helper.c', + 'psci.c', 'tlb_helper.c', 'tlb-insns.c', 'vfp_helper.c', --=20 2.47.3 From nobody Mon Feb 9 17:47:07 2026 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=1770351792; cv=none; d=zohomail.com; s=zohoarc; b=ktDFIrFl6lr/3ZPV+pz1bkCNzoyv/AesdTiu0Yc8N2HhC4+B3f+XOzqV+plhFGsmc5/oR0zYe3OtJZOnUemu9t6JsLe17JXl0ZWDuCR2ze2kGlHm9tnDYUrko20f6XLllLbqqHLT0O7Il72hzEtC0fTMRtcABl4hDBOyhhWB4pI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770351792; 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=Q2HC49N+r3FDo4kaSsrqfKOmxBBKt7bfTNmIl3FbGEg=; b=lV1nMKnuDZcc+IvQQE9LZM+taDSfHllvl5yxo42tyIfPR9e1xj63jC9SSuPEzKJz/bBi2pxfhoA8jXPyf0ekaVNFWi+6HBqGk1ssZFIKsXHVIWYqnkczQMpISs10AsmkPsDc5uZgRMB2+IKyWxTcrSzl/vnZ/0kiA4Qt0cuukIY= 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 1770351792418156.6156787913934; Thu, 5 Feb 2026 20:23:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1voDMC-0004Nr-BL; Thu, 05 Feb 2026 23:22:12 -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 1voDMB-0004Ms-3v for qemu-devel@nongnu.org; Thu, 05 Feb 2026 23:22:11 -0500 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1voDM9-0003UV-8M for qemu-devel@nongnu.org; Thu, 05 Feb 2026 23:22:10 -0500 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-82307c6902eso869856b3a.3 for ; Thu, 05 Feb 2026 20:22:08 -0800 (PST) Received: from pc.taild8403c.ts.net (216-71-219-44.dyn.novuscom.net. [216.71.219.44]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8244168fdf5sm926914b3a.17.2026.02.05.20.22.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 20:22:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1770351728; x=1770956528; 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=Q2HC49N+r3FDo4kaSsrqfKOmxBBKt7bfTNmIl3FbGEg=; b=c15VwPBAhXc3rlCBggHjwBMtOFapJ/E6RKFuuTOMxfWplVOC6gq+KU3p0YlAcaEHej +dOu+Z3Lg1Q1xruAa0iM9rO8F/GGq+bmhAbDmH9oSLQSLiz8inxWCj9acBq+ykWrmJMB drziGgARByp3wwExYq/1d3FBePzPNHq/nMt8RUMYBrcmQ2YHJNT2q+6jDQNSe57huwgs LUKt6e2EVuhA9PppjlmhuI4yiYVI9eEP0Btj89kRAfP209IBRwmM+Z9+tv+DXHIb2oL5 Vzy5dbZ6uIKuvwVx5RSoWHLgwbZiIal9JKFCAqlxMa3qa9damkF6dWvYejNk9LYphBBi mZUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770351728; x=1770956528; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Q2HC49N+r3FDo4kaSsrqfKOmxBBKt7bfTNmIl3FbGEg=; b=EAxvndYxL+bnrpOF5qts+Xnm8EdbYxRS6tghSnYj0mZWT4HEP51sySDqK1LAms+MgI Jnkh2C0NS/LNylbdGCyL1BbADwj4o7HWrrKiEKW0SpbQclNvk88WK+AzN+W0Dyiza2JC jIDNm3/GuUNMIz5gGTQLvYDm1DpnKX5YSbijAZuZJh7wPjjCDbR2XdE/PrpRClsrmcTj rAEI+CPOio2HBgCAfPB4kdTymZ0odjS5fsCKzJbiqI8a5Bl5ZJnMyWkPZZCH4Fr8616d /eMH/tWSuTUww9LN+GqEQZMbol8YzooDMOws5Jb4FBuGA/+pSOrU3HSzbU/PhpBUs+hd X2Yw== X-Gm-Message-State: AOJu0Yx+jWRa5s+Nw8yEu7mOFlGPi9WlBSDKOFrPEL4N8wCiCB3J9j4E QTk8bT7MnRl0VV9/GGXunZlUSZNi+T9AgETjI7GNirKsDMNF+dUWkvnmdqV4RePCWG8w0VqhIWx 1A+qa X-Gm-Gg: AZuq6aIErG5FQeJSirmKNc6zYP6GbnBpZ7gxZbRpdy2nFHGRNlu2tYxsdKQKCxifCq7 PJVN7glzaoNBUDF8jWwB+k18/t/TAN+c9NofsmhC9nsOankEf3qHDSX3gskPn9Ow6EAN21WBEb0 m16GrBaQ/3UrHctQ/llxmhJkzwUThvggj5mW8DjdYT+5zI8CmCoD8MCQ4FnVa4s4mQQhbNmjLsh +PV4DWMaGjsAMD3Ce8c4kJb3mKYqdiOyDRY/OWA+1UF6OZ2DkDPPhbs9BmbonhaW+STyUjVzf1J N+Egx3U8wkJQfIqN2AspmUtyqEuATexZlMTp/Z584/FA7YXgA+V7jmCtRrfFRSbkYcN58wBrXAh VSpvH8ZKNY9ihs0wkqIEV8YS6cfAgaE6ULqyuXcg/wWM01pyLQ1omnC1dcjL2v6DsYNtvKchU3i bw7V6aCH7ES4Osf44HHNLUXWbA/leS35K0lI/Smu+5yLnAmj5X0k3BsaMHVCNn7A1r X-Received: by 2002:a05:6a00:4acb:b0:823:167a:4790 with SMTP id d2e1a72fcca58-824416244a9mr1289097b3a.26.1770351727946; Thu, 05 Feb 2026 20:22:07 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: anjo@rev.ng, Richard Henderson , Jim MacArthur , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell , Paolo Bonzini , kvm@vger.kernel.org, qemu-arm@nongnu.org, Pierrick Bouvier Subject: [PATCH v2 09/12] target/arm/tcg/cpu-v7m.c: make compilation unit common Date: Thu, 5 Feb 2026 20:21:47 -0800 Message-ID: <20260206042150.912578-10-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260206042150.912578-1-pierrick.bouvier@linaro.org> References: <20260206042150.912578-1-pierrick.bouvier@linaro.org> 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::42f; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pf1-x42f.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 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: qemu development 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: 1770351793748154100 Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Pierrick Bouvier --- target/arm/tcg/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/arm/tcg/meson.build b/target/arm/tcg/meson.build index 12f126c02cd..092ea218c92 100644 --- a/target/arm/tcg/meson.build +++ b/target/arm/tcg/meson.build @@ -49,7 +49,7 @@ arm_ss.add(when: 'TARGET_AARCH64', if_true: files( 'sve_helper.c', )) =20 -arm_system_ss.add(when: 'CONFIG_ARM_V7M', if_true: files('cpu-v7m.c')) +arm_common_system_ss.add(when: 'CONFIG_ARM_V7M', if_true: files('cpu-v7m.c= ')) arm_user_ss.add(when: 'TARGET_AARCH64', if_false: files('cpu-v7m.c')) =20 arm_common_ss.add(zlib) --=20 2.47.3 From nobody Mon Feb 9 17:47:07 2026 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=1770351823; cv=none; d=zohomail.com; s=zohoarc; b=UmTD6BKhelvNOTk3REyP2/VfXjHyBOLJNJSRffIYqH4LgLEMXA8KmUvNaoh3185yqIelJiaKtETCEURAhubuZnDyR3wf9BwOiibfRi5bu0dAhG9mDXEOB4qpo3n+/J8obY2uccIqhlCd0/gjkQMB7BmLC4JLv2zizota/YPRo0Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770351823; 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=iB71BP0S9Qf9sDi31m8cCKYKNqqqNAVCFUUARPvrcXs=; b=Yn+w043ExlKAOlQEZJSwg4q6SPWFXfgM0UEJACf8CBOI2dkVOfPjU2FwXg7B9OrGdl6D6k3/V6RCXesOLg6zQ4NgMuiryzFMIa1D6iUdhKIJfyeph54vUEkKkWXbo3czmLWPdjgqKhIj9Xnz6al2vSHk7zcZ1om76CAR668B4tM= 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 1770351823346680.4247592728393; Thu, 5 Feb 2026 20:23:43 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1voDMF-0004Qv-Lb; Thu, 05 Feb 2026 23:22:15 -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 1voDMD-0004PQ-EO for qemu-devel@nongnu.org; Thu, 05 Feb 2026 23:22:13 -0500 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1voDMA-0003Ut-BW for qemu-devel@nongnu.org; Thu, 05 Feb 2026 23:22:13 -0500 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-81ecbdfdcebso196005b3a.1 for ; Thu, 05 Feb 2026 20:22:10 -0800 (PST) Received: from pc.taild8403c.ts.net (216-71-219-44.dyn.novuscom.net. [216.71.219.44]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8244168fdf5sm926914b3a.17.2026.02.05.20.22.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 20:22:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1770351729; x=1770956529; 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=iB71BP0S9Qf9sDi31m8cCKYKNqqqNAVCFUUARPvrcXs=; b=t5uG2T8LEdQx2Dwam/UIs0N216R2pNHsimISZVr+0R5em1Fu7rD4PzdXD32PTwKDLM 15i4EoxoX64CVcJymnF38eY2sdZ0zFRjK6cGnm57xlGLzO/0US0ylqVY4DAs9mxbLzRv cjIfprBHU6hmXj8SkKq5SBzkjHBtz3NyuedXEabqqxo9hNBTupWemMZEwIg4SEPKGH5v PVyzmmDKJfWdnclgnWhwI0mI6kOiFIXICkR4cCFyrWU+jvLlZzAUdr3Ji17VFo3qIOoP qp4k1rVEuYSBsEQ4X/fRL8+mmTlNj/iK/S1cF974ra2VFv4cDOLdoy1nNvC+srUGjQiX 9z0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770351729; x=1770956529; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=iB71BP0S9Qf9sDi31m8cCKYKNqqqNAVCFUUARPvrcXs=; b=RxcRDXQkvkRIGrdY9mGvjbnUYu3SNsYITdgZJb8KUPIzEOENz4fhqUTkpMBvUO5KQd d8xo+qy3GyjufnVplR7odpsKHR7Vox8+SkSzQDDMI9BleSNtkMoEjm6SrMHUxVrYzsp1 gt1rcmymUkMuE6R4SyKH/0sQQv0KEteiy5xEH3asdga4ciy+6YTiwHRPdLnZvKFhJ9/v 3WKJGh6DqNj5PiwhyfFEOBtH9CTDGzmS9dcBsMcZKgzL8h9zbbgkv9+MDQtBBI+rLeGj af/c0Kgrg5PK0NiR8P+atDBdg+xIsl57tJpgk0G0Kb2XgxUXlUy+w9aJn7o8dX7Zuqpt t0Fw== X-Gm-Message-State: AOJu0YzKnTNJnBg+xplaNDbleiu3Z3amP9ru7c7iG8osW4Wycvo7lRO0 bc2CFpJ20ZyeiCbNl1XN5JGVbelrhd7hdu2y9mipX6ohWOzIUTEvO9Wb8gN4alqW+ryVY8/mQL2 VXXid X-Gm-Gg: AZuq6aLv6jOYKfLXlgfqgthgPjf+3cm0htcw4gDvko+D2Rk7Agxn/OlZHA4zOP0F6Qn QQa4Enuc6GY8KtNkU5QVM+/cbtH9VEaCG1h1WQKRxCuBU+dz0DvzfYSyz1V4rWAzNQUYjMgUdis MV7b1LmB4g0tJPeKwHXLrMlh1m3dTP+nYcdUO9s0MFsOas2eYQxGpJxvtHgAznekd4o8pMkyc2c g9ZNfSb5JK6yplTbhQtWTzca9tw/FatrSDT2F65XuR0vUwsWxG4tTnMZi8rJP6Z7OfNySdjZpgA k5/4VHiIO4O0uiU14utjNbIi5zJouli6bCi7A6IiEW7BvHqSGxgnxqju20eVwcQ94/AcQti+P9R CrlObGJjcbJcHJHpmJh2vkQgQtHsYNJc6Qe5FORlb4D5Lz0janJRsYN5+34cRbGSOc9Aq1ikwju UeMo1/Dw/Z5gKKW9jCKZDiUtNyUxeXPITB0oykqvjHL9OD4d++AZ6lRtXXRM+5kkhk X-Received: by 2002:a05:6a00:18a4:b0:81f:4a36:1c7c with SMTP id d2e1a72fcca58-8244162984cmr1246083b3a.23.1770351728842; Thu, 05 Feb 2026 20:22:08 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: anjo@rev.ng, Richard Henderson , Jim MacArthur , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell , Paolo Bonzini , kvm@vger.kernel.org, qemu-arm@nongnu.org, Pierrick Bouvier Subject: [PATCH v2 10/12] target/arm/tcg/vec_helper.c: make compilation unit common Date: Thu, 5 Feb 2026 20:21:48 -0800 Message-ID: <20260206042150.912578-11-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260206042150.912578-1-pierrick.bouvier@linaro.org> References: <20260206042150.912578-1-pierrick.bouvier@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::42f; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pf1-x42f.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 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: qemu development 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: 1770351825974154100 Content-Type: text/plain; charset="utf-8" We need to extract 64 bits helper in a new file (vec_helper64.c), and extract some macro definition also, since they will be used in both files. As well, DO_3OP_PAIR was defined twice, so rename the second variant to DO_3OP_PAIR_NO_STATUS to reflect what it does. Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- target/arm/tcg/vec_internal.h | 49 ++++++++ target/arm/tcg/vec_helper.c | 225 +++------------------------------- target/arm/tcg/vec_helper64.c | 142 +++++++++++++++++++++ target/arm/tcg/meson.build | 4 +- 4 files changed, 212 insertions(+), 208 deletions(-) create mode 100644 target/arm/tcg/vec_helper64.c diff --git a/target/arm/tcg/vec_internal.h b/target/arm/tcg/vec_internal.h index cf41b03dbcd..4edd2b4fc18 100644 --- a/target/arm/tcg/vec_internal.h +++ b/target/arm/tcg/vec_internal.h @@ -450,4 +450,53 @@ static inline void depositn(uint64_t *p, unsigned pos, } } =20 +#define DO_3OP(NAME, FUNC, TYPE) \ +void HELPER(NAME)(void *vd, void *vn, void *vm, = \ + float_status * stat, uint32_t desc) = \ +{ = \ + intptr_t i, oprsz =3D simd_oprsz(desc); = \ + TYPE *d =3D vd, *n =3D vn, *m =3D vm; = \ + for (i =3D 0; i < oprsz / sizeof(TYPE); i++) { = \ + d[i] =3D FUNC(n[i], m[i], stat); = \ + } = \ + clear_tail(d, oprsz, simd_maxsz(desc)); = \ +} + +#define DO_3OP_PAIR(NAME, FUNC, TYPE, H) \ +void HELPER(NAME)(void *vd, void *vn, void *vm, = \ + float_status * stat, uint32_t desc) = \ +{ = \ + ARMVectorReg scratch; = \ + intptr_t oprsz =3D simd_oprsz(desc); = \ + intptr_t half =3D oprsz / sizeof(TYPE) / 2; = \ + TYPE *d =3D vd, *n =3D vn, *m =3D vm; = \ + if (unlikely(d =3D=3D m)) { = \ + m =3D memcpy(&scratch, m, oprsz); = \ + } = \ + for (intptr_t i =3D 0; i < half; ++i) { = \ + d[H(i)] =3D FUNC(n[H(i * 2)], n[H(i * 2 + 1)], stat); = \ + } = \ + for (intptr_t i =3D 0; i < half; ++i) { = \ + d[H(i + half)] =3D FUNC(m[H(i * 2)], m[H(i * 2 + 1)], stat); = \ + } = \ + clear_tail(d, oprsz, simd_maxsz(desc)); = \ +} + +#define DO_FMUL_IDX(NAME, ADD, MUL, TYPE, H) = \ +void HELPER(NAME)(void *vd, void *vn, void *vm, = \ + float_status * stat, uint32_t desc) = \ +{ = \ + intptr_t i, j, oprsz =3D simd_oprsz(desc); = \ + intptr_t segment =3D MIN(16, oprsz) / sizeof(TYPE); = \ + intptr_t idx =3D simd_data(desc); = \ + TYPE *d =3D vd, *n =3D vn, *m =3D vm; = \ + for (i =3D 0; i < oprsz / sizeof(TYPE); i +=3D segment) { = \ + TYPE mm =3D m[H(i + idx)]; = \ + for (j =3D 0; j < segment; j++) { = \ + d[i + j] =3D ADD(d[i + j], MUL(n[i + j], mm, stat), stat); = \ + } = \ + } = \ + clear_tail(d, oprsz, simd_maxsz(desc)); = \ +} + #endif /* TARGET_ARM_VEC_INTERNAL_H */ diff --git a/target/arm/tcg/vec_helper.c b/target/arm/tcg/vec_helper.c index 1223b843bf1..91e98d28aea 100644 --- a/target/arm/tcg/vec_helper.c +++ b/target/arm/tcg/vec_helper.c @@ -20,9 +20,6 @@ #include "qemu/osdep.h" #include "cpu.h" #include "helper.h" -#include "helper-a64.h" -#include "helper-sme.h" -#include "helper-sve.h" #include "tcg/tcg-gvec-desc.h" #include "fpu/softfloat.h" #include "qemu/int128.h" @@ -1458,18 +1455,6 @@ static float32 float32_rsqrts_nf(float32 op1, float3= 2 op2, float_status *stat) return float32_div(op1, float32_two, stat); } =20 -#define DO_3OP(NAME, FUNC, TYPE) \ -void HELPER(NAME)(void *vd, void *vn, void *vm, = \ - float_status *stat, uint32_t desc) = \ -{ = \ - intptr_t i, oprsz =3D simd_oprsz(desc); = \ - TYPE *d =3D vd, *n =3D vn, *m =3D vm; = \ - for (i =3D 0; i < oprsz / sizeof(TYPE); i++) { = \ - d[i] =3D FUNC(n[i], m[i], stat); = \ - } = \ - clear_tail(d, oprsz, simd_maxsz(desc)); = \ -} - DO_3OP(gvec_fadd_b16, bfloat16_add, float16) DO_3OP(gvec_fadd_h, float16_add, float16) DO_3OP(gvec_fadd_s, float32_add, float32) @@ -1541,49 +1526,6 @@ DO_3OP(gvec_recps_nf_s, float32_recps_nf, float32) DO_3OP(gvec_rsqrts_nf_h, float16_rsqrts_nf, float16) DO_3OP(gvec_rsqrts_nf_s, float32_rsqrts_nf, float32) =20 -#ifdef TARGET_AARCH64 -DO_3OP(gvec_fdiv_h, float16_div, float16) -DO_3OP(gvec_fdiv_s, float32_div, float32) -DO_3OP(gvec_fdiv_d, float64_div, float64) - -DO_3OP(gvec_fmulx_h, helper_advsimd_mulxh, float16) -DO_3OP(gvec_fmulx_s, helper_vfp_mulxs, float32) -DO_3OP(gvec_fmulx_d, helper_vfp_mulxd, float64) - -DO_3OP(gvec_recps_h, helper_recpsf_f16, float16) -DO_3OP(gvec_recps_s, helper_recpsf_f32, float32) -DO_3OP(gvec_recps_d, helper_recpsf_f64, float64) - -DO_3OP(gvec_rsqrts_h, helper_rsqrtsf_f16, float16) -DO_3OP(gvec_rsqrts_s, helper_rsqrtsf_f32, float32) -DO_3OP(gvec_rsqrts_d, helper_rsqrtsf_f64, float64) - -DO_3OP(gvec_ah_recps_h, helper_recpsf_ah_f16, float16) -DO_3OP(gvec_ah_recps_s, helper_recpsf_ah_f32, float32) -DO_3OP(gvec_ah_recps_d, helper_recpsf_ah_f64, float64) - -DO_3OP(gvec_ah_rsqrts_h, helper_rsqrtsf_ah_f16, float16) -DO_3OP(gvec_ah_rsqrts_s, helper_rsqrtsf_ah_f32, float32) -DO_3OP(gvec_ah_rsqrts_d, helper_rsqrtsf_ah_f64, float64) - -DO_3OP(gvec_ah_fmax_h, helper_vfp_ah_maxh, float16) -DO_3OP(gvec_ah_fmax_s, helper_vfp_ah_maxs, float32) -DO_3OP(gvec_ah_fmax_d, helper_vfp_ah_maxd, float64) - -DO_3OP(gvec_ah_fmin_h, helper_vfp_ah_minh, float16) -DO_3OP(gvec_ah_fmin_s, helper_vfp_ah_mins, float32) -DO_3OP(gvec_ah_fmin_d, helper_vfp_ah_mind, float64) - -DO_3OP(gvec_fmax_b16, bfloat16_max, bfloat16) -DO_3OP(gvec_fmin_b16, bfloat16_min, bfloat16) -DO_3OP(gvec_fmaxnum_b16, bfloat16_maxnum, bfloat16) -DO_3OP(gvec_fminnum_b16, bfloat16_minnum, bfloat16) -DO_3OP(gvec_ah_fmax_b16, helper_sme2_ah_fmax_b16, bfloat16) -DO_3OP(gvec_ah_fmin_b16, helper_sme2_ah_fmin_b16, bfloat16) - -#endif -#undef DO_3OP - /* Non-fused multiply-add (unlike float16_muladd etc, which are fused) */ static float16 float16_muladd_nf(float16 dest, float16 op1, float16 op2, float_status *stat) @@ -1769,23 +1711,6 @@ DO_MLA_IDX(gvec_mls_idx_d, uint64_t, -, H8) =20 #undef DO_MLA_IDX =20 -#define DO_FMUL_IDX(NAME, ADD, MUL, TYPE, H) = \ -void HELPER(NAME)(void *vd, void *vn, void *vm, = \ - float_status *stat, uint32_t desc) = \ -{ = \ - intptr_t i, j, oprsz =3D simd_oprsz(desc); = \ - intptr_t segment =3D MIN(16, oprsz) / sizeof(TYPE); = \ - intptr_t idx =3D simd_data(desc); = \ - TYPE *d =3D vd, *n =3D vn, *m =3D vm; = \ - for (i =3D 0; i < oprsz / sizeof(TYPE); i +=3D segment) { = \ - TYPE mm =3D m[H(i + idx)]; = \ - for (j =3D 0; j < segment; j++) { = \ - d[i + j] =3D ADD(d[i + j], MUL(n[i + j], mm, stat), stat); = \ - } = \ - } = \ - clear_tail(d, oprsz, simd_maxsz(desc)); = \ -} - #define nop(N, M, S) (M) =20 DO_FMUL_IDX(gvec_fmul_idx_b16, nop, bfloat16_mul, float16, H2) @@ -1793,14 +1718,6 @@ DO_FMUL_IDX(gvec_fmul_idx_h, nop, float16_mul, float= 16, H2) DO_FMUL_IDX(gvec_fmul_idx_s, nop, float32_mul, float32, H4) DO_FMUL_IDX(gvec_fmul_idx_d, nop, float64_mul, float64, H8) =20 -#ifdef TARGET_AARCH64 - -DO_FMUL_IDX(gvec_fmulx_idx_h, nop, helper_advsimd_mulxh, float16, H2) -DO_FMUL_IDX(gvec_fmulx_idx_s, nop, helper_vfp_mulxs, float32, H4) -DO_FMUL_IDX(gvec_fmulx_idx_d, nop, helper_vfp_mulxd, float64, H8) - -#endif - #undef nop =20 /* @@ -1812,8 +1729,6 @@ DO_FMUL_IDX(gvec_fmla_nf_idx_s, float32_add, float32_= mul, float32, H4) DO_FMUL_IDX(gvec_fmls_nf_idx_h, float16_sub, float16_mul, float16, H2) DO_FMUL_IDX(gvec_fmls_nf_idx_s, float32_sub, float32_mul, float32, H4) =20 -#undef DO_FMUL_IDX - #define DO_FMLA_IDX(NAME, TYPE, H, NEGX, NEGF) = \ void HELPER(NAME)(void *vd, void *vn, void *vm, void *va, = \ float_status *stat, uint32_t desc) = \ @@ -2530,31 +2445,6 @@ void HELPER(neon_pmull_h)(void *vd, void *vn, void *= vm, uint32_t desc) clear_tail(d, 16, simd_maxsz(desc)); } =20 -#ifdef TARGET_AARCH64 -void HELPER(sve2_pmull_h)(void *vd, void *vn, void *vm, uint32_t desc) -{ - int shift =3D simd_data(desc) * 8; - intptr_t i, opr_sz =3D simd_oprsz(desc); - uint64_t *d =3D vd, *n =3D vn, *m =3D vm; - - for (i =3D 0; i < opr_sz / 8; ++i) { - d[i] =3D clmul_8x4_even(n[i] >> shift, m[i] >> shift); - } -} - -void HELPER(sve2_pmull_d)(void *vd, void *vn, void *vm, uint32_t desc) -{ - intptr_t sel =3D H4(simd_data(desc)); - intptr_t i, opr_sz =3D simd_oprsz(desc); - uint32_t *n =3D vn, *m =3D vm; - uint64_t *d =3D vd; - - for (i =3D 0; i < opr_sz / 8; ++i) { - d[i] =3D clmul_32(n[2 * i + sel], m[2 * i + sel]); - } -} -#endif - #define DO_CMP0(NAME, TYPE, OP) \ void HELPER(NAME)(void *vd, void *vn, uint32_t desc) \ { \ @@ -2628,26 +2518,6 @@ DO_ABA(gvec_uaba_d, uint64_t) =20 #undef DO_ABA =20 -#define DO_3OP_PAIR(NAME, FUNC, TYPE, H) \ -void HELPER(NAME)(void *vd, void *vn, void *vm, = \ - float_status *stat, uint32_t desc) = \ -{ = \ - ARMVectorReg scratch; = \ - intptr_t oprsz =3D simd_oprsz(desc); = \ - intptr_t half =3D oprsz / sizeof(TYPE) / 2; = \ - TYPE *d =3D vd, *n =3D vn, *m =3D vm; = \ - if (unlikely(d =3D=3D m)) { = \ - m =3D memcpy(&scratch, m, oprsz); = \ - } = \ - for (intptr_t i =3D 0; i < half; ++i) { = \ - d[H(i)] =3D FUNC(n[H(i * 2)], n[H(i * 2 + 1)], stat); = \ - } = \ - for (intptr_t i =3D 0; i < half; ++i) { = \ - d[H(i + half)] =3D FUNC(m[H(i * 2)], m[H(i * 2 + 1)], stat); = \ - } = \ - clear_tail(d, oprsz, simd_maxsz(desc)); = \ -} - DO_3OP_PAIR(gvec_faddp_h, float16_add, float16, H2) DO_3OP_PAIR(gvec_faddp_s, float32_add, float32, H4) DO_3OP_PAIR(gvec_faddp_d, float64_add, float64, ) @@ -2668,19 +2538,7 @@ DO_3OP_PAIR(gvec_fminnump_h, float16_minnum, float16= , H2) DO_3OP_PAIR(gvec_fminnump_s, float32_minnum, float32, H4) DO_3OP_PAIR(gvec_fminnump_d, float64_minnum, float64, ) =20 -#ifdef TARGET_AARCH64 -DO_3OP_PAIR(gvec_ah_fmaxp_h, helper_vfp_ah_maxh, float16, H2) -DO_3OP_PAIR(gvec_ah_fmaxp_s, helper_vfp_ah_maxs, float32, H4) -DO_3OP_PAIR(gvec_ah_fmaxp_d, helper_vfp_ah_maxd, float64, ) - -DO_3OP_PAIR(gvec_ah_fminp_h, helper_vfp_ah_minh, float16, H2) -DO_3OP_PAIR(gvec_ah_fminp_s, helper_vfp_ah_mins, float32, H4) -DO_3OP_PAIR(gvec_ah_fminp_d, helper_vfp_ah_mind, float64, ) -#endif - -#undef DO_3OP_PAIR - -#define DO_3OP_PAIR(NAME, FUNC, TYPE, H) \ +#define DO_3OP_PAIR_NO_STATUS(NAME, FUNC, TYPE, H) \ void HELPER(NAME)(void *vd, void *vn, void *vm, uint32_t desc) \ { \ ARMVectorReg scratch; \ @@ -2700,29 +2558,29 @@ void HELPER(NAME)(void *vd, void *vn, void *vm, uin= t32_t desc) \ } =20 #define ADD(A, B) (A + B) -DO_3OP_PAIR(gvec_addp_b, ADD, uint8_t, H1) -DO_3OP_PAIR(gvec_addp_h, ADD, uint16_t, H2) -DO_3OP_PAIR(gvec_addp_s, ADD, uint32_t, H4) -DO_3OP_PAIR(gvec_addp_d, ADD, uint64_t, ) +DO_3OP_PAIR_NO_STATUS(gvec_addp_b, ADD, uint8_t, H1) +DO_3OP_PAIR_NO_STATUS(gvec_addp_h, ADD, uint16_t, H2) +DO_3OP_PAIR_NO_STATUS(gvec_addp_s, ADD, uint32_t, H4) +DO_3OP_PAIR_NO_STATUS(gvec_addp_d, ADD, uint64_t, /**/) #undef ADD =20 -DO_3OP_PAIR(gvec_smaxp_b, MAX, int8_t, H1) -DO_3OP_PAIR(gvec_smaxp_h, MAX, int16_t, H2) -DO_3OP_PAIR(gvec_smaxp_s, MAX, int32_t, H4) +DO_3OP_PAIR_NO_STATUS(gvec_smaxp_b, MAX, int8_t, H1) +DO_3OP_PAIR_NO_STATUS(gvec_smaxp_h, MAX, int16_t, H2) +DO_3OP_PAIR_NO_STATUS(gvec_smaxp_s, MAX, int32_t, H4) =20 -DO_3OP_PAIR(gvec_umaxp_b, MAX, uint8_t, H1) -DO_3OP_PAIR(gvec_umaxp_h, MAX, uint16_t, H2) -DO_3OP_PAIR(gvec_umaxp_s, MAX, uint32_t, H4) +DO_3OP_PAIR_NO_STATUS(gvec_umaxp_b, MAX, uint8_t, H1) +DO_3OP_PAIR_NO_STATUS(gvec_umaxp_h, MAX, uint16_t, H2) +DO_3OP_PAIR_NO_STATUS(gvec_umaxp_s, MAX, uint32_t, H4) =20 -DO_3OP_PAIR(gvec_sminp_b, MIN, int8_t, H1) -DO_3OP_PAIR(gvec_sminp_h, MIN, int16_t, H2) -DO_3OP_PAIR(gvec_sminp_s, MIN, int32_t, H4) +DO_3OP_PAIR_NO_STATUS(gvec_sminp_b, MIN, int8_t, H1) +DO_3OP_PAIR_NO_STATUS(gvec_sminp_h, MIN, int16_t, H2) +DO_3OP_PAIR_NO_STATUS(gvec_sminp_s, MIN, int32_t, H4) =20 -DO_3OP_PAIR(gvec_uminp_b, MIN, uint8_t, H1) -DO_3OP_PAIR(gvec_uminp_h, MIN, uint16_t, H2) -DO_3OP_PAIR(gvec_uminp_s, MIN, uint32_t, H4) +DO_3OP_PAIR_NO_STATUS(gvec_uminp_b, MIN, uint8_t, H1) +DO_3OP_PAIR_NO_STATUS(gvec_uminp_h, MIN, uint16_t, H2) +DO_3OP_PAIR_NO_STATUS(gvec_uminp_s, MIN, uint32_t, H4) =20 -#undef DO_3OP_PAIR +#undef DO_3OP_PAIR_NO_STATUS =20 #define DO_VCVT_FIXED(NAME, FUNC, TYPE) \ void HELPER(NAME)(void *vd, void *vn, float_status *stat, uint32_t des= c) \ @@ -2797,53 +2655,6 @@ DO_VRINT_RMODE(gvec_vrint_rm_s, helper_rints, uint32= _t) =20 #undef DO_VRINT_RMODE =20 -#ifdef TARGET_AARCH64 -void HELPER(simd_tblx)(void *vd, void *vm, CPUARMState *env, uint32_t desc) -{ - const uint8_t *indices =3D vm; - size_t oprsz =3D simd_oprsz(desc); - uint32_t rn =3D extract32(desc, SIMD_DATA_SHIFT, 5); - bool is_tbx =3D extract32(desc, SIMD_DATA_SHIFT + 5, 1); - uint32_t table_len =3D desc >> (SIMD_DATA_SHIFT + 6); - union { - uint8_t b[16]; - uint64_t d[2]; - } result; - - /* - * We must construct the final result in a temp, lest the output - * overlaps the input table. For TBL, begin with zero; for TBX, - * begin with the original register contents. Note that we always - * copy 16 bytes here to avoid an extra branch; clearing the high - * bits of the register for oprsz =3D=3D 8 is handled below. - */ - if (is_tbx) { - memcpy(&result, vd, 16); - } else { - memset(&result, 0, 16); - } - - for (size_t i =3D 0; i < oprsz; ++i) { - uint32_t index =3D indices[H1(i)]; - - if (index < table_len) { - /* - * Convert index (a byte offset into the virtual table - * which is a series of 128-bit vectors concatenated) - * into the correct register element, bearing in mind - * that the table can wrap around from V31 to V0. - */ - const uint8_t *table =3D (const uint8_t *) - aa64_vfp_qreg(env, (rn + (index >> 4)) % 32); - result.b[H1(i)] =3D table[H1(index % 16)]; - } - } - - memcpy(vd, &result, 16); - clear_tail(vd, oprsz, simd_maxsz(desc)); -} -#endif - /* * NxN -> N highpart multiply * diff --git a/target/arm/tcg/vec_helper64.c b/target/arm/tcg/vec_helper64.c new file mode 100644 index 00000000000..249a257177e --- /dev/null +++ b/target/arm/tcg/vec_helper64.c @@ -0,0 +1,142 @@ +/* + * ARM AdvSIMD / SVE Vector Operations + * + * Copyright (c) 2026 Linaro + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "cpu.h" +#include "helper.h" +#include "helper-a64.h" +#include "helper-sme.h" +#include "helper-sve.h" +#include "tcg/tcg-gvec-desc.h" +#include "fpu/softfloat.h" +#include "qemu/int128.h" +#include "crypto/clmul.h" +#include "vec_internal.h" + +DO_3OP(gvec_fdiv_h, float16_div, float16) +DO_3OP(gvec_fdiv_s, float32_div, float32) +DO_3OP(gvec_fdiv_d, float64_div, float64) + +DO_3OP(gvec_fmulx_h, helper_advsimd_mulxh, float16) +DO_3OP(gvec_fmulx_s, helper_vfp_mulxs, float32) +DO_3OP(gvec_fmulx_d, helper_vfp_mulxd, float64) + +DO_3OP(gvec_recps_h, helper_recpsf_f16, float16) +DO_3OP(gvec_recps_s, helper_recpsf_f32, float32) +DO_3OP(gvec_recps_d, helper_recpsf_f64, float64) + +DO_3OP(gvec_rsqrts_h, helper_rsqrtsf_f16, float16) +DO_3OP(gvec_rsqrts_s, helper_rsqrtsf_f32, float32) +DO_3OP(gvec_rsqrts_d, helper_rsqrtsf_f64, float64) + +DO_3OP(gvec_ah_recps_h, helper_recpsf_ah_f16, float16) +DO_3OP(gvec_ah_recps_s, helper_recpsf_ah_f32, float32) +DO_3OP(gvec_ah_recps_d, helper_recpsf_ah_f64, float64) + +DO_3OP(gvec_ah_rsqrts_h, helper_rsqrtsf_ah_f16, float16) +DO_3OP(gvec_ah_rsqrts_s, helper_rsqrtsf_ah_f32, float32) +DO_3OP(gvec_ah_rsqrts_d, helper_rsqrtsf_ah_f64, float64) + +DO_3OP(gvec_ah_fmax_h, helper_vfp_ah_maxh, float16) +DO_3OP(gvec_ah_fmax_s, helper_vfp_ah_maxs, float32) +DO_3OP(gvec_ah_fmax_d, helper_vfp_ah_maxd, float64) + +DO_3OP(gvec_ah_fmin_h, helper_vfp_ah_minh, float16) +DO_3OP(gvec_ah_fmin_s, helper_vfp_ah_mins, float32) +DO_3OP(gvec_ah_fmin_d, helper_vfp_ah_mind, float64) + +DO_3OP(gvec_fmax_b16, bfloat16_max, bfloat16) +DO_3OP(gvec_fmin_b16, bfloat16_min, bfloat16) +DO_3OP(gvec_fmaxnum_b16, bfloat16_maxnum, bfloat16) +DO_3OP(gvec_fminnum_b16, bfloat16_minnum, bfloat16) +DO_3OP(gvec_ah_fmax_b16, helper_sme2_ah_fmax_b16, bfloat16) +DO_3OP(gvec_ah_fmin_b16, helper_sme2_ah_fmin_b16, bfloat16) + +#define nop(N, M, S) (M) + +DO_FMUL_IDX(gvec_fmulx_idx_h, nop, helper_advsimd_mulxh, float16, H2) +DO_FMUL_IDX(gvec_fmulx_idx_s, nop, helper_vfp_mulxs, float32, H4) +DO_FMUL_IDX(gvec_fmulx_idx_d, nop, helper_vfp_mulxd, float64, H8) + +#undef nop + +void HELPER(sve2_pmull_h)(void *vd, void *vn, void *vm, uint32_t desc) +{ + int shift =3D simd_data(desc) * 8; + intptr_t i, opr_sz =3D simd_oprsz(desc); + uint64_t *d =3D vd, *n =3D vn, *m =3D vm; + + for (i =3D 0; i < opr_sz / 8; ++i) { + d[i] =3D clmul_8x4_even(n[i] >> shift, m[i] >> shift); + } +} + +void HELPER(sve2_pmull_d)(void *vd, void *vn, void *vm, uint32_t desc) +{ + intptr_t sel =3D H4(simd_data(desc)); + intptr_t i, opr_sz =3D simd_oprsz(desc); + uint32_t *n =3D vn, *m =3D vm; + uint64_t *d =3D vd; + + for (i =3D 0; i < opr_sz / 8; ++i) { + d[i] =3D clmul_32(n[2 * i + sel], m[2 * i + sel]); + } +} + +DO_3OP_PAIR(gvec_ah_fmaxp_h, helper_vfp_ah_maxh, float16, H2) +DO_3OP_PAIR(gvec_ah_fmaxp_s, helper_vfp_ah_maxs, float32, H4) +DO_3OP_PAIR(gvec_ah_fmaxp_d, helper_vfp_ah_maxd, float64, /**/) + +DO_3OP_PAIR(gvec_ah_fminp_h, helper_vfp_ah_minh, float16, H2) +DO_3OP_PAIR(gvec_ah_fminp_s, helper_vfp_ah_mins, float32, H4) +DO_3OP_PAIR(gvec_ah_fminp_d, helper_vfp_ah_mind, float64, /**/) + +void HELPER(simd_tblx)(void *vd, void *vm, CPUARMState *env, uint32_t desc) +{ + const uint8_t *indices =3D vm; + size_t oprsz =3D simd_oprsz(desc); + uint32_t rn =3D extract32(desc, SIMD_DATA_SHIFT, 5); + bool is_tbx =3D extract32(desc, SIMD_DATA_SHIFT + 5, 1); + uint32_t table_len =3D desc >> (SIMD_DATA_SHIFT + 6); + union { + uint8_t b[16]; + uint64_t d[2]; + } result; + + /* + * We must construct the final result in a temp, lest the output + * overlaps the input table. For TBL, begin with zero; for TBX, + * begin with the original register contents. Note that we always + * copy 16 bytes here to avoid an extra branch; clearing the high + * bits of the register for oprsz =3D=3D 8 is handled below. + */ + if (is_tbx) { + memcpy(&result, vd, 16); + } else { + memset(&result, 0, 16); + } + + for (size_t i =3D 0; i < oprsz; ++i) { + uint32_t index =3D indices[H1(i)]; + + if (index < table_len) { + /* + * Convert index (a byte offset into the virtual table + * which is a series of 128-bit vectors concatenated) + * into the correct register element, bearing in mind + * that the table can wrap around from V31 to V0. + */ + const uint8_t *table =3D (const uint8_t *) + aa64_vfp_qreg(env, (rn + (index >> 4)) % 32); + result.b[H1(i)] =3D table[H1(index % 16)]; + } + } + + memcpy(vd, &result, 16); + clear_tail(vd, oprsz, simd_maxsz(desc)); +} diff --git a/target/arm/tcg/meson.build b/target/arm/tcg/meson.build index 092ea218c92..7eefe1b06f0 100644 --- a/target/arm/tcg/meson.build +++ b/target/arm/tcg/meson.build @@ -33,7 +33,6 @@ arm_ss.add(files( 'm_helper.c', 'mve_helper.c', 'op_helper.c', - 'vec_helper.c', )) =20 arm_ss.add(when: 'TARGET_AARCH64', if_true: files( @@ -47,6 +46,7 @@ arm_ss.add(when: 'TARGET_AARCH64', if_true: files( 'pauth_helper.c', 'sme_helper.c', 'sve_helper.c', + 'vec_helper64.c', )) =20 arm_common_system_ss.add(when: 'CONFIG_ARM_V7M', if_true: files('cpu-v7m.c= ')) @@ -63,6 +63,7 @@ arm_common_system_ss.add(files( 'psci.c', 'tlb_helper.c', 'tlb-insns.c', + 'vec_helper.c', 'vfp_helper.c', 'crypto_helper.c', )) @@ -72,5 +73,6 @@ arm_user_ss.add(files( 'hflags.c', 'neon_helper.c', 'tlb_helper.c', + 'vec_helper.c', 'vfp_helper.c', )) --=20 2.47.3 From nobody Mon Feb 9 17:47:07 2026 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=1770351807; cv=none; d=zohomail.com; s=zohoarc; b=XhRLyd+f13S6IK7jV1d10yh+mw/+PpP7mwWSRQ989erUS5B0fP2nHV5DCGSGS+KVbVgg/pDCsO7AROS4dSTmOjV1CjGEQU9iSH5CqBPsYB4Q9U8jbpalQqkzgsTAGZssv1jqYL0YYhzsHNhSfk7YyNulJlZz9MjZa+LkdbtcKKE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770351807; 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=P+C4usfFJxntIkaYUwqttNHLWY0mMsZx1f8GtcALX8k=; b=kw0ROaFRheEPGl5oxQLOvzzzNC9jaY0s3emrdGK8G6wRf0ni/sb0QAwHnJdhX9k7LpCiLPUeLp726ktoSX+KgU0/azqKCpHKTXOfD56ebVOCAQPp5yhijzoGQKgcx7O9XE2acrNxHngp1J+Ozc1kA+/qfc8eu85SumiGXSaLsos= 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 1770351807571974.3578791891416; Thu, 5 Feb 2026 20:23:27 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1voDMF-0004QJ-40; Thu, 05 Feb 2026 23:22:15 -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 1voDMC-0004O6-Ez for qemu-devel@nongnu.org; Thu, 05 Feb 2026 23:22:12 -0500 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1voDMB-0003VI-0h for qemu-devel@nongnu.org; Thu, 05 Feb 2026 23:22:12 -0500 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-81e9d0cd082so284322b3a.0 for ; Thu, 05 Feb 2026 20:22:10 -0800 (PST) Received: from pc.taild8403c.ts.net (216-71-219-44.dyn.novuscom.net. [216.71.219.44]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8244168fdf5sm926914b3a.17.2026.02.05.20.22.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 20:22:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1770351730; x=1770956530; 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=P+C4usfFJxntIkaYUwqttNHLWY0mMsZx1f8GtcALX8k=; b=Xgf/4GKWQrLp7uCoQYRUzCqyhSP4HADbAM6oRmrtDC5QtlPw0ni1xUEOiLS00DDBJm EwhsiCjtoNjLvZQW8MFPNowjtCdV3jcsWmUD6agEEGcUQrs1gwnF95TE2cXEZ14ylk/5 /H0m2sYb4411muOr+AWsXOAZhcabVbhk1ufVrotR0PYJzA8GVvtTTquibUSDwbmHeQGh WplUD10pGLBctLhAhQQz7WMax5CzgzqYtpdrIuH7eIMzBBNX3xMX3QLy5mPC48CVXmLT xH8RrHMT0CAe3Lx+WUit8GC1kMP7aPTjIZVF1YHxDlOJ1kQMweHBq9Rvw30kN90DGOIc X5zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770351730; x=1770956530; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=P+C4usfFJxntIkaYUwqttNHLWY0mMsZx1f8GtcALX8k=; b=IwpJezXEVKAqZKDsKiyzc/wZNHaLRj9Eby52a7GTSxVP4kEmp39cUcyoTQYXsQ/Xnh uzN9AALLUijNnqOEVZ0Ath2o0lrsm7SJZqsByn7efkOScqk//OIPuKab7mMp8qXIv3i1 ZiboBL0w6yS3lvOCb4oW7BqtHUMU0k9EXN4duVkI0SvoQFvy2uG61ew9KgeRBYutFKYL s3rDkFdU4WdC95i4KFbDAw/FIngyzc4Kw2DveCLAzCGBm7cIqK8AM1ip+aB2w1DZ9HNt 1ZKkrgKQi6lDuk5pgHi7N6G00At5R5sHN8w4r1P7/TfRfDjm17xJlsbkWl4ucf5wJST2 s0Tw== X-Gm-Message-State: AOJu0Yz5wn0CtqeKZj7rLs75vN0F9dOCr9wUBKjCzts/O8ibpGktzFZ7 6Dw4pLP4CgkRO/RBuJaTdWieLw/+4P7pPjmsO57hZLiPDYDP3bn3g7HCRLYxCl5gi+PBZ5gCCc7 Qi2/6 X-Gm-Gg: AZuq6aIORDlsZDsrCyO3MtJhaYZxL3K/FBniy3u6ZiO+MNn4WO5z+2T2xL29Z+VjUmI F5e3/E0bdo7RxLVC29A/beLwaD0po3GKbiLbokElZyqUXffIYxOzIV4r1YSLJM4ruZulW7NhYyo IIXQjIbNzEN0o9lyxisisn1ldsovPD9K4WYLg7SvOjgxLrl7Kky2wj79y6BAE1tBOkEj6eeK9y2 ijWxc8q3KhvKQ6ahTQu9UkvKsNoEf3g67Ifr7OvJUuSsq/AnWzuUPUX+z2CrnkE2zoe1g9pCFWp Isu4Xsn1MyOXItDoZk9v8DilSPeUZfDWrNFgJQxKXuH3WxNj2z+KfRtZ8m2ncKkvDhYYCQy8qIH PyU7YnTCm3LizqorGzr8bVqbH7/3pZni1TDfGumAS8fh0nijl9cyXuSL918buZ227Agr1xMnd/Z ObaBC7KdMSCmYwhTgz82cTWHl4uXLgBeulv8WS6foW8N17gU3bRzDyDNtVH3czDGZR X-Received: by 2002:a05:6a00:17a7:b0:81f:4963:4967 with SMTP id d2e1a72fcca58-82441773190mr1309967b3a.57.1770351729674; Thu, 05 Feb 2026 20:22:09 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: anjo@rev.ng, Richard Henderson , Jim MacArthur , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell , Paolo Bonzini , kvm@vger.kernel.org, qemu-arm@nongnu.org, Pierrick Bouvier Subject: [PATCH v2 11/12] target/arm/tcg/translate.h: replace target_ulong with vaddr Date: Thu, 5 Feb 2026 20:21:49 -0800 Message-ID: <20260206042150.912578-12-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260206042150.912578-1-pierrick.bouvier@linaro.org> References: <20260206042150.912578-1-pierrick.bouvier@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::42e; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pf1-x42e.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 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: qemu development 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: 1770351810037154100 Content-Type: text/plain; charset="utf-8" Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- target/arm/tcg/translate.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/arm/tcg/translate.h b/target/arm/tcg/translate.h index 027769271c9..2c8358dd7fa 100644 --- a/target/arm/tcg/translate.h +++ b/target/arm/tcg/translate.h @@ -18,7 +18,7 @@ */ typedef struct DisasLabel { TCGLabel *label; - target_ulong pc_save; + vaddr pc_save; } DisasLabel; =20 /* @@ -42,7 +42,7 @@ typedef struct DisasContext { DisasDelayException *delay_excp_list; =20 /* The address of the current instruction being translated. */ - target_ulong pc_curr; + vaddr pc_curr; /* * For CF_PCREL, the full value of cpu_pc is not known * (although the page offset is known). For convenience, the @@ -56,8 +56,8 @@ typedef struct DisasContext { * pc_save contains -1 to indicate that relative updates are no * longer possible. */ - target_ulong pc_save; - target_ulong page_start; + vaddr pc_save; + vaddr page_start; uint32_t insn; /* Nonzero if this instruction has been conditionally skipped. */ int condjmp; --=20 2.47.3 From nobody Mon Feb 9 17:47:07 2026 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=1770351771; cv=none; d=zohomail.com; s=zohoarc; b=FGr2owCDQjwdLGGKn1ArP2by0DYlpNL0j17KO9S/O5uszjOupZ0jSag9lnfa0cT/wlAVBTDlA686xGJwowjCC3quG3NAAf9YZlFUYeehTuwGux0brgrVzl3dk+13tP0UT7j6eZhDK7ncGca9dI1CMbTZz0pu0FI2n3wHYe1sgLI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770351771; 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=BZQOTv1ZWaw7/m+ukhNnjzXfOk5Em/QF1TWzcoaJze0=; b=MiPZCFo2YqMxp1qk63BsM+JLA88oToeVq73uqOKnYak1PrswyZjx4kqY9X/uPRUZSyTe1qkIoeq3rQMufKqAszrlABomfXa9xOi3qsS0b+16TiXKDmdY60a9fW73lPusnvV45D6p551wH1eyyFpb+gWHOUtWevi+nH3t+kGZ0Ik= 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 1770351771718490.2924161670836; Thu, 5 Feb 2026 20:22:51 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1voDMF-0004QK-72; Thu, 05 Feb 2026 23:22:15 -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 1voDME-0004Pw-1s for qemu-devel@nongnu.org; Thu, 05 Feb 2026 23:22:14 -0500 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1voDMC-0003Vk-0V for qemu-devel@nongnu.org; Thu, 05 Feb 2026 23:22:13 -0500 Received: by mail-pf1-x442.google.com with SMTP id d2e1a72fcca58-81f4dfa82edso153007b3a.0 for ; Thu, 05 Feb 2026 20:22:11 -0800 (PST) Received: from pc.taild8403c.ts.net (216-71-219-44.dyn.novuscom.net. [216.71.219.44]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8244168fdf5sm926914b3a.17.2026.02.05.20.22.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 20:22:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1770351730; x=1770956530; 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=BZQOTv1ZWaw7/m+ukhNnjzXfOk5Em/QF1TWzcoaJze0=; b=gF0BLRdVMWm6JoHAZAgM7LzfFyrf191SU27o013BhJua9CUCWSqqGiLNHWmmjC8kAk 8bKkV307sNX8xFkBw4NDwP37+Mrrs6WoMqMoSeyW9q7KFxvympKCm7d0cKPxrDm3uKxs rl6vKyIaw+hbg7zkWmrTKBfkyalcIzwlfWDOJunX/sH32O1MSY/srdkagRBhr1TgknEo /H+PwzCaPD0Md8UTrMx5jnriagAWIFo6apTGu4aRVVDFadrZd2n7fK+BJ3M8PmaZNkw3 IP1h5owl/+ow+eW+auEhAuT2e48mXdIZMrvo+PrZKCIzGWYHqojJLo8gmnBDSpdupQiL sJ8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770351730; x=1770956530; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=BZQOTv1ZWaw7/m+ukhNnjzXfOk5Em/QF1TWzcoaJze0=; b=NGkoKiK5zusYfqnYad0sMZtZ0Q76Eh22pVxEn/CIWaDWLCj0wqIFw8jMs/zYtg33N8 OfofDisW2aIr/2TwUhIViRD7xAHgPDhv0h9AF4RrvXgMRwWxH/1o0KQtL2+0z5JiS2vW Jqp5l5b5MFBbPVF//lVkhKJsRtwvnCkluzypIk0P+GUv3viDDmt0YGzVWSLjrY3X0Oxt SjlzM1PTidyU4sIiHipinnMlWXYma6/CSQeoGHG3VFrcm1kgVW0r3zVV5WyFVWR2Wx26 0dqGtjcyTN91IzI+GbWw5qlabP4YSVVjDLlNcqF2IvUdP/hXSEFXqQmk9eRt2YaB334I 9bmA== X-Gm-Message-State: AOJu0YzEokzYt2pKiaX4Nb5omT02HAR6q98zp7GksRQ02Yvs5ZeoK6oS VymexaWJ4FO+DJnQ0eKSjZsnWIyamgasMy2wJ70EoS777viQ8oEu9uxB3HksJPNf4hV3qdUsmDk F2Q45fOM= X-Gm-Gg: AZuq6aJ7AJ0THzjamUudWmkq5J5rlbCnXAykG/h1/J49zEtZ/LJAK/xdyBZPmfkPcpD 7MTFTCziGu7jm/mWRJPuVQDHkcyrNenSjK4cef9919nviKp1uC7az0Wmy74hg8YkQbDVyMSR/FF 2MDLPOT6ynVjKDMHjh+apXdHxvVdpWWqE/uWIGGCgCjVmF7R2+bPnpZAZQAEfOGOfCMOax9moFi 74WWJ1PUkY6z/kqARt6coxfLTrR6ssOo0w3IR8HJEmoILv4wIWWcxIZj2feJjkIBm2/qkAJmD3d /LtPaKwqdbBUAsmkffdWx01MeI5dxYzm+h7kUFnab5/K3V5FptOa2+4IUngSNaTIw4RahiPUNDo 7jDgqshLRYpb3ZaAhpAzyXxDGMPuJYzKIn8mYr9W23twsYMFtWhMPCrBlQ8JEkFjYkwaidVhGlo MUt66yba5MYRheG2Tc/F/3R1htpwmx3KctrQGYh8XnJq1P/Of/UoQK2Lll7GWPbBIM X-Received: by 2002:a05:6a00:240b:b0:823:1094:2458 with SMTP id d2e1a72fcca58-824413c12b8mr1285493b3a.0.1770351730491; Thu, 05 Feb 2026 20:22:10 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: anjo@rev.ng, Richard Henderson , Jim MacArthur , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell , Paolo Bonzini , kvm@vger.kernel.org, qemu-arm@nongnu.org, Pierrick Bouvier Subject: [PATCH v2 12/12] target/arm/tcg/translate.h: replace target_long with int64_t Date: Thu, 5 Feb 2026 20:21:50 -0800 Message-ID: <20260206042150.912578-13-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260206042150.912578-1-pierrick.bouvier@linaro.org> References: <20260206042150.912578-1-pierrick.bouvier@linaro.org> 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::442; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pf1-x442.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 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: qemu development 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: 1770351775765154100 target_long is used to represent a pc diff. Checked all call sites to make sure we were already passing signed values, so extending works as expected. Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Pierrick Bouvier --- target/arm/tcg/translate-a32.h | 2 +- target/arm/tcg/translate.h | 12 ++++++------ target/arm/tcg/translate.c | 18 +++++++++--------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/target/arm/tcg/translate-a32.h b/target/arm/tcg/translate-a32.h index 0b1fa57965c..a8df364171b 100644 --- a/target/arm/tcg/translate-a32.h +++ b/target/arm/tcg/translate-a32.h @@ -40,7 +40,7 @@ void write_neon_element64(TCGv_i64 src, int reg, int ele,= MemOp memop); TCGv_i32 add_reg_for_lit(DisasContext *s, int reg, int ofs); void gen_set_cpsr(TCGv_i32 var, uint32_t mask); void gen_set_condexec(DisasContext *s); -void gen_update_pc(DisasContext *s, target_long diff); +void gen_update_pc(DisasContext *s, int64_t diff); void gen_lookup_tb(DisasContext *s); long vfp_reg_offset(bool dp, unsigned reg); long neon_full_reg_offset(unsigned reg); diff --git a/target/arm/tcg/translate.h b/target/arm/tcg/translate.h index 2c8358dd7fa..1f455e4c434 100644 --- a/target/arm/tcg/translate.h +++ b/target/arm/tcg/translate.h @@ -27,8 +27,8 @@ typedef struct DisasLabel { typedef struct DisasDelayException { struct DisasDelayException *next; TCGLabel *lab; - target_long pc_curr; - target_long pc_save; + int64_t pc_curr; + int64_t pc_save; int condexec_mask; int condexec_cond; uint32_t excp; @@ -359,14 +359,14 @@ static inline int curr_insn_len(DisasContext *s) =20 #ifdef TARGET_AARCH64 void a64_translate_init(void); -void gen_a64_update_pc(DisasContext *s, target_long diff); +void gen_a64_update_pc(DisasContext *s, int64_t diff); extern const TranslatorOps aarch64_translator_ops; #else static inline void a64_translate_init(void) { } =20 -static inline void gen_a64_update_pc(DisasContext *s, target_long diff) +static inline void gen_a64_update_pc(DisasContext *s, int64_t diff) { } #endif @@ -377,9 +377,9 @@ void arm_gen_test_cc(int cc, TCGLabel *label); MemOp pow2_align(unsigned i); void unallocated_encoding(DisasContext *s); void gen_exception_internal(int excp); -void gen_exception_insn_el(DisasContext *s, target_long pc_diff, int excp, +void gen_exception_insn_el(DisasContext *s, int64_t pc_diff, int excp, uint32_t syn, uint32_t target_el); -void gen_exception_insn(DisasContext *s, target_long pc_diff, +void gen_exception_insn(DisasContext *s, int64_t pc_diff, int excp, uint32_t syn); TCGLabel *delay_exception_el(DisasContext *s, int excp, uint32_t syn, uint32_t target_el); diff --git a/target/arm/tcg/translate.c b/target/arm/tcg/translate.c index 982c83ef42a..42b2785fb06 100644 --- a/target/arm/tcg/translate.c +++ b/target/arm/tcg/translate.c @@ -250,12 +250,12 @@ static inline int get_a32_user_mem_index(DisasContext= *s) } =20 /* The pc_curr difference for an architectural jump. */ -static target_long jmp_diff(DisasContext *s, target_long diff) +static int64_t jmp_diff(DisasContext *s, int64_t diff) { return diff + (s->thumb ? 4 : 8); } =20 -static void gen_pc_plus_diff(DisasContext *s, TCGv_i32 var, target_long di= ff) +static void gen_pc_plus_diff(DisasContext *s, TCGv_i32 var, int64_t diff) { assert(s->pc_save !=3D -1); if (tb_cflags(s->base.tb) & CF_PCREL) { @@ -735,7 +735,7 @@ void gen_set_condexec(DisasContext *s) } } =20 -void gen_update_pc(DisasContext *s, target_long diff) +void gen_update_pc(DisasContext *s, int64_t diff) { gen_pc_plus_diff(s, cpu_R[15], diff); s->pc_save =3D s->pc_curr + diff; @@ -1055,7 +1055,7 @@ static void gen_exception(int excp, uint32_t syndrome) tcg_constant_i32(syndrome)); } =20 -static void gen_exception_insn_el_v(DisasContext *s, target_long pc_diff, +static void gen_exception_insn_el_v(DisasContext *s, int64_t pc_diff, int excp, uint32_t syn, TCGv_i32 tcg_e= l) { if (s->aarch64) { @@ -1068,14 +1068,14 @@ static void gen_exception_insn_el_v(DisasContext *s= , target_long pc_diff, s->base.is_jmp =3D DISAS_NORETURN; } =20 -void gen_exception_insn_el(DisasContext *s, target_long pc_diff, int excp, +void gen_exception_insn_el(DisasContext *s, int64_t pc_diff, int excp, uint32_t syn, uint32_t target_el) { gen_exception_insn_el_v(s, pc_diff, excp, syn, tcg_constant_i32(target_el)); } =20 -void gen_exception_insn(DisasContext *s, target_long pc_diff, +void gen_exception_insn(DisasContext *s, int64_t pc_diff, int excp, uint32_t syn) { if (s->aarch64) { @@ -1310,7 +1310,7 @@ static void gen_goto_ptr(void) * cpu_loop_exec. Any live exit_requests will be processed as we * enter the next TB. */ -static void gen_goto_tb(DisasContext *s, unsigned tb_slot_idx, target_long= diff) +static void gen_goto_tb(DisasContext *s, unsigned tb_slot_idx, int64_t dif= f) { if (translator_use_goto_tb(&s->base, s->pc_curr + diff)) { /* @@ -1337,7 +1337,7 @@ static void gen_goto_tb(DisasContext *s, unsigned tb_= slot_idx, target_long diff) } =20 /* Jump, specifying which TB number to use if we gen_goto_tb() */ -static void gen_jmp_tb(DisasContext *s, target_long diff, int tbno) +static void gen_jmp_tb(DisasContext *s, int64_t diff, int tbno) { if (unlikely(s->ss_active)) { /* An indirect jump so that we still trigger the debug exception. = */ @@ -1380,7 +1380,7 @@ static void gen_jmp_tb(DisasContext *s, target_long d= iff, int tbno) } } =20 -static inline void gen_jmp(DisasContext *s, target_long diff) +static inline void gen_jmp(DisasContext *s, int64_t diff) { gen_jmp_tb(s, diff, 0); } --=20 2.47.3