Skip to contentSkip to conversation

target-mips: fix for missing delay slot in BC1EQZ and BC1NEZ

PATCH In review Leon Alrae 2 participants 2 messages Nov 6, 2014

lore
Share & tools
lore

Leon Alrae

author
#0 lore raw

PATCH 1/1 target-mips: fix for missing delay slot in BC1EQZ and BC1NEZ

New R6 COP1 conditional branches currently don't have delay slot. Fixing this by setting MIPS_HFLAG_BDS32 flag which is required for branches having 4-byte delay slot.

---
 target-mips/translate.c | 1 +
 1 file changed, 1 insertion(+)
target-mips/translate.c +1 -0
index 2117ce8..e83c50a 100644
@@ -8104,6 +8104,7 @@ static void gen_compute_branch1_r6(DisasContext *ctx, uint32_t op,
     MIPS_DEBUG("%s: cond %02x target " TARGET_FMT_lx, opn,
                ctx->hflags, btarget);
     ctx->btarget = btarget;
+    ctx->hflags |= MIPS_HFLAG_BDS32;
 
 out:
     tcg_temp_free_i64(t0);
Signature · 1 line
2.1.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 14 lines · Leon Alrae

New R6 COP1 conditional branches currently don't have delay slot. Fixing this by setting MIPS_HFLAG_BDS32 flag which is required for branches having 4-byte delay slot.

---
  target-mips/translate.c | 1 +
  1 file changed, 1 insertion(+)
target-mips/translate.c +0 -0
index 2117ce8..e83c50a 100644

target-mips/translate.c static void gen_compute_branch1_r6(DisasContext *ctx, uint32_t op, · line 8110

Quoted 7 lines
target-mips/translate.c +1 -0
@@ -8104,6 +8104,7 @@ static void gen_compute_branch1_r6(DisasContext *ctx, uint32_t op,
      MIPS_DEBUG("%s: cond %02x target " TARGET_FMT_lx, opn,
                 ctx->hflags, btarget);
      ctx->btarget = btarget;
+    ctx->hflags |= MIPS_HFLAG_BDS32;
 
  out:
      tcg_temp_free_i64(t0);

Regards,
Yongbok Kim