On Sat, May 12, 2018 at 10:57 AM, Richard Henderson <richard.hender...@linaro.org> wrote: > Signed-off-by: Richard Henderson <richard.hender...@linaro.org> > --- > target/xtensa/translate.c | 229 ++++++++++++++++++++------------------ > 1 file changed, 122 insertions(+), 107 deletions(-)
[...] > - } while (dc->base.is_jmp == DISAS_NEXT && > - insn_count < max_insns && > - dc->pc - page_start < TARGET_PAGE_SIZE && > - dc->pc - page_start + xtensa_insn_len(env, dc) <= > TARGET_PAGE_SIZE > - && !tcg_op_buf_full()); > -done: [...] > + /* End the TB if the next insn will cross into the next page. */ > + page_start = dc->base.pc_first & TARGET_PAGE_MASK; > + if (dc->base.is_jmp == DISAS_NEXT && > + dc->pc - page_start < TARGET_PAGE_SIZE && > + dc->pc - page_start + xtensa_insn_len(env, dc) <= TARGET_PAGE_SIZE) { Originally it was the condition to continue translation. To end the TB when the next instruction will cross into the next page the condition must be changed to something like if (dc->base.is_jmp == DISAS_NEXT && (dc->pc - page_start >= TARGET_PAGE_SIZE || dc->pc - page_start + xtensa_insn_len(env, dc) > TARGET_PAGE_SIZE)) { With that change all tests in tests/tcg/xtensa are passing. I'll play with it some more... -- Thanks. -- Max