lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <46368602-13n7-s878-s7o2-76sr0q67n9q4@syhkavp.arg>
Date: Tue, 1 Apr 2025 16:30:34 -0400 (EDT)
From: Nicolas Pitre <nico@...xnic.net>
To: David Laight <david.laight.linux@...il.com>
cc: Uwe Kleine-König <u.kleine-koenig@...libre.com>, 
    Andrew Morton <akpm@...ux-foundation.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] math64: Provide an uprounding variant of
 mul_u64_u64_div_u64()

On Tue, 1 Apr 2025, Nicolas Pitre wrote:

> On Tue, 1 Apr 2025, David Laight wrote:
> 
> > Looking at the C version, I wonder if the two ilog2() calls are needed.
> > They may not be cheap, and are the same as checking 'n_hi == 0'.
> 
> Which two calls? I see only one.

Hmmm, sorry. If by ilog2() you mean the clz's then those are cheap. Most 
CPUs have a dedicated instruction for that. The ctz, though, is more 
expensive (unless it is ARMv7 and above with an RBIT instruction).

> And please explain how it can be the same as checking 'n_hi == 0'.

This question still stands.


Nicolas

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ