summaryrefslogtreecommitdiff
path: root/util/bitops.c
AgeCommit message (Collapse)AuthorFilesLines
2013-03-26bitops: unroll while loop in find_next_bit()Peter Lieven1-1/+17
this patch adopts the loop unrolling idea of bitmap_is_zero() to speed up the skipping of large areas with zeros in find_next_bit(). this routine is extensively used to find dirty pages in live migration. testing only the find_next_bit performance on a zeroed bitfield the loop onrolling decreased executing time by approx. 50% on x86_64. Signed-off-by: Peter Lieven <pl@kamp.de> Signed-off-by: Juan Quintela <quintela@redhat.com>
2013-02-16bitops: Replace bitops_ctol with ctzlRichard Henderson1-1/+1
The is the only remaining user. Signed-off-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-02-16bitops: Inline bitops_flslRichard Henderson1-1/+1
This is the only remaining user. Signed-off-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-02-16bitops: Use non-bitops ctzlRichard Henderson1-1/+1
The use of ctz has already eliminated zero, and thus the difference in edge conditions between the two routines is irrelevant. Signed-off-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-02-02bitops: unify bitops_ffsl with the one in host-utils.h, call it bitops_ctzlPaolo Bonzini1-2/+2
We had two copies of a ffs function for longs with subtly different semantics and, for the one in bitops.h, a confusing name: the result was off-by-one compared to the library function ffsl. Unify the functions into one, and solve the name problem by calling the 0-based functions "bitops_ctzl" and "bitops_ctol" respectively. This also fixes the build on platforms with ffsl, including Mac OS X and Windows. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Tested-by: Andreas Färber <afaerber@suse.de> Tested-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-12build: move libqemuutil.a components to util/Paolo Bonzini1-0/+142
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>