Re: [Qemu-devel] [PATCH] bitops: provide an inline implementation of find_first_bit

2014-06-20 Thread Aurelien Jarno
On Fri, Jun 20, 2014 at 10:58:31AM +0200, Paolo Bonzini wrote: > Il 20/06/2014 10:48, Aurelien Jarno ha scritto: > >In practice on x86_64, this function takes 27 instructions in the > >general case, and 18 instructions in the fixed case, even for big > >sizes. I therefore think that checking if the

Re: [Qemu-devel] [PATCH] bitops: provide an inline implementation of find_first_bit

2014-06-20 Thread Paolo Bonzini
Il 20/06/2014 10:48, Aurelien Jarno ha scritto: In practice on x86_64, this function takes 27 instructions in the general case, and 18 instructions in the fixed case, even for big sizes. I therefore think that checking if the size is constant is a good idea, but we should not make any test on the

Re: [Qemu-devel] [PATCH] bitops: provide an inline implementation of find_first_bit

2014-06-20 Thread Aurelien Jarno
On Thu, Jun 19, 2014 at 10:36:18AM +0200, Paolo Bonzini wrote: > Il 22/12/2013 12:32, Aurelien Jarno ha scritto: > >find_first_bit has started to be used heavily in TCG code. The current > >implementation based on find_next_bit is not optimal and can't be > >optimized be the compiler if the bit arr

Re: [Qemu-devel] [PATCH] bitops: provide an inline implementation of find_first_bit

2014-06-19 Thread Paolo Bonzini
Il 22/12/2013 12:32, Aurelien Jarno ha scritto: find_first_bit has started to be used heavily in TCG code. The current implementation based on find_next_bit is not optimal and can't be optimized be the compiler if the bit array has a fixed size, which is the case most of the time. If you mean b

Re: [Qemu-devel] [PATCH] bitops: provide an inline implementation of find_first_bit

2013-12-22 Thread Richard Henderson
On 12/22/2013 03:32 AM, Aurelien Jarno wrote: > find_first_bit has started to be used heavily in TCG code. The current > implementation based on find_next_bit is not optimal and can't be > optimized be the compiler if the bit array has a fixed size, which is > the case most of the time. > > This n

[Qemu-devel] [PATCH] bitops: provide an inline implementation of find_first_bit

2013-12-22 Thread Aurelien Jarno
find_first_bit has started to be used heavily in TCG code. The current implementation based on find_next_bit is not optimal and can't be optimized be the compiler if the bit array has a fixed size, which is the case most of the time. This new implementation does not use find_next_bit and is yet sm