Messages in this thread | | | Date | Tue, 10 Oct 2023 13:03:21 +0200 | Subject | Re: [PATCH v6 1/5] lib/bitmap: add bitmap_{read,write}() | From | Rasmus Villemoes <> |
| |
On 10/10/2023 11.17, Alexander Potapenko wrote:
>> 'behaves similarly' sounds like an understatement. I think, it behaves >> much faster because it can assign up to 64 bits at once, not mentioning >> the pressure on cache lines traffic. > > My intent was to describe the visible behavior, of course the > generated code is better, and the number of memory accesses lower. > > How about the following description: > > * The result of bitmap_write() is similar to @nbits calls of assign_bit(), i.e. > * bits beyond @nbits are ignored: > * > * for (bit = 0; bit < nbits; bit++) > * assign_bit(start + bit, bitmap, val & BIT(bit)); > > ?
C programmers should know the meaning of the term "as-if". Perhaps use that. Smth like "bitmap_write() behaves as-if implemented as @nbits calls of __assign_bit()".
Rasmus
| |