Re: [PATCH 4/6] xen/bitops: Introduce for_each_set_bit()

2024-08-23 Thread Andrew Cooper
On 26/06/2024 11:17 am, Jan Beulich wrote: > On 25.06.2024 21:07, Andrew Cooper wrote: >> The prior version (renamed to bitmap_for_each()) was inefficeint when used >> over a scalar, but this is the more common usage even before accounting for >> the many opencoded forms. >> >> Introduce a new vers

Re: [PATCH 4/6] xen/bitops: Introduce for_each_set_bit()

2024-06-26 Thread Andrew Cooper
On 26/06/2024 1:03 pm, Jan Beulich wrote: > On 25.06.2024 21:07, Andrew Cooper wrote: >> --- a/xen/include/xen/bitops.h >> +++ b/xen/include/xen/bitops.h >> @@ -56,6 +56,16 @@ static always_inline __pure unsigned int ffs64(uint64_t x) >> return !x || (uint32_t)x ? ffs(x) : ffs(x >> 32) + 3

Re: [PATCH 4/6] xen/bitops: Introduce for_each_set_bit()

2024-06-26 Thread Jan Beulich
On 25.06.2024 21:07, Andrew Cooper wrote: > --- a/xen/include/xen/bitops.h > +++ b/xen/include/xen/bitops.h > @@ -56,6 +56,16 @@ static always_inline __pure unsigned int ffs64(uint64_t x) > return !x || (uint32_t)x ? ffs(x) : ffs(x >> 32) + 32; > } > > +/* > + * A type-generic ffs() whi

Re: [PATCH 4/6] xen/bitops: Introduce for_each_set_bit()

2024-06-26 Thread Jan Beulich
On 25.06.2024 21:07, Andrew Cooper wrote: > The prior version (renamed to bitmap_for_each()) was inefficeint when used > over a scalar, but this is the more common usage even before accounting for > the many opencoded forms. > > Introduce a new version which operates on scalars only and does so wi

[PATCH 4/6] xen/bitops: Introduce for_each_set_bit()

2024-06-25 Thread Andrew Cooper
The prior version (renamed to bitmap_for_each()) was inefficeint when used over a scalar, but this is the more common usage even before accounting for the many opencoded forms. Introduce a new version which operates on scalars only and does so without spilling them to memory. This in turn require