> previously returned tb. This is usually 0/1. When running icount, you > can also get a 2 value in these least significant digits, indicating > that the translation block was restarted due to the > icount_decr.u16.low field being exhausted but having instructions left > to execute in icount_extra. This 2 value falls through to tb_add_jump, > which then updates the tb's jmp_first field, as both tb and next_tb > refer to the same translation block. My question is why is this > necessary, why not do nothing, and leave the previous chaining intact? > I hope this is clearer and thanks for the response. -Jim
I have a question here. Look at gen_icount_start and gen_icount_end in gen-icount.h, I think the least significant bits are set to 2 by following code. tcg_gen_exit_tb((tcg_target_long)tb + 2); And you said, "indicating that the translation block was restarted due to the icount_decr.u16.low field being exhausted but having instructions left to execute in icount_extra." >From the code snipt of gen_icount_start below, I can only figure out something (icount_decr.u32?) is exhausted so it will jump to label set by gen_icount_end and execute "tcg_gen_exit_tb((tcg_target_long)tb + 2)". I only see icount_extra and icount_decr.u16.low are dealt in cpu_exec (cpu-exec.c). Do I miss something or misunderstand what you said? Thanks. --- icount_label = gen_new_label(); count = tcg_temp_local_new_i32(); tcg_gen_ld_i32(count, cpu_env, offsetof(CPUState, icount_decr.u32)); /* This is a horrid hack to allow fixing up the value later. */ icount_arg = gen_opparam_ptr + 1; tcg_gen_subi_i32(count, count, 0xdeadbeef); tcg_gen_brcondi_i32(TCG_COND_LT, count, 0, icount_label); --- Regards, chenwj -- Wei-Ren Chen (陳韋任) Computer Systems Lab, Institute of Information Science, Academia Sinica, Taiwan (R.O.C.) Tel:886-2-2788-3799 #1667 Homepage: http://people.cs.nctu.edu.tw/~chenwj