Re: [PATCH v2 03/16] target/mips: Introduce mo_endian_env() helper

2024-10-13 Thread Richard Henderson

On 10/10/24 14:50, Philippe Mathieu-Daudé wrote:

Introduce mo_endian_env() which returns the endian
MemOp corresponding to the vCPU env.

Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: Jiaxun Yang
Tested-by: Jiaxun Yang
---
  target/mips/internal.h | 5 +
  1 file changed, 5 insertions(+)


Reviewed-by: Richard Henderson 

r~



[PATCH v2 03/16] target/mips: Introduce mo_endian_env() helper

2024-10-10 Thread Philippe Mathieu-Daudé
Introduce mo_endian_env() which returns the endian
MemOp corresponding to the vCPU env.

Signed-off-by: Philippe Mathieu-Daudé 
Reviewed-by: Jiaxun Yang 
Tested-by: Jiaxun Yang 
---
 target/mips/internal.h | 5 +
 1 file changed, 5 insertions(+)

diff --git a/target/mips/internal.h b/target/mips/internal.h
index 84c8e5e1ae7..91c786cff8a 100644
--- a/target/mips/internal.h
+++ b/target/mips/internal.h
@@ -230,6 +230,11 @@ static inline bool mips_env_is_bigendian(CPUMIPSState *env)
 return extract32(env->CP0_Config0, CP0C0_BE, 1);
 }
 
+static inline MemOp mo_endian_env(CPUMIPSState *env)
+{
+return mips_env_is_bigendian(env) ? MO_BE : MO_LE;
+}
+
 static inline void restore_pamask(CPUMIPSState *env)
 {
 if (env->hflags & MIPS_HFLAG_ELPA) {
-- 
2.45.2