[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b371c94c-7480-5af4-d2bd-481436f535eb@rasmusvillemoes.dk>
Date: Thu, 18 Feb 2021 23:51:43 +0100
From: Rasmus Villemoes <linux@...musvillemoes.dk>
To: Yury Norov <yury.norov@...il.com>, linux-kernel@...r.kernel.org
Cc: linux-m68k@...ts.linux-m68k.org, linux-arch@...r.kernel.org,
linux-sh@...r.kernel.org, Alexey Klimov <aklimov@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Arnd Bergmann <arnd@...db.de>, David Sterba <dsterba@...e.com>,
Dennis Zhou <dennis@...nel.org>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Jianpeng Ma <jianpeng.ma@...el.com>,
Joe Perches <joe@...ches.com>,
John Paul Adrian Glaubitz <glaubitz@...sik.fu-berlin.de>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Rich Felker <dalias@...c.org>,
Stefano Brivio <sbrivio@...hat.com>,
Wei Yang <richard.weiyang@...ux.alibaba.com>,
Wolfram Sang <wsa+renesas@...g-engineering.com>,
Yoshinori Sato <ysato@...rs.sourceforge.jp>
Subject: Re: [PATCH 04/14] lib: introduce BITS_{FIRST,LAST} macro
On 18/02/2021 05.05, Yury Norov wrote:
> BITMAP_{LAST,FIRST}_WORD_MASK() in linux/bitmap.h duplicates the
> functionality of GENMASK(). The scope of there macros is wider
> than just bitmap. This patch defines 4 new macros: BITS_FIRST(),
> BITS_LAST(), BITS_FIRST_MASK() and BITS_LAST_MASK() in linux/bits.h
> on top of GENMASK() and replaces BITMAP_{LAST,FIRST}_WORD_MASK()
> to avoid duplication and increase the scope of the macros.
>
Please include some info on changes in generated code, if any. When the
parameter to the macro is a constant I'm sure it all folds to a
compile-time constant either way, but when it's not, I'm not sure gcc
can do the same optimizations when the expressions become more complicated.
Rasmus
Powered by blists - more mailing lists