[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2388o883-4317-1n2n-70po-ro7os5qo41so@syhkavp.arg>
Date: Wed, 18 Jun 2025 12:42:41 -0400 (EDT)
From: Nicolas Pitre <nico@...xnic.net>
To: David Laight <david.laight.linux@...il.com>
cc: Andrew Morton <akpm@...ux-foundation.org>, linux-kernel@...r.kernel.org,
u.kleine-koenig@...libre.com, Oleg Nesterov <oleg@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Biju Das <biju.das.jz@...renesas.com>
Subject: Re: [PATCH v3 next 09/10] lib: mul_u64_u64_div_u64() Optimise the
divide code
On Wed, 18 Jun 2025, Nicolas Pitre wrote:
> On Wed, 18 Jun 2025, David Laight wrote:
>
> > If the low divisor bits are zero an alternative simpler divide
> > can be used (you want to detect it before the left align).
> > I deleted that because it complicates things and probably doesn't
> > happen often enough outside the tests cases.
>
> Depends. On 32-bit systems that might be worth it. Something like:
>
> if (unlikely(sizeof(long) == 4 && !(u32)d))
> return div_u64(n_hi, d >> 32);
Well scratch that. Won't work obviously.
Nicolas
Powered by blists - more mailing lists