Re: [PATCH 2/5] bits_per_long.h: introduce SMALL_CONST() macro

2021-01-29 Thread Yury Norov
On Fri, Jan 29, 2021 at 1:11 PM Andy Shevchenko wrote: > > On Fri, Jan 29, 2021 at 10:49 PM Yury Norov wrote: > > > > Many algorithms become simplier if they are passed with relatively small > > simpler > > > input values. One example is bitmap operations when the whole bitmap fits > > into one w

Re: [PATCH 2/5] bits_per_long.h: introduce SMALL_CONST() macro

2021-01-29 Thread Yury Norov
On Fri, Jan 29, 2021 at 1:11 PM Andy Shevchenko wrote: > > On Fri, Jan 29, 2021 at 10:49 PM Yury Norov wrote: > > > > Many algorithms become simplier if they are passed with relatively small > > simpler > > > input values. One example is bitmap operations when the whole bitmap fits > > into one w

Re: [PATCH 2/5] bits_per_long.h: introduce SMALL_CONST() macro

2021-01-29 Thread Joe Perches
On Fri, 2021-01-29 at 23:10 +0200, Andy Shevchenko wrote: > On Fri, Jan 29, 2021 at 10:49 PM Yury Norov wrote: [] > > @@ -37,7 +37,7 @@ > >  #define GENMASK(h, l) \ > > (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l)) > > > > -#define BITS_FIRST(nr) GENMASK(nr), 0) > > +#define BITS_

Re: [PATCH 2/5] bits_per_long.h: introduce SMALL_CONST() macro

2021-01-29 Thread Andy Shevchenko
On Fri, Jan 29, 2021 at 10:49 PM Yury Norov wrote: > > Many algorithms become simplier if they are passed with relatively small simpler > input values. One example is bitmap operations when the whole bitmap fits > into one word. To implement such simplifications, linux/bitmap.h declares > small_

[PATCH 2/5] bits_per_long.h: introduce SMALL_CONST() macro

2021-01-29 Thread Yury Norov
Many algorithms become simplier if they are passed with relatively small input values. One example is bitmap operations when the whole bitmap fits into one word. To implement such simplifications, linux/bitmap.h declares small_const_nbits() macro. Other subsystems may also benefit from optimizatio