aboutsummaryrefslogtreecommitdiff
path: root/target-mips/translate.c
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-04-05 23:21:37 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-04-05 23:21:37 +0000
commitc53f4a62e3a87b4200d7245ae273a4d187394779 (patch)
treea64825443fca331ff9fc180417c127a03ebe70c8 /target-mips/translate.c
parent5a63bcb2d27675a3fc2c5bc8a8c323e5c756e749 (diff)
fix branch delay slot cornercases.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2615 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-mips/translate.c')
-rw-r--r--target-mips/translate.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/target-mips/translate.c b/target-mips/translate.c
index 7b7c464fb7..8da8cc4034 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -1640,6 +1640,10 @@ static void gen_compute_branch (DisasContext *ctx, uint32_t opc,
likely:
ctx->hflags |= MIPS_HFLAG_BL;
break;
+ default:
+ MIPS_INVAL("conditional branch/jump");
+ generate_exception(ctx, EXCP_RI);
+ return;
}
gen_op_set_bcond();
}
@@ -1650,7 +1654,6 @@ static void gen_compute_branch (DisasContext *ctx, uint32_t opc,
gen_op_set_T0(ctx->pc + 8);
gen_op_store_T0_gpr(blink);
}
- return;
}
/* special3 bitfield operations */
@@ -5053,7 +5056,7 @@ static void decode_opc (CPUState *env, DisasContext *ctx)
break;
}
if (ctx->hflags & MIPS_HFLAG_BMASK) {
- int hflags = ctx->hflags;
+ int hflags = ctx->hflags & MIPS_HFLAG_BMASK;
/* Branches completion */
ctx->hflags &= ~MIPS_HFLAG_BMASK;
ctx->bstate = BS_BRANCH;