From: Philippe Mathieu-Daudé Date: Tue, 3 Feb 2026 15:41:31 +0000 (+0100) Subject: target/sparc: Remove dubious swapping in LD_code() helper X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f811e8ba6ce516b962182f5f3261b804e59d6c95;p=thirdparty%2Fqemu.git target/sparc: Remove dubious swapping in LD_code() helper Since the endianness is contained in %oi, cpu_ld*_code_mmu() has already honored it. Swapping again makes no sense. Remove the bswap() calls. Fixes: 2786a3f8d3a ("Use GET_ASI_CODE for ASI_KERNELTXT / ASI_USERTXT") Reported-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20260203230054.23667-4-philmd@linaro.org> --- diff --git a/target/sparc/ldst_helper.c b/target/sparc/ldst_helper.c index 3bc6a6827a..4ec8799d1f 100644 --- a/target/sparc/ldst_helper.c +++ b/target/sparc/ldst_helper.c @@ -1169,27 +1169,18 @@ uint64_t helper_ld_code(CPUSPARCState *env, target_ulong addr, uint32_t oi) break; case MO_16: ret = cpu_ldw_code_mmu(env, addr, oi, ra); - if ((mop & MO_BSWAP) != MO_TE) { - ret = bswap16(ret); - } if (mop & MO_SIGN) { ret = (int16_t)ret; } break; case MO_32: ret = cpu_ldl_code_mmu(env, addr, oi, ra); - if ((mop & MO_BSWAP) != MO_TE) { - ret = bswap32(ret); - } if (mop & MO_SIGN) { ret = (int32_t)ret; } break; case MO_64: ret = cpu_ldq_code_mmu(env, addr, oi, ra); - if ((mop & MO_BSWAP) != MO_TE) { - ret = bswap64(ret); - } break; default: g_assert_not_reached();