Re: [Qemu-devel] [PATCH] translate-all: use bitmap helpers for PageDesc's bitmap

2015-04-22 Thread Emilio G. Cota
On Wed, Apr 22, 2015 at 15:13:05 +0200, Paolo Bonzini wrote: > On 21/03/2015 07:25, Emilio G. Cota wrote: > > Note that this test > > if (b & ((1 << len) - 1)) > > can be simplified to > > if (b & 1) > > , since we know that iff the first bit of a tb is set, > > all other bits from that tb

Re: [Qemu-devel] [PATCH] translate-all: use bitmap helpers for PageDesc's bitmap

2015-04-22 Thread Paolo Bonzini
On 21/03/2015 07:25, Emilio G. Cota wrote: > Note that this test > if (b & ((1 << len) - 1)) > can be simplified to > if (b & 1) > , since we know that iff the first bit of a tb is set, > all other bits from that tb are set too. I don't think this optimization is valid, unfortunately

Re: [Qemu-devel] [PATCH] translate-all: use bitmap helpers for PageDesc's bitmap

2015-04-03 Thread Paolo Bonzini
On 03/04/2015 02:08, Emilio G. Cota wrote: > On Sat, Mar 21, 2015 at 02:25:42 -0400, Emilio G. Cota wrote: >> Note that this test >> if (b & ((1 << len) - 1)) >> can be simplified to >> if (b & 1) >> , since we know that iff the first bit of a tb is set, >> all other bits from that tb a

Re: [Qemu-devel] [PATCH] translate-all: use bitmap helpers for PageDesc's bitmap

2015-04-02 Thread Emilio G. Cota
On Sat, Mar 21, 2015 at 02:25:42 -0400, Emilio G. Cota wrote: > Note that this test > if (b & ((1 << len) - 1)) > can be simplified to > if (b & 1) > , since we know that iff the first bit of a tb is set, > all other bits from that tb are set too. > > Signed-off-by: Emilio G. Cota > -

[Qemu-devel] [PATCH] translate-all: use bitmap helpers for PageDesc's bitmap

2015-03-20 Thread Emilio G. Cota
Note that this test if (b & ((1 << len) - 1)) can be simplified to if (b & 1) , since we know that iff the first bit of a tb is set, all other bits from that tb are set too. Signed-off-by: Emilio G. Cota --- translate-all.c | 39 +-- 1 file cha