target-xtensa: fix search_pc for the last TB opcode
PATCH v2 1/1 target-xtensa: fix search_pc for the last TB opcode
Zero out tcg_ctx.gen_opc_instr_start for instructions representing the last guest opcode in the TB.
Signed-off-by Max Filippov <[email protected]>
---
Changes v1 -> v2:
- replace while loop with memset
target-xtensa/translate.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
target-xtensa/translate.c +5 -1
@@ -3005,7 +3005,11 @@ static void gen_intermediate_code_internal(gen_icount_end (tb, insn_count); *tcg_ctx.gen_opc_ptr = INDEX_op_end; -if (!search_pc) { +if (search_pc) { + j = tcg_ctx.gen_opc_ptr - tcg_ctx.gen_opc_buf; +memset (tcg_ctx.gen_opc_instr_start + lj +1 ,0 , + (j - lj) *sizeof (tcg_ctx.gen_opc_instr_start[0 ])); + }else { tb->size = dc.pc - pc_start; tb->icount = insn_count; }
Signature · 1 line
1.7.7.6
Blue Swirl
AppliedThanks, applied.
Quoted 32 lines · Max Filippov
Zero out tcg_ctx.gen_opc_instr_start for instructions representing the last guest opcode in the TB.
Signed-off-by Max Filippov <[email protected]>---
Changes v1 -> v2:
- replace while loop with memsettarget-xtensa/translate.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)target-xtensa/translate.c +5
-2@@ -3005,7 +3005,11 @@ static void gen_intermediate_code_internal(gen_icount_end (tb, insn_count); *tcg_ctx.gen_opc_ptr = INDEX_op_end; -if (!search_pc) { +if (search_pc) { + j = tcg_ctx.gen_opc_ptr - tcg_ctx.gen_opc_buf; +memset (tcg_ctx.gen_opc_instr_start + lj +1 ,0 , + (j - lj) *sizeof (tcg_ctx.gen_opc_instr_start[0 ])); + }else { tb->size = dc.pc - pc_start; tb->icount = insn_count; } --1.7.7.6