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: <20170720141333.vqpeuzox7qusig2c@hirez.programming.kicks-ass.net>
Date:   Thu, 20 Jul 2017 16:13:33 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Joe Perches <joe@...ches.com>
Cc:     Linus Torvalds <torvalds@...ux-foundation.org>,
        Anshul Garg <aksgarg1989@...il.com>,
        Davidlohr Bueso <dave@...olabs.net>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        anshul.g@...sung.com, Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH] lib/int_sqrt.c: Optimize square root function

On Thu, Jul 20, 2017 at 04:52:49AM -0700, Joe Perches wrote:
> On Thu, 2017-07-20 at 13:24 +0200, Peter Zijlstra wrote:
> []
> > +	m = 1UL << ((fls(x) + 1) & ~1UL);
> 
> maybe 
> 
> #if BITS_PER_LONG == 64
> 	m = 1UL << ((fls64(x) + 1) & ~1UL);
> #else
> 	m = 1UL << ((fls(x) + 1) & ~1UL);
> #endif

We do seem to have __fls() which is defined on long.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ