aboutsummaryrefslogtreecommitdiff
path: root/target/sh4/translate.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2017-07-18 10:02:43 -1000
committerAurelien Jarno <aurelien@aurel32.net>2017-07-18 23:39:17 +0200
commitdec16c6ee8e665ec558f7564e68c09e01facf903 (patch)
tree2c9eed73942147ee198a3e7b7c6ef6bc693cc3ec /target/sh4/translate.c
parentbdcb3739024f3b6d53bd6dc34eaeafb3f2b996d9 (diff)
target/sh4: Unify code for CHECK_NOT_DELAY_SLOT
We do not need to emit N copies of raising an exception. Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net> Message-Id: <20170718200255.31647-19-rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'target/sh4/translate.c')
-rw-r--r--target/sh4/translate.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/target/sh4/translate.c b/target/sh4/translate.c
index 792a46804b..acd756e18a 100644
--- a/target/sh4/translate.c
+++ b/target/sh4/translate.c
@@ -365,11 +365,8 @@ static inline void gen_store_fpr64(DisasContext *ctx, TCGv_i64 t, int reg)
#define XHACK(x) ((((x) & 1 ) << 4) | ((x) & 0xe))
#define CHECK_NOT_DELAY_SLOT \
- if (ctx->envflags & DELAY_SLOT_MASK) { \
- gen_save_cpu_state(ctx, true); \
- gen_helper_raise_slot_illegal_instruction(cpu_env); \
- ctx->bstate = BS_EXCP; \
- return; \
+ if (ctx->envflags & DELAY_SLOT_MASK) { \
+ goto do_illegal_slot; \
}
#define CHECK_PRIVILEGED \
@@ -1796,10 +1793,12 @@ static void _decode_opc(DisasContext * ctx)
ctx->opcode, ctx->pc);
fflush(stderr);
#endif
- gen_save_cpu_state(ctx, true);
if (ctx->envflags & DELAY_SLOT_MASK) {
+ do_illegal_slot:
+ gen_save_cpu_state(ctx, true);
gen_helper_raise_slot_illegal_instruction(cpu_env);
} else {
+ gen_save_cpu_state(ctx, true);
gen_helper_raise_illegal_instruction(cpu_env);
}
ctx->bstate = BS_EXCP;