[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20260120221528.648bc9a2@pumpkin>
Date: Tue, 20 Jan 2026 22:15:28 +0000
From: David Laight <david.laight.linux@...il.com>
To: David Desobry <david.desobry@...malgen.com>
Cc: "H. Peter Anvin" <hpa@...or.com>, tglx@...nel.org, mingo@...hat.com,
bp@...en8.de, dave.hansen@...ux.intel.com, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86/lib: Fix num_digits() signed overflow for INT_MIN
On Tue, 20 Jan 2026 18:48:54 +0100
David Desobry <david.desobry@...malgen.com> wrote:
> Fair point! I've sent a v2 that replaces the loop with a switch
> statement (using GCC ranges). It's faster,
Look at the 'crap' that clang generates.
And remember that mispredicted branches are expensive and the default
is either 'random', 'not taken' or 'backwards branches taken'.
It is likely better to have a lot of not-taken branches than a binary tree.
David
Powered by blists - more mailing lists