]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target/ppc: Inline cpu_ldl_code() call in ppc_ldl_code()
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Thu, 20 Nov 2025 20:00:33 +0000 (21:00 +0100)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 3 Feb 2026 13:57:33 +0000 (14:57 +0100)
In preparation of removing the cpu_ldl_code wrapper, inline it.

Get the runtime endianness with ppc_data_endian_env(), passing it
to cpu_ldl_code_mmu(). No need to swap versus qemu-system binary
anymore.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20260202210106.93257-12-philmd@linaro.org>

target/ppc/tcg-excp_helper.c

index 3f9eb3d924e2b2792827ce6a7a0279f62edf163d..5e6c1e326d46e1ed9ac7200c079b7002f7c425e1 100644 (file)
@@ -428,22 +428,13 @@ G_NORETURN void powerpc_checkstop(CPUPPCState *env, const char *reason)
     cpu_loop_exit_noexc(cs);
 }
 
-/* Return true iff byteswap is needed to load instruction */
-static inline bool insn_need_byteswap(CPUArchState *env)
-{
-    /* SYSTEM builds TARGET_BIG_ENDIAN. Need to swap when MSR[LE] is set */
-    return !!(env->msr & ((target_ulong)1 << MSR_LE));
-}
-
 uint32_t ppc_ldl_code(CPUArchState *env, target_ulong addr)
 {
-    uint32_t insn = cpu_ldl_code(env, addr);
-
-    if (insn_need_byteswap(env)) {
-        insn = bswap32(insn);
-    }
+    CPUState *cs = env_cpu(env);
+    MemOp op_end = ppc_data_endian_env(env);
+    MemOpIdx oi = make_memop_idx(MO_UL | op_end, cpu_mmu_index(cs, true));
 
-    return insn;
+    return cpu_ldl_code_mmu(env, addr, oi, 0);
 }
 
 #if defined(TARGET_PPC64)