Rather a runtime endianness check via env MSR over
a build-time one.

Now CPU can change endianness at runtime.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Anton Johansson <[email protected]>
---
 target/ppc/internal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/ppc/internal.h b/target/ppc/internal.h
index e6e60de95a4..dda23b66096 100644
--- a/target/ppc/internal.h
+++ b/target/ppc/internal.h
@@ -37,7 +37,7 @@ static inline bool ppc_env_is_little_endian(const CPUPPCState 
*env)
  */
 static inline MemOp ppc_data_endian_env(const CPUPPCState *env)
 {
-    return MO_TE;
+    return ppc_env_is_little_endian(env) ? MO_LE : MO_BE;
 }
 
 /* PM instructions */
-- 
2.52.0


Reply via email to