[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z7tw2_AEcp9mYXOX@vaxr-BM6660-BM6360>
Date: Mon, 24 Feb 2025 03:02:51 +0800
From: I Hsin Cheng <richard120310@...il.com>
To: David Laight <david.laight.linux@...il.com>
Cc: yury.norov@...il.com, anshuman.khandual@....com, arnd@...db.de,
linux-kernel@...r.kernel.org, jserv@...s.ncku.edu.tw,
skhan@...uxfoundation.org, mka@...omium.org,
akpm@...ux-foundation.org
Subject: Re: [PATCH v2] uapi: Revert "bitops: avoid integer overflow in
GENMASK(_ULL)"
On Sat, Feb 22, 2025 at 09:11:28AM +0000, David Laight wrote:
> On Fri, 21 Feb 2025 15:41:49 +0800
> I Hsin Cheng <richard120310@...il.com> wrote:
>
> > This patch reverts 'commit c32ee3d9abd2("bitops: avoid integer overflow in
> > GENMASK(_ULL)")'.
> >
> > The code generation can be shrink by over 1k by reverting the commit.
>
> While you are setup for testing this (and me being lazy) does changing
> the definition to be:
> (2u << hi) - (1u << lo)
> make it any smaller.
>
> (A summary of the size summary would do, no point listing lots of '-1')
>
> That can also be written:
> ((one + one) << hi) - (one << lo)
> so an appropriately typed 'one' (1, 1u, 1ul, 1ull, (__uint128)1 etc) can
> be passed.
>
> David
Hi David,
> While you are setup for testing this (and me being lazy) does changing
> the definition to be:
> (2u << hi) - (1u << lo)
> make it any smaller.
No problem, I'll run some tests againsts it and let you know in the next
iteration, thanks for your suggestion!
Let's leave this thread here first since it's too large.
Best regards,
I Hsin Cheng.
Powered by blists - more mailing lists