]> git.proxmox.com Git - mirror_qemu.git/commit
target/nios2 : Explicitly ask for target-endian loads and stores
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 23 Jun 2023 17:25:56 +0000 (18:25 +0100)
committerRichard Henderson <richard.henderson@linaro.org>
Sat, 1 Jul 2023 06:26:54 +0000 (08:26 +0200)
commit6ab1790226bcf55e6b3cdff1d0253c90d63de69f
treede85fdd221b5d6e9e8df469f25608905bb08e2bd
parentec2297bda2640ce2222a232abf6d0f92b8639b57
target/nios2 : Explicitly ask for target-endian loads and stores

When we generate code for guest loads and stores, at the moment they
end up being requests for a host-endian access. So for target-system-nios2
(little endian) a load like
   ldw        r3,0(r4)
results on an x86 host in the TCG IR
   qemu_ld_a32_i32 r3,loc2,al+leul,0
but on s390 it is
   qemu_ld_a32_i32 r3,loc2,al+beul,0

The result is that guests don't work on big-endian hosts.

Use the MO_TE* memops rather than the plain ones.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1693
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230623172556.1951974-1-peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
target/nios2/translate.c