Re: [Qemu-devel] [PATCH v2 1/5] tcg: Refactor helper_lookup_tb_ptr

2017-06-16 Thread Richard Henderson
On 06/16/2017 01:19 PM, Emilio G. Cota wrote: While booting debian-arm I'm measuring (see below) a hit rate in the high 90's for the htable lookups here, so adding an 'unlikely()' hint would be a good idea. GCC already predicts null pointers unlikely. We get identical code with and without the

Re: [Qemu-devel] [PATCH v2 1/5] tcg: Refactor helper_lookup_tb_ptr

2017-06-16 Thread Emilio G. Cota
On Wed, Jun 14, 2017 at 12:48:17 -0700, Richard Henderson wrote: > --- a/tcg-runtime.c > +++ b/tcg-runtime.c (snip) > tb = tb_htable_lookup(cpu, addr, cs_base, flags); > -if (likely(tb)) { > -atomic_set(&cpu->tb_jmp_cache[tb_jmp_cache_hash_func(addr)], tb); > -

Re: [Qemu-devel] [PATCH v2 1/5] tcg: Refactor helper_lookup_tb_ptr

2017-06-15 Thread Alex Bennée
Richard Henderson writes: > We can call tb_htable_lookup even when the tb_jmp_cache > is completely empty. Therefore, un-nest most of the code > dependent on tb != NULL from the read from the cache. > > Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée > --- > tcg-runtime.c | 34 ++

[Qemu-devel] [PATCH v2 1/5] tcg: Refactor helper_lookup_tb_ptr

2017-06-14 Thread Richard Henderson
We can call tb_htable_lookup even when the tb_jmp_cache is completely empty. Therefore, un-nest most of the code dependent on tb != NULL from the read from the cache. Signed-off-by: Richard Henderson --- tcg-runtime.c | 34 ++ 1 file changed, 18 insertions(+), 16