summaryrefslogtreecommitdiffstats
path: root/target/lm32/translate.c
diff options
context:
space:
mode:
authorRichard Henderson2019-04-16 08:54:54 +0200
committerRichard Henderson2019-04-24 22:04:33 +0200
commit8b86d6d25807e13a63ab6ea879f976b9f18cc45a (patch)
treef29fd7599e756b459c2fca9af822a6c151fe4ea5 /target/lm32/translate.c
parenttcg/aarch64: Support INDEX_op_extract2_{i32,i64} (diff)
downloadqemu-8b86d6d25807e13a63ab6ea879f976b9f18cc45a.tar.gz
qemu-8b86d6d25807e13a63ab6ea879f976b9f18cc45a.tar.xz
qemu-8b86d6d25807e13a63ab6ea879f976b9f18cc45a.zip
tcg: Hoist max_insns computation to tb_gen_code
In order to handle TB's that translate to too much code, we need to place the control of the length of the translation in the hands of the code gen master loop. Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/lm32/translate.c')
-rw-r--r--target/lm32/translate.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/target/lm32/translate.c b/target/lm32/translate.c
index b8b5e12e63..f0e0e7058e 100644
--- a/target/lm32/translate.c
+++ b/target/lm32/translate.c
@@ -1050,7 +1050,7 @@ static inline void decode(DisasContext *dc, uint32_t ir)
}
/* generate intermediate code for basic block 'tb'. */
-void gen_intermediate_code(CPUState *cs, struct TranslationBlock *tb)
+void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns)
{
CPULM32State *env = cs->env_ptr;
LM32CPU *cpu = lm32_env_get_cpu(env);
@@ -1058,7 +1058,6 @@ void gen_intermediate_code(CPUState *cs, struct TranslationBlock *tb)
uint32_t pc_start;
uint32_t page_start;
int num_insns;
- int max_insns;
pc_start = tb->pc;
dc->features = cpu->features;
@@ -1078,13 +1077,6 @@ void gen_intermediate_code(CPUState *cs, struct TranslationBlock *tb)
page_start = pc_start & TARGET_PAGE_MASK;
num_insns = 0;
- max_insns = tb_cflags(tb) & CF_COUNT_MASK;
- if (max_insns == 0) {
- max_insns = CF_COUNT_MASK;
- }
- if (max_insns > TCG_MAX_INSNS) {
- max_insns = TCG_MAX_INSNS;
- }
gen_tb_start(tb);
do {