From nobody Sat Nov 29 10:46:30 2025 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=1764199738; cv=none; d=zohomail.com; s=zohoarc; b=JFa5iDrqs2LurtcKKHf4j/kTrfn8Y2z0U9slSrEpSc8Q4t+pamwg8l7JVtwykaO2YCrSuMdZUpgvIKl5IqruWmGmKCmJCgDdsWSltrR9uIT901RGxT17sqFTssk98vXn4x8dbL34mxo9sC1RHHPqqw0Aog7Z5Ata2+0g6MYGrzE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1764199738; 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=OFt8xjFc2jyIEqMIXlWNQ0K51n6YypSN5PbrP8ZEBgM=; b=AovOvTvxj8hEbtcjzqPSNCeX0BS6chEImYRVi0nX50qBaBVwJCwhQOUMiMAJh65WqNN/CRkcOoPtQ0uuapedTMSCqj9BjHmWoDo153qYMn1Mn4w+RCwrlSogS16z3jiV/FUBDU/qdud644P11tkUYj3RXzwlqAK+PB+DeSuu48U= 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 17641997386231021.7562929873693; Wed, 26 Nov 2025 15:28:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vOM40-0005rP-2u; Wed, 26 Nov 2025 15:24:37 -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 1vOM3c-0005h4-E3 for qemu-devel@nongnu.org; Wed, 26 Nov 2025 15:24:10 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vOM3Z-0002e3-8s for qemu-devel@nongnu.org; Wed, 26 Nov 2025 15:24:07 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-477a2ab455fso972165e9.3 for ; Wed, 26 Nov 2025 12:24:04 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4790b0c3a28sm63171165e9.9.2025.11.26.12.24.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 26 Nov 2025 12:24:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1764188643; x=1764793443; 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=OFt8xjFc2jyIEqMIXlWNQ0K51n6YypSN5PbrP8ZEBgM=; b=Kgf1uwJql0i0V+yh8VTby46QQNmq1qoBuvKCiZS2urU1QUbwvaXyYCp75UKyK5fbx4 QJLMyzEAPCBBRAt4TyX2UcbuuSispsDY2kKh9zttOwO81vYkgdRzRza5Ulih0ctzJTAa sDZI1TS3bGlgkLO/HREln4DR32dWhcqYFGi296i8r/9jilJt76QQ2VYYFI7CAHRxWQ+0 3rbP7lyyWfdUFvpoJQ8lc/mgFs6xU/0s3XBg4M/9ccepYC056Edlkk4nTwQ0SwMZf3Fn IQEY1fEcXX0mIEOMN2//jO/NKpwthFwrTzlTwzQs0Ay9cH9LGdffaRrlDauNA9aosHLL gY4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764188643; x=1764793443; 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=OFt8xjFc2jyIEqMIXlWNQ0K51n6YypSN5PbrP8ZEBgM=; b=A1Y1VKfl8DoWCc/q3jZ5JQ1NEdP7UC9/Fj9gCQCtGLljI6crllH+q8aNyvTNda8m0I S8mQ+YYU5U02EJPpOfj9yevHZKsBwFSfz0h+wGmvVQGQz6OWeJ5AzWblP15tEfN8dcdY JZbmfJkV0IP5V54Hm4zY1MOGeMQXrqooRQOP+TLAAEcshPC0o2w7iSJ4zc+xzWjRKptH 8I3tdsSzPjtj0l+cp8TPudts+wC5umcOXTMgsiNflP2kH1eo8WVjdY7eSdK0s6TwUhNA vB9KIqDHBL4DJI4/5vJybCvPgmUneVwFlFKDSHQ9VJIVwjyr95iVC8XGfifotguHCqyF Ie2w== X-Gm-Message-State: AOJu0YxA0c8MuKrEKHNOz7nR0MsBPEjiaTzlb38TxmXqbvJoHdRYJELD lrx7eg1/Y6TewZ3WftiDGzV0z09QWkW9hdlfO5BQAeyMP6WE+hweVNdnGQ/sjw4Z0LrhdJHiWto 2LlSClbwR2dcy X-Gm-Gg: ASbGnctcRBuUb8zV20nBa7m0x1sr+Xwhr0OT6pDBqj54oKPS9Jc7psSayqAO8jLCxOQ ryNd7F7UwSUGOaH3iiKGmzDCsv3JpA7UA9zgTBvgeG/aj2cuMUG0Sq0gzz/zqwma8y2x0dOPzda FKDd6UyP8/feLw3fwWnLuAZ0/5cg9zfKQTpmbligGGwrLvcYERxTfSLPhz3WQN8Nhr36sSVezRV E7PqG4oq2NO81K7xZ/Osvfx5qSwi+0ooqvNCYpqBdxKkXeW0SM8nQOOF8NEavShea42gw89bsMa 8ZWyb4Vqx3BruiOzcyKzx4Aq/PbwOINcAla03hTOwd08HvT9pDOG3IzD3+/uL01yJXfkbzPb8Q6 MfyR/raA2r6iOht0+zHTiIGdm7ZaUerHXAYI9YiwCb+Go/P5WXYuf1r2NyllnSGr9VyuCEzFGvd yT19fWuh75tYcUWtK8kN3zFYvlsTmqdAUDk+YVFjqwq0EUEuyRl30+ANvjheXT X-Google-Smtp-Source: AGHT+IF9rzJSNaNQ3ISJDVVX4suoyj3Pd104uEdaJyVxO1Y7FY2YVCJdnXi6wOEk17aocQFzReEIjg== X-Received: by 2002:a05:600c:1c29:b0:477:639d:bca2 with SMTP id 5b1f17b1804b1-477c10c85e2mr238459565e9.4.1764188643478; Wed, 26 Nov 2025 12:24:03 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Richard Henderson , qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Jiaxun Yang , Aleksandar Rikalo Subject: [PATCH-for-11.0 v3 17/22] target/mips: Inline cpu_ld/st_mmuidx_ra() calls in memory helpers Date: Wed, 26 Nov 2025 21:21:53 +0100 Message-ID: <20251126202200.23100-18-philmd@linaro.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251126202200.23100-1-philmd@linaro.org> References: <20251126202200.23100-1-philmd@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=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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: 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: 1764199741006019200 In preparation of removing the cpu_ld*_mmuidx_ra() and cpu_st*_mmuidx_ra() calls, inline them. Expand MO_TE to mo_endian_env(env). Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/mips/tcg/ldst_helper.c | 49 +++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/target/mips/tcg/ldst_helper.c b/target/mips/tcg/ldst_helper.c index f3652034afa..716b60e3a39 100644 --- a/target/mips/tcg/ldst_helper.c +++ b/target/mips/tcg/ldst_helper.c @@ -237,8 +237,10 @@ void helper_sdr(CPUMIPSState *env, target_ulong arg1, = target_ulong arg2, static const int multiple_regs[] =3D { 16, 17, 18, 19, 20, 21, 22, 23, 30 = }; =20 void helper_lwm(CPUMIPSState *env, target_ulong addr, target_ulong reglist, - uint32_t mem_idx) + uint32_t mmu_idx) { + MemOp op =3D mo_endian_env(env) | MO_UL | MO_UNALN; + MemOpIdx oi =3D make_memop_idx(op, mmu_idx); target_ulong base_reglist =3D reglist & 0xf; target_ulong do_r31 =3D reglist & 0x10; =20 @@ -247,20 +249,22 @@ void helper_lwm(CPUMIPSState *env, target_ulong addr,= target_ulong reglist, =20 for (i =3D 0; i < base_reglist; i++) { env->active_tc.gpr[multiple_regs[i]] =3D - (target_long)cpu_ldl_mmuidx_ra(env, addr, mem_idx, GETPC()= ); + (target_long)cpu_ldl_mmu(env, addr, oi, GETPC()); addr +=3D 4; } } =20 if (do_r31) { env->active_tc.gpr[31] =3D - (target_long)cpu_ldl_mmuidx_ra(env, addr, mem_idx, GETPC()); + (target_long)cpu_ldl_mmu(env, addr, oi, GETPC()); } } =20 void helper_swm(CPUMIPSState *env, target_ulong addr, target_ulong reglist, - uint32_t mem_idx) + uint32_t mmu_idx) { + MemOp op =3D mo_endian_env(env) | MO_UL | MO_UNALN; + MemOpIdx oi =3D make_memop_idx(op, mmu_idx); target_ulong base_reglist =3D reglist & 0xf; target_ulong do_r31 =3D reglist & 0x10; =20 @@ -268,58 +272,59 @@ void helper_swm(CPUMIPSState *env, target_ulong addr,= target_ulong reglist, target_ulong i; =20 for (i =3D 0; i < base_reglist; i++) { - cpu_stl_mmuidx_ra(env, addr, env->active_tc.gpr[multiple_regs[= i]], - mem_idx, GETPC()); + cpu_stl_mmu(env, addr, env->active_tc.gpr[multiple_regs[i]], + oi, GETPC()); addr +=3D 4; } } =20 if (do_r31) { - cpu_stl_mmuidx_ra(env, addr, env->active_tc.gpr[31], mem_idx, GETP= C()); + cpu_stl_mmu(env, addr, env->active_tc.gpr[31], oi, GETPC()); } } =20 #if defined(TARGET_MIPS64) void helper_ldm(CPUMIPSState *env, target_ulong addr, target_ulong reglist, - uint32_t mem_idx) + uint32_t mmu_idx) { target_ulong base_reglist =3D reglist & 0xf; target_ulong do_r31 =3D reglist & 0x10; + uintptr_t retaddr =3D GETPC(); + MemOpIdx oi =3D make_memop_idx(mo_endian_env(env) | MO_UQ | MO_UNALN, + mmu_idx); =20 if (base_reglist > 0 && base_reglist <=3D ARRAY_SIZE(multiple_regs)) { - target_ulong i; - - for (i =3D 0; i < base_reglist; i++) { - env->active_tc.gpr[multiple_regs[i]] =3D - cpu_ldq_mmuidx_ra(env, addr, mem_idx, GETPC()); + for (unsigned i =3D 0; i < base_reglist; i++) { + env->active_tc.gpr[multiple_regs[i]] =3D cpu_ldq_mmu(env, addr, + oi, retaddr= ); addr +=3D 8; } } =20 if (do_r31) { - env->active_tc.gpr[31] =3D - cpu_ldq_mmuidx_ra(env, addr, mem_idx, GETPC()); + env->active_tc.gpr[31] =3D cpu_ldq_mmu(env, addr, oi, retaddr); } } =20 void helper_sdm(CPUMIPSState *env, target_ulong addr, target_ulong reglist, - uint32_t mem_idx) + uint32_t mmu_idx) { target_ulong base_reglist =3D reglist & 0xf; target_ulong do_r31 =3D reglist & 0x10; + uintptr_t retaddr =3D GETPC(); + MemOpIdx oi =3D make_memop_idx(mo_endian_env(env) | MO_UQ | MO_UNALN, + mmu_idx); =20 if (base_reglist > 0 && base_reglist <=3D ARRAY_SIZE(multiple_regs)) { - target_ulong i; - - for (i =3D 0; i < base_reglist; i++) { - cpu_stq_mmuidx_ra(env, addr, env->active_tc.gpr[multiple_regs[= i]], - mem_idx, GETPC()); + for (unsigned i =3D 0; i < base_reglist; i++) { + cpu_stq_mmu(env, addr, env->active_tc.gpr[multiple_regs[i]], + oi, retaddr); addr +=3D 8; } } =20 if (do_r31) { - cpu_stq_mmuidx_ra(env, addr, env->active_tc.gpr[31], mem_idx, GETP= C()); + cpu_stq_mmu(env, addr, env->active_tc.gpr[31], oi, retaddr); } } =20 --=20 2.51.0