summaryrefslogtreecommitdiff
path: root/target/cris
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2021-06-22 07:20:30 -0700
committerRichard Henderson <richard.henderson@linaro.org>2021-06-29 10:04:56 -0700
commitafd5a3310c073bf0dfdbb5caaa9f70803d0798be (patch)
treeb381987bc3798c5d9640688a585d25d36595d91f /target/cris
parent5899ce683edab9c8f6e1d46867245e0c3564eadc (diff)
target/cris: Fold unhandled X_FLAG changes into cpustate_changed
We really do this already, by including them into the same test. This just hoists the expression up a bit. Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/cris')
-rw-r--r--target/cris/translate.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/target/cris/translate.c b/target/cris/translate.c
index e14b7acb10..80276ae84d 100644
--- a/target/cris/translate.c
+++ b/target/cris/translate.c
@@ -3217,6 +3217,10 @@ static void cris_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs)
cris_clear_x_flag(dc);
}
+ /* Fold unhandled changes to X_FLAG into cpustate_changed. */
+ dc->cpustate_changed |= !dc->flagx_known;
+ dc->cpustate_changed |= dc->flags_x != (dc->base.tb->flags & X_FLAG);
+
/*
* Check for delayed branches here. If we do it before
* actually generating any host code, the simulator will just
@@ -3227,9 +3231,7 @@ static void cris_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs)
t_gen_movi_env_TN(dslot, 0);
}
- if (dc->cpustate_changed
- || !dc->flagx_known
- || (dc->flags_x != (dc->base.tb->flags & X_FLAG))) {
+ if (dc->cpustate_changed) {
cris_store_direct_jmp(dc);
}
@@ -3263,10 +3265,7 @@ static void cris_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs)
}
/* Force an update if the per-tb cpu state has changed. */
- if (dc->base.is_jmp == DISAS_NEXT
- && (dc->cpustate_changed
- || !dc->flagx_known
- || (dc->flags_x != (dc->base.tb->flags & X_FLAG)))) {
+ if (dc->base.is_jmp == DISAS_NEXT && dc->cpustate_changed) {
dc->base.is_jmp = DISAS_UPDATE;
tcg_gen_movi_tl(env_pc, dc->pc);
}