On 9/10/25 10:18, Philippe Mathieu-Daudé wrote:
We only build the OpenRISC targets using big endianness order:

   $ git grep TARGET_BIG_ENDIAN configs/targets/or1k-*
   configs/targets/or1k-linux-user.mak:2:TARGET_BIG_ENDIAN=y
   configs/targets/or1k-softmmu.mak:2:TARGET_BIG_ENDIAN=y

Therefore the MO_TE definition always expands to MO_BE. Use the
latter to simplify.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
---
  target/openrisc/translate.c | 16 ++++++++--------
  1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/target/openrisc/translate.c b/target/openrisc/translate.c
index df0ebcd3138..4ece2547614 100644
--- a/target/openrisc/translate.c
+++ b/target/openrisc/translate.c
@@ -647,7 +647,7 @@ static bool trans_l_lwa(DisasContext *dc, arg_load *a)
      check_r0_write(dc, a->d);
      ea = tcg_temp_new();
      tcg_gen_addi_tl(ea, cpu_R(dc, a->a), a->i);
-    tcg_gen_qemu_ld_tl(cpu_R(dc, a->d), ea, dc->mem_idx, MO_TE | MO_UL);
+    tcg_gen_qemu_ld_tl(cpu_R(dc, a->d), ea, dc->mem_idx, MO_BE | MO_UL);
      tcg_gen_mov_tl(cpu_lock_addr, ea);
      tcg_gen_mov_tl(cpu_lock_value, cpu_R(dc, a->d));
      return true;
@@ -665,13 +665,13 @@ static void do_load(DisasContext *dc, arg_load *a, MemOp 
mop)
static bool trans_l_lwz(DisasContext *dc, arg_load *a)
  {
-    do_load(dc, a, MO_TE | MO_UL);
+    do_load(dc, a, MO_BE | MO_UL);
      return true;
  }
static bool trans_l_lws(DisasContext *dc, arg_load *a)
  {
-    do_load(dc, a, MO_TE | MO_SL);
+    do_load(dc, a, MO_BE | MO_SL);
      return true;
  }

Hmm should we move MO_BE within do_load()?

Reply via email to